Tests: the ExecuteIndirect bind test takes the warp-test lock #3609
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3609"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T19:21:33Z.
hle::d3d12x::bind::tests::later_queue_completion_during_sleep_reclaims_before_wait_deadlinefails in parallel runs of its module: 10 of 30 runs ofhle::d3d12x::bind::tests::at--test-threads=8onmain6bfb5c5(bind.rs:10023,resultisStopped, notProgressed). It does not fail at 1 or 2 threads.The fence-wait tests take
lock_warp_testsbecause they count on the process-wide fenced two-pass batches (FENCED_RES/FENCED_BYTES).execute_indirect_reads_the_arguments_written_before_itdoes not take it. Once another test has hooked the device, its allocatorReset/Releasego throughalloc_reset/alloc_release->console_list::allocator_reset->release_allocator_res, which callsreclaim_fenced. I took backtraces of everyreclaim_fencedcall from that test in parallel runs (scratch change, not in this PR); run alone it makes none. In a failing run (an earlier scratch log of every caller) it reclaimed whileFENCED_BYTESwas 67371008, the waiting test's two batches (64 MiB + 256 KiB). It took the later batch the waiting test had just completed. The waiting test's own reclaim then found nothing, its scripted clock ran to the deadline, andwait_oldest_fenced_untilreturnedStopped.wait_oldest_fenced_reclaims_in_flight_buffer_before_refusingalso failed once in 30 module runs of the same tree with a test-only PR merged (#3511); it did not fail in the 60 runs with this change.What is in it
crates/xcl/src/hle/d3d12x/bind.rs(tests only):execute_indirect_reads_the_arguments_written_before_ittakeslock_warp_testslike the other tests that reach the fenced batches. No runtime code changes.bind.rscounts as a runtime file forpr_check.py, so this needs thetest-onlylabel instead of a smoke pair.Tested
hle::d3d12x::bind::tests:: --test-threads=8: 60 of 60 runs pass with this change (30 more on the current head756325f8, rebased ontomainf07e426d, also 30 of 30), against 20 of 30 onmain6bfb5c5(10 failures oflater_queue_completion_during_sleep_reclaims_before_wait_deadline).execute_indirect_reads_the_arguments_written_before_itstill runs here (not skipped): 1 passed.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on756325f8: 2904 passed, 0 failed, 51 ignored. SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same asmain.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:37:57Z.
Review (head
45ab946c, diff read, not a merge-check; checks red):bind.rs~5592 (and the description) says the test's submits reclaim the fenced batches throughtwo_pass_submitted, buttwo_pass_submitted(~162-195) never callsreclaim_fenced, and the test submits withqueue.ExecuteCommandListson a queue it never adopts (~5680), so the submit does not reachalloc_pool::two_pass_after_submiteither. The reclaim comes from another caller ofreclaim_fenced(release_allocator_resortake_free, ~653 / ~667); the comment should name that, or the next person chasing this race will look in the wrong place.Fine: test-only; the guard is the first local, so it is held until the test's lists and allocators are dropped, and taking the same
lock_warp_teststhe fence-wait tests use is the right fix for sharingFENCED_RES/FENCED_BYTES. The red check isPR descriptionasking for smoke blocks becausebind.rscounts as a runtime file; thetest-onlylabel is what clears it.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T21:07:28Z.
You're right, thanks:
two_pass_submitteddoes not callreclaim_fenced. I had placed the call atbind.rs:221in the wrong function; it is inTwoPassBuf::try_make_with_cap.I took backtraces of every
reclaim_fencedcall fromexecute_indirect_reads_the_arguments_written_before_it(scratch change, not pushed). Run alone, the test makes none. In parallel runs ofhle::d3d12x::bind::tests::at 8 threads, all of its calls come through the allocator hooks another test has installed on the device:alloc_reset->reset_pc_allocator->console_list::allocator_reset->release_allocator_res->reclaim_fencedalloc_release->alloc_pool::forget->console_list::allocator_reset->release_allocator_res->reclaim_fencedThe comment and the commit message now name that path. The head is
756325f8, rebased ontomainf07e426d; the description is updated. On that head:hle::d3d12x::bind::tests::at 8 threads 30 of 30, and the whole suite 2904 passed, 0 failed, 51 ignored.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T21:13:14Z.
Follow-up review (head
756325f8, since45ab946c, diff read, not a merge-check; checks red):bind.rs~5592 now says the reclaim comes from allocatorReset/Releasethroughalloc_reset/alloc_releasetorelease_allocator_res, which is the real path:alloc_reset(real.rs~11578) andalloc_release(~11546, viaalloc_pool::forget) both reachconsole_list::allocator_reset(~432), which callsrelease_allocator_resand soreclaim_fenced(bind.rs~653); the test callsalloc.Reset()(~5714) and drops its allocators.New: none.
Fine: the code is otherwise unchanged and test-only.
PR descriptionis red only becausebind.rscounts as a runtime file; thetest-onlylabel clears it.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T15:52:09Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.