Repository navigation
Conversation
Not-Saii
left a comment
There was a problem hiding this comment.
I checked this against #3457, which fixed the same race in the sibling tests/startup_resource_retire.cpp. It's the same pattern, and the added waits sit in the right places. settle() only resubmits the drain list, so without a queue wait a "freed" check can run before the release fence passes. I also agree that the "kept" checks get stronger, not weaker, and no assertion changes.
On the claim that the added waits can't block: they can't, but the gated queue also waits on a gate in case 11 (case11_inline_stale_descriptor_draw, inline mode), not only in cases 1 and 2. That gate is signalled inside case 11 before it returns, and the cases run in a fixed order from main(), so no added wait can run while a gate is pending. Also, Context::sync times out and fails rather than hanging. The conclusion holds, and only the "cases 1 and 2" wording in the PR body is incomplete.
Same caveat as #3457: without the debug layer, the mutation can't fail locally, so the proof against hardware_debug1 is the CI failure plus the code argument. A full workflow run on the fork would exercise the _debug1 variants on the runner, if you want that before merge.
AI-assisted.
|
Confirmed: case 11 also queues a gate wait on the gated queue ( |
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed 994a36e5 by reading the diff; not built or run.
Verdict: approve. The waits close the race in every retire check of this file. No MUST.
- Checked every
settle()/stays()that follows ac.release()in the file, not only the eight changed sites. Each one now runs after both guest queues are synced. Case 1 (:621,:638), case 2 T1 (:687) and case 11 (:1147) already syncedgatedafter their gate signal, anddirectthrough an earlierstays(). Case 7's finalsettle()(:1018) follows the loop at:995-:998, which now syncs both. No gap is left in this file. - Case 6: the one wait at
:888also coversTold, released at:869.heap.Reset()at:895only drops the view reference, so the secondsettle()needs no extra wait. This agrees with the PR body. - The cited failure matches: run 46260430363 (push of #3439) fails
startup_resource_retire_title_hardware_debug1at stagenewer wrapper retired with older SRV live,retained=131072/2 expected=65536/1, which is case 6.
Tests: the PR changes only the test file. Its CI ran only startup_resource_retire_title_inline_warp_debug0, and inline mode returns right after case 11 (:1467-:1474), so no changed line ran on CI. The /O2 job, the one that runs the _debug1 variants and caught the failure, was skipped on the PR. So the first real check is main's /O2 run after merge. The local 20x runs in the PR body cover the debug0 and off variants only.
R0Y00
left a comment
There was a problem hiding this comment.
The current head conflicts with main in tests/startup_resource_retire_title.cpp. #3542 already landed the direct and gated queue waits for the reported case 6 failure in 2e30cc59. Please rebase the remaining wait sites onto current main and keep the existing assertions. A fresh run of the affected retirement variants on that head would make the remaining test-only scope clear.
R0Y00
left a comment
There was a problem hiding this comment.
I merged main into the contributor branch. The only conflict was the comment above the case 6 wait that main already has. Kept the main explanation and all remaining waits from the PR. ctest --preset dev --no-tests=error -j 1 --repeat until-fail:3 -R '^startup_resource_retire_title_' --output-on-failure passed all 10 tests three times on Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, including the debug-layer on/off variants and inline paths. Please re-review the updated head.
Refs #3507 (item c).
tests/startup_resource_retire_title.cppchecked retirement right after a release at several stages without waiting for the release-time fences.settle()only resubmits the drain list and never waits on the GPU, so a "freed" check could run before the fence passed. This is the failure seen in CI run 46260430363 on thehardware_debug1variant, case 6:retained=131072/2,expected=65536/1, i.e. the newer wrapper was still retained.The change adds a wait on both registered guest queues (
direct,gated) after the release and before the check. It is the same pattern as 80ab69e (#3457) in the sibling testtests/startup_resource_retire.cpp. One file, +9/-2, no change undersrc/.Sites
8 wait sites, 9 stages:
T_addr2 kept while slot70 SRV live, thenT_addr2 retired after heap releasedT_rgba_after_bc7 retiredTv1 held by heap1 and heap2, thenTv1 retired after descriptor overwriteTv2 held by overwritten heap2[0], thenTv2 retired after heap2 releasednewer wrapper retired with older SRV liveolder generation retiredslot 133 texture held by the closed draw list, thenslot 133 draw hold droppedgatedadded before the existingdirectwaitsclass texture with a refused RTV in a tracked slotgatedadded next todirectclass texture with a refused RTV in an untracked slotgatedadded next todirectNo assertion is removed or relaxed.
The gated queue waits on a gate fence in three cases, each signalled inside the same case: case 1 (
tests/startup_resource_retire_title.cpp:633, signalled at:638), case 2 (:659, signalled at:687) and case 11 (:1110, signalled at:1147). Cases 1 and 2 signal before the first added wait (:724). Case 11 runs only in inline mode, wheremain()returns right after it (:1467-:1474) and no case with an added wait runs. So the added waits cannot block. In off mode nothing retires and the waits are inert.Tests
At 994a36e on d3e306a, dev preset, each variant 20 times in a row (
ctest --parallel 1 --repeat until-fail:20), on WARP and on one desktop GPU:warp_debug0,hardware_debug0,off_warp,off_hardware,inline_warp_debug0,inline_hardware_debug0.warp_debug1,hardware_debug1,inline_warp_debug1,inline_hardware_debug1. The D3D12 debug layer is not installed on this machine.Not covered
hardware_debug1, the variant that failed in CI, was not run locally. The fix is not proven locally against that failure.warp_debug0andhardware_debug0each passed 120 runs out of 120. Without the debug layer the release fences pass within the drain loop, so this machine does not show that the wait is needed. That rests on the CI failure above and on the code argument.