GTEST: Ignore fds opened by a new CUDA context in the fd leak check #12399
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 188 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.314
Real PR Conversation Timeline
1 comments
"Review active on #12399"
general
weight: 0.35
tvegas1
What?
Do not count the eventfds and pipes opened by a new CUDA context as leaks in the gtest fd leak check.
Why?
When the CUDA driver creates a context, it opens eventfds and pipes in addition to the /dev/nvidia fds, which are already whitelisted. They stay open until the context is destroyed, and the CUDA runtime keeps primary contexts until the process exits. So each test which first activates the primary context of a device is counted as an fd increase.
On a Vera Rubin node with 4 GPUs (driver 620.70.10), the first context on a device opens 22 /dev/nvidia
fds and 2 eventfds, plus 4 pipes for the first context of the process. All of them are closed by cudaDeviceReset(). In a gtest process which runs many tests, a test which switches to another device followed by a test_mem_alloc_device test, whose init() allocates on every device, fails with "fd leaks detected in 2 tests (threshold: 2)". The same tests pass when run alone, since there is at most one such increase.How?