Tests: every GPU test module takes the shared lock, which diff_tests did not #1890
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1892"
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 Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T00:14:56Z.
Cause found:
diff_testswas the only GPU test module that made aHostwithout taking the shared lockThe crate already has the lock, for exactly this:
emit::valu_tests::ONE_AT_A_TIME, whose comment says WARP can end the test process with an access violation and "other GPU test modules take this lock too". I audited all nine modules that make aHost:bvh_testsdiff_testsflow_testsmemory_testssemantics_testsstride_testssynthetic_testsvalu_testswaterfall_testsdiff_tests' three host-making tests —translated_shaders_draw_as_pc_ones,translated_mesh_shaders_draw_as_pc_ones,float_semantics_are_the_consoles— were dispatching beside whatever else the test threads were running, which is the shape of the failure you saw:memory_tests' title-memory test reading back thousands of pages set instead of the three it wrote, and passing when run alone.The fix is that those three take the lock too, through one helper, and the lock's own comment now states the rule that nothing wrote down: a GPU test module that makes a
Hostwithout taking it is how the failure comes back.What I can and cannot claim:
dxc/console compiler fordiff_tests, no SM 6.6 device for parts of it), so on my runs the unlocking tests never dispatched and the race never happened.cargo test --workspace --lockedwas green in two consecutive runs before and after.emit/host.rs, and the way to catch it would be to have the test keep the readback buffer it made rather than a fresh one.Verification:
cargo test -p victory-shader --locked --lib(209 passed, 2 ignored);cargo test --workspace --lockedtwice, 23 suites ok, with only the pre-existingvictory-hle::modules::display::tests::sdr_and_display_deferralsfailing in this headless session (it is what #1630 fixes);clippy --workspace --all-targetswith and without--all-featuresclean under-D warnings;rustfmt --checkclean on the two files touched.Pull request: #1883
No game data is involved: test names and counts only.
Written with an AI assistant.
upstream-sync referenced this pull request2026-11-25 02:05:54 +00:00
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:43:39Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
94605b3applied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 144 passed, 0 failed, 2 ignored. All tests pass.cargo clippy -p victory-shader --all-targets -- -D warnings: 4 pre-existing errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
upstream-sync referenced this pull request2026-11-25 02:06:20 +00:00
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:17:17Z.
Review: COMMENTED
Static review only: GPU test harness is Windows-only — nothing runs on macOS; source review of the diff.
Shared lock across every GPU test module (fixing the diff_tests deadlock class) — right direction for the parallel Windows suite.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-25T02:58:34Z.
Review: COMMENTED
Read only, not built: the branch sits on a newer upstream main than our fork's last sync, so a merge pulls in dozens of upstream files, and I couldn't test it in isolation here.
From reading, the change is right.
diff_testswas the one module making aHostwithoutONE_AT_A_TIME, and taking the lock in its three tests matches what the other GPU test modules do. Moving the lock's doc comment to the shared helper is fine.AI-assisted (Claude Code).
upstream-sync referenced this pull request2026-11-25 03:03:25 +00:00
upstream-sync referenced this pull request2026-11-25 07:03:23 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:20:32Z.
Automated triage for the maintainers.
Needs work.
Making the host-creating tests in
diff_teststakevalu_tests::ONE_AT_A_TIMEis right and harmless. The audit is incomplete, though, so the new doc comment ("Every GPU test module takes this lock ...diff_testswas the last module missing it") is not true after this PR. On main, these tests also make aHostwithout the lock:diff_tests::cube_gradients_pick_the_level, which runs on both the hardware device and WARP (Host::new(warp)).diff_tests::translated_compute_matches_pc.crates/victory-shader/src/emit/rect.rs(Host::new(warp)for hardware and WARP).What it needs:
Hosts and readback buffers reading each other's results is not shown.CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:43:20Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
94605b36ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
upstream-sync referenced this pull request2026-11-25 13:03:01 +00:00
Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-26T12:13:16Z.
All four points taken
The audit is now complete, and the comment says the rule instead of claiming it was already met.
diff_tests::cube_gradients_pick_the_levelanddiff_tests::translated_compute_matches_pc(through the sameone_at_a_time()helper as their neighbours), andrect.rs::rectangles_get_their_fourth_corner, which makes aHostfor hardware and WARP per corner order (super::super::valu_tests::ONE_AT_A_TIME).Hosttakes it — and saysdiff_testsandrect.rswere the modules that did not.Hostand their own readback buffers should not read each other's memory; what the lock does is remove the one way they could, and stop the WARP hangs, which are reproducible.What this does not do: prove that a dispatch and a readback from separate hosts can collide — I have not shown that, only that the lock costs a test at a time and makes the suite deterministic. If the failure comes back with every module holding the lock, the cause is elsewhere and this PR is not the fix.
Written with an AI assistant.
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.