← Back to Pull requests

test(core): consolidate multiprocessing child-process helpers #3151

Closed
unknown closed this pull request without merging on Oct 20, 2026 17:39 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 15:49 UTC
Author

Description

The VMM IPC and descriptor-leak tests independently implemented child execution and multiprocessing warmup. The first spawned process opens a persistent resource-tracker pipe; warming up after a file-descriptor baseline can therefore produce an order-dependent false leak failure. Child cleanup must also release IPC handles before fixture teardown.

Follow-up to the consolidation discussion on #3146.

Consolidate the common behavior in helpers/child_processes.py:

  • run_child(target, args) applies the sanitizer-aware timeout, kills surviving children when a join times out or is interrupted, checks the exit status, and closes the Process handles before returning.

  • noop(args) supplies one picklable target for warmup and argument-serialization tests.

  • warmup_multiprocessing() starts the resource tracker before descriptor counting and caches only a successful warmup.
  • Reuse these helpers in the VMM IPC and descriptor-leak tests. The serialization-failure case still serializes the resource-owning object before encountering Irreducible; its child target never executes. Tests that communicate with a running child or inspect the Process object's lifetime keep explicit process management.

    Add six spawn-based regression tests covering argument delivery, failed exits, hung-child termination, interrupted-join cleanup, warmup retry/caching, and descriptor stability. Add agent guidance explaining when to reuse the helpers and how to guard specialized process-management tests.

    Validation

    Fresh local build and validation on Linux with Python 3.12.3, CUDA 13.4, and an NVIDIA A10G:

    | QA suite | Passed | Skipped | Expected failures | Passing subtests |
    | --- | ---: | ---: | ---: | ---: |
    | cuda-pathfinder | 1,615 | 5 | 0 | 0 |
    | cuda-bindings, default stream mode | 669 | 27 | 0 | 21 |
    | cuda-bindings, per-thread default stream mode | 669 | 27 | 0 | 21 |
    | cuda-bindings Cython tests | 9 | 0 | 0 | 0 |
    | cuda-core | 3,998 | 281 | 3 | 223 |
    | cuda-core Cython tests | 1 | 0 | 0 | 0 |
    | Total | 6,961 | 340 | 3 | 265 |

  • The full build and QA runbook both exited successfully.

  • A separate fresh pytest process ran the VMM descriptor-lifetime regression first, followed by all six new helper tests: 7 passed. This checks the cold-start baseline directly.

  • pre-commit run --all-files: all applicable checks passed.

  • Skips cover unavailable hardware capabilities, multiple-GPU requirements, and optional dependencies.
  • Review And CI

    Ready for human review. This PR remains a draft solely to retain manual control over triggering CI.

    Checklist

  • New or existing tests cover these changes.

  • The documentation is up to date with these changes.
  • Diff: 397 lines (+297 / -100) across 4 files Reviewer: brandon-b-miller Review duration: 1550m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 397 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3151"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.2% (MEDIUM) · Higher = larger blast radius
    43.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.1% · Safe to merge
    17.1%