Repository navigation
Fix deferred fence signal callback lifetime (TEST-1017) - #4725
illusionart453-max wants to merge 1 commit into
Conversation
|
Verified commit
Reviewed AI-assisted (Gemini, Antigravity). |
|
Tested
Not a red control (the bug is an intermittent teardown AV — absence of a crash over 5 runs on a second NVIDIA part is corroboration, not proof). No game files. AI-assisted (Devin). |
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_fence_timing_test at 3916c46eb on Windows 11, RTX 5070 Ti: exit 0 — fences and timing: multiple-fence waits, held CPU signals, clock calibration, adapter LUID and custom heap properties all checked (calibration 0.050700 s GPU / 0.050699 s CPU; LUID matches the adapter). git diff --check clean.
The deferred fence-signal callback now holds its state for the callback's lifetime instead of capturing a reference that can expire while the signal is pending; the added case covers the released-fence signal. No blocking issue.
|
Verified on Linux (CPU-only): sits on current main, compileall clean, no Python tests affected. The callback-lifetime guard reads correctly — the mutex orders the deferred callback's semaphore access against ~Fence's released store, both paths drop the held count symmetrically, and the includes are in place. The timing test itself needs a Vulkan/Windows host and was not executed here; CI legs were still queued at check time. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Independent check of
One regression under validation, found with a release-race probe I added locally to
Why: on Heads-up: #4282 edits the same deferred-signal lambda (it pumps (Note for anyone re-running locally: after merging #4663, which changes AI-assisted (Claude Code). No game files. |
A deferred CPU Fence::Signal callback can leave FenceWaitDispatcher's pending list before the fence is released. cancel_fence_waits waits for an active Vulkan wait, but a ready callback can still query or signal the semaphore after VulkanFence destroys it. This caused intermittent access violations during d3d12_fence_timing teardown.
Add shared callback lifetime state. Fence destruction marks it released under the same mutex held while deferred callbacks access the semaphore. Active callbacks finish before destruction continues, and later callbacks skip semaphore access. Add stderr phase diagnostics to the timing test.
Claimed as TEST-1017
#4571 (comment)
Verified locally on Windows 11, NVIDIA RTX 5060, driver 610.88, MSVC 19.44, RelWithDebInfo, base 0db7fed.
Vulkan validation layers and an independent GPU check are pending. The crash dump remains local.
AI-assisted with Codex.
Depends on no other PR.