test(core): consolidate multiprocessing child-process helpers #3151
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
brandon-b-miller
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 |
pre-commit run --all-files: all applicable checks passed.Review And CI
Ready for human review. This PR remains a draft solely to retain manual control over triggering CI.
Checklist