Repository navigation
Conversation
86c684a to
4a02aa8
Compare
…did not The lock exists because WARP can end the test process with an access violation, and because two tests dispatching at once can have one read back what the other wrote: that is the shape of Marvisak#1882, where memory_tests::title_memory_is_read_and_written_at_computed_addresses failed now and then in a full workspace run and reported thousands of pages set instead of three, while passing when run alone. diff_tests was the only module that makes a Host without taking it: three tests there (translated_shaders_draw_as_pc_ones, translated_mesh_shaders_draw_as_pc_ones, float_semantics_are_the_consoles) dispatched beside whatever else the test threads were running. They take it now, through one helper, and the lock's own documentation says the rule the audit found written nowhere: a module that makes a Host without it is how the failure comes back. Audited all nine GPU test modules of the crate: each makes its Host under the lock.
4a02aa8 to
94605b3
Compare
|
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
Not tested: Windows MSVC build, the title itself. AI-assisted. |
catminou4
left a comment
There was a problem hiding this comment.
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.
mercuryVM
left a comment
There was a problem hiding this comment.
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_tests was the one module making a Host without ONE_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).
…ck, which diff_tests did not
|
Automated triage for the maintainers. Needs work. Making the host-creating tests in
What it needs:
CI: Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head 94605b3 onto 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). |
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.