Repository navigation
fix(cuda): release resources on init failure, and close three stale state.md rows - #1279
Merged
Merged
Conversation
lusoris
force-pushed
the
fix/gpu-init-leaks-and-hip-mirror
branch
from
September 4, 2026 21:19
3829a13 to
311c268
Compare
This was referenced Sep 4, 2026
lusoris
marked this pull request as ready for review
September 5, 2026 01:32
…h release in the backend page The ADR-0165 touch gate rejects the '#TBD' placeholder that the state.md row and its redirect comment carried; both now cite PR #1279. The ADR-0100 doc-substance gate requires a docs/backends/cuda/ edit for a CUDA feature-kernel change: the overview page gains a short 'Error-path resource release' note (no user-visible delta).
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four GPU bugs were open in
docs/state.md. Auditing them against master, three were already fixed and the ledger was stale — the single most expensive kind of drift, because it sends people to re-do finished work. One was real and is fixed here.T-HIP-MOTION-V2-MIRROR-OFF-BY-ONE-2026-06-13dcd3cad656);motion_v2_score.hip:62-69already reads2*sup - idx - 2T-SYCL-INIT-LEAKS-EXC-2026-06-1924cc85391e)T-SPEED-GPU-REGISTRY-ORPHAN-2026-06-19a0bf83c214)T-CUDA-INIT-SUBMIT-LEAKS-2026-06-19The real one
CUDA feature extractors leak already-acquired resources when
initfails part-way:integer_ms_ssim_cuda.candinteger_psnr_hvs_cuda.creturn-ENOMEMwithout releasing the device buffers, PTX module and lifecycle stream they had already taken, and the SpEED extractors share the pattern. Each error path now routes through the null-safe close spine the surrounding files already use, rather than scattering frees.All four
state.mdrows move to Recently closed — the three stale ones with the commit that actually fixed them, so the ledger stops lying.Type
fix— bug fixcuda— backend-specificChecklist
make format && make lintis green locally.meson test --suite=fast: 112 Ok, 0 Fail./cross-backend-diffand the worst ULP is ≤ 2. — n/a: these are init/teardown error paths, not numeric kernels. No score can change, because a leaking init is one that already failed..c/.cpp/.cu/.h/.hpp, it has the license header. — n/a, no new sources.!. — n/a.docs/adr/_index_fragments/. — n/a; bug fix, and the three stale rows need no new decision.docs/backends/cuda/overview.md§ "Error-path resource release (PR fix(cuda): release resources on init failure, and close three stale state.md rows #1279)" describes the release order and that there is no user-visible delta.Bug-status hygiene (ADR-0165)
docs/state.mdupdated — all four rows moved to Recently closed, the stale three annotated with the PR that actually fixed them.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.make test-netflix-golden: 271 passed, 12 skipped, 0 failed.Cross-backend numerical results
No numerical delta is possible: every change is on an
initfailure path, which by definition produces no scores. The HIP mirror — the one item in this batch that would have moved numbers — turned out to be already correct on master.Deep-dive deliverables (ADR-0108)
git log; the fourth is a leak audit of error paths.AGENTS.mdinvariant note — no rebase-sensitive invariants:core/src/feature/cuda/is wholly fork-added; upstream Netflix has no CUDA SpEED or MS-SSIM extractor.changelog.d/fixed/cuda-speed-init-leak-regression.md.docs/rebase-notes.md.Reproducer
Confirm the three stale rows really were fixed before this PR:
Then the gates:
Known follow-ups
Three of four rows being stale suggests
docs/state.mddrifts faster than it is swept. Worth a periodic reconciliation of Open rows againstgit log— the cost of a stale row is a wasted investigation, which is exactly what happened here.The HIP mirror could not be re-verified on live hardware: this host's AMD Phoenix iGPU (gfx1036) errors under ROCm 7.2. The verdict rests on reading the kernel source, which is unambiguous, not on a device run.
🤖 Generated with Claude Code