GPU tests: one test on the software adapter at a time (#850) #875
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!875
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-875"
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?
@eazyves on GitHub · 2026-11-25 11:31 UTC · original
eazyves:fix/warp-tests-one-at-a-time→main· +20 −1 · 4 files · 1 commits · openFor the crash in #850: the
victory-gputest binary now and then dies with an access violation when run with default threads.Where it dies. Under a small debugger loop, every second-chance access violation I looked at (the last 15) was at
d3d10warp.dll+0x8be6d, a read at0x24. Filtered runs of the test binary, crashes in 100 runs each:inplaceindirectinplace::andindirect::togetherinplaceindirectSo it needs tests of several modules on WARP at once.
victory-shader's tests already serialise for the same reason (ONE_AT_A_TIME). I have not found what in WARP goes wrong.The change. Test code only: a lock that the WARP tests in
inplace,indirect,queue2andshadowhold while they use the device.Measured, 250 runs of the whole
victory-gpulib test binary onf85101b, default threads:The "without" binary also had a retry in one
inplacetest (what #151 does), nothing else. Two things to know about the runs with the lock:warp_budget_saturates_...still fails, now in nearly every run (248 of 250; 142 without the lock). That is the order assumption #849 and #847 fix: with the lock it runs as it does alone.queue2::tests::warp_a_fetch_behind_a_fence_holds_everything_sent_before_that_fencefailed once in 250. It isn't new: running onlyqueue2::, somequeue2test failed in 3 of 150 runs without the lock (I didn't note which) and in 0 of 150 with it. I have not looked into the cause.Limits (thanks @avt0m4t48 and @MamaLeVrai for checking):
queue2's harness leaksSecond, whose timing threads can still make fence calls after the lock is let go. The two host queue tests under opt-in diagnostics WARP and the ignored tiled-resource WARP test are outside the lock.amdxc64.dll), which #850 also reports on an RX 6950 XT. My 15 were all in WARP.main, 0 in 250 with this PR; theinplacetest failed 10 times in 120 and 0 in 250 (their measurement, below).cargo xtask policypasses. Clippy's-D warningsfails onmain(#841), so I could not run it clean; I added no warnings to the test build.RX 9070 XT, driver 32.0.32029.2010, Windows 11 26200, Ryzen 7 5800X3D, run from a service session. No game data. AI-assisted (Claude Code); run on my machine.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B9LnuwwsEX2idaEjw7U39G
@avt0m4t48 on GitHub · 2026-11-25 11:40 UTC · original
I checked the exact base
f85101b6095e8cf3cecf8f0647cc7f5428daa177and head75ca59f11f333ada6b26ceeac7c72a6011e02074. The GitHub test merge has the same source tree as the head.cargo check --offline --locked --target x86_64-pc-windows-msvc -p victory-gpu --all-targets --features blake3/purepassed at both revisions on Rust 1.98.1. Addingdiagnosticsalso passed at both. Warning messages matched for each base/head pair.inplace,indirect,queue2andshadow.queue2.rsis that the test harness leaksSecondand starts its timing threads. Those threads can still make fence calls after the harness releases its guard if they are processing a queued timing notification. The two host queue tests under opt-in diagnostics WARP and the ignored tiled-resource WARP test also sit outside the shared lock.The PR's GitHub Actions run showed
action_requiredwith zero jobs when checked. I did not run native Windows or measure the crash rate, so the reported WARP stress result remains the author's measurement.@MamaLeVrai on GitHub · 2026-11-25 12:23 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head
75ca59fintomainf85101bin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warningsfails with exactly the errorsmainitself has on this machine (placed_filler_twins,depth_written, a sort; PR #841 fixes them), also with--all-features; this PR adds none.cargo test --workspace --locked: run 1: stopped atindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields(the one that fails onmainitself most runs here (PR #849 and #847 fix its assertion)); run 2: stopped atindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields(the one that fails onmainitself most runs here (PR #849 and #847 fix its assertion)) (mainalone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@MamaLeVrai on GitHub · 2026-11-25 12:28 UTC · original
Measured on another machine and card than the author's (Windows 11, RX 6950 XT, driver with
amdxc64.dll, Rust 1.98.1), running thevictory-gputest binary directly, one run is one process:inplace::...shows_its_bytes_at_its_offsetfailedmainf85101bmain+ this PR (75ca59f)(The
indirect::tests::warp_budget...test fails in both: 56 of 120 onmain, 175 of 250 here; this PR does not touch its assertion, #849 and #847 do.)So the serialisation also removes the
inplacetest's failures on this machine, which the crash fix alone would not have predicted: that test was failing in the whole binary and never alone (VirtualFree(MEM_DECOMMIT)returningERROR_INVALID_PARAMETERright after its placed buffer is dropped, see #878), and it fits the same cause, tests using the software adapter at the same time. I checked the lock for a re-entrant use (a test holding it and constructing a harness that takes it again, which would hang) and found none in the files this PR changes.Earlier I also saw 9 crashes in
amdxc64.dll(offset0x17cc7e1) in other runs; none of them showed up in these 250 runs, but I did not isolate which tests cause those, so they may not be covered by a lock around WARP tests.AI-assisted (Claude Code); no game data.
@HailLucifer666 on GitHub · 2026-11-25 15:20 UTC · original
This is the answer to something I spent tonight failing to get, and I want to record that it is yours so nobody re-derives it: I had narrowed the crash exactly as far as your table (needs several modules on WARP at once; 0 crashes with the candidate test run alone, 20 runs; 1 in 16 with
inplace::andxmem::skipped) and then stopped, because there is nocdb/WinDbg on this machine and WER logged nothing. You got the stack.d3d10warp.dll+0x8be6d, read at0x24— that is the whole missing piece.Independent numbers for your "without" column, Windows 10, software adapter, 32 whole-binary runs at four-way process load: 3 crashes. Serial: 0 in 16. So the crash tracks concurrency, not the test binary's content, which matches your filtered table.
One ordering trap worth flagging loudly. Your note says with the lock
warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsfails in 248 of 250 runs — because serialising makes it run the way it does alone, and alone on this machine it takes[64, 65]first and the assertion atindirect.rs:1539only accepts1or2.That means #875 on its own turns the suite red nearly every time. #970 (or #849/#847) fixes that assertion to tolerate either legal winner. Land them as a pair — #970 first, then this — and the suite is green and crash-free. Land this alone and the crash goes away while CI goes red, which will read as "the lock broke the tests".
I hit that same trap myself tonight: the 16 runs that produced my crash numbers also produced one failure of that exact assertion on current
main, with nothing of mine involved.@HailLucifer666 on GitHub · 2026-11-25 22:42 UTC · original
/keereview — the mechanism is sound and the measurement is the most honest in this batch, but it lands a known regression.What holds up. The lock is well placed:
_oneis declared last inWarpHarness/Warp, so it drops after the device, and poisoning is handled withinto_inner()rather thanunwrap(). The 10/250 → 0/250 table, the per-filter breakdown, and the third-party measurements on the RX 6950 XT are the kind of evidence that usually isn't in a PR body.What blocks it. By the PR's own table,
warp_budget_saturates_...goes from failing 142/250 runs to 248/250 with the lock. That is a green→red change for a test that #849/#847 are meant to fix, and it meansmainwould go from "sometimes red" to "red on nearly every run" in the suite. Two ways out, and the body doesn't say which is intended:Merging this first makes the failure mode deterministic without fixing it.
Smaller points.
pub(crate) mod testsininplaceis now the public home ofone_warp_at_a_time()for three other modules. That works, but a#[cfg(test)] mod test_supportwould say what it is; a test module is not an API.Warp/WarpHarnessis ever leaked (mem::forget, a static, a panic insidenew()after the lock is taken), the guard goes with it and every later WARP test blocks for the rest of the process.new()looks clean today — it's worth a comment saying the lock must never outlive its test.Secondthreads, the diagnostics-only host queue tests, the ignored tiled test) are the tests most likely to reproduce #850 next.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.