[STF] Long tail of cuda_safe_call in guards, deleters and destructors: release under notify, restore under abort #11774
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 285 lines diff across 3 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.338
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11774"
general
weight: 0.35
caugonnet
Description
The remaining
cuda_safe_callsites outside the files already covered by #11740, #11748, #11770, #11772 and #11773: twenty-two sites across eight headers, grouped by what the call does rather than where it lives.Releases,
ON_THROW(notify)aroundcuda_try. The resource leaks and is reported with its location; the frame cannot throw; nothing else is at stake.shared_ptrdeleters destroying acudaGraphExec_t:algorithm.cuh(two),executable_graph_cache.cuh.SCOPE(fail)releasing a graph that is still ours:stackable_ctx_impl.cuh(two).SCOPE(fail)freeing a buffer after a failed initialization:stream/interfaces/hashtable_linearprobing.cuh,memory.cuh(two), and the twocatch (...)fallbacks inmemory.cuh's never-throw pool inserts.stream_and_eventdestructor, the synchronization event inevent_types.cuh, the timing events instream_ctx.cuh, aSCOPE(fail)after event creation, andcudaHostUnregisterinstream_ctx.cuh.Restoring ambient state,
ON_THROW(abort). TwocuCtxPopCurrentinevent_types.cuhandcudaSetDevice(prev_device)instream_ctx.cuh. These are not releases: if restoring the context or device fails, everything after runs against the wrong one and fails somewhere unrelated, which is the misattribution failure we least want. Reporting and stopping is the honest answer.Plain calls. One
cudaEventRecordin a device-place lambda after its own fail guard becomescuda_try; thecontext.cuhunit tests use the introspectedcuda_safe_call<fn>for cleanup andcuda_tryin a task body.A bug fixed on the way. The two
cudaGraphExec_tdeleters inalgorithm.cuhneither freed the heap cell they were handed nor skipped a null handle, so every cached executable graph leaked eight bytes and a failed instantiation would have destroyed a null handle. They now do both, exactly asgraph_ctx.cuh's deleters do.After this, the only
cuda_safe_calluses left in the STF headers are the timing blocks that #11652 replaces and the sites in the four open batch PRs.Checklist
🤖 Generated with Claude Code