Test title_memory_is_read_and_written_at_computed_addresses fails intermittently in a full workspace run #1882
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1882
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@MamaLeVrai on GitHub · 2026-11-25 00:03 UTC · original
emit::memory_tests::title_memory_is_read_and_written_at_computed_addresses(added in27c3dc9d, "title memory at raw addresses through a page table") fails now and then in a fullcargo test --workspace --locked, and passes when run alone.What I saw (Windows 11, RX 6950 XT, Rust 1.98.1,
mainmerged into trees of my own bundles, so the code under test ismain's): 3 failures in about 10 full runs, on three different trees;mainitself passed its 2 runs, and 3 later runs of one of the trees were clean. Run alone withcargo test -p victory-shader --lib memory_tests, it passed 3 of 3.The failure (
crates/victory-shader/src/emit/memory_tests.rs:303):The
warprun reports a long list of pages where the test expects three. The test names the software adapter, so I suspect it shares something with the other GPU tests of the crate that run at the same time (the waterfall and VALU tests are serialised with each other for that reason); I have not found which. Nothing here depends on a game file.AI-assisted (Claude Code); no game data.
github-bot referenced this issue2026-11-26 04:47:48 +00:00
@fiestorra on GitHub · 2026-11-25 00:15 UTC · original
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: #1892
No game data is involved: test names and counts only.
Written with an AI assistant.
@dragoso on GitHub · 2026-11-25 00:30 UTC · original
Does not reproduce on
main70564aeon an RTX 5060 Ti: 0 failures in 6 full runs and 8 targeted runs. Two experiments also rule out WARP handing a new buffer stale memory.Setup: Windows 11 Pro (build 26300), NVIDIA GeForce RTX 5060 Ti (DXGI adapter 0), driver 32.0.16.1742, Rust 1.98.1 MSVC. I used the
victory-shaderlib test binary with default parallel test threads.memory_tests::title_memory_is_read_and_written_at_computed_addressespassed every time, and nowarp: pagesfailure appeared. Each run had the same 3 failures, the ones from #1835 (NVIDIA's 1,000,000 view cap). The runs took between 61 s and 446 s, so the scheduling varied a lot between them.memory_tests stride_tests bvh_tests flow_teststogether: 0 failures of this test.0xA5A5A5A5in one variant, and a default-heapView::Memoryof the same size in the other. The page bitmap (Root::Uav(256)) always came back with exactly the 3 expected bits. So on this machine, WARP's new committed buffers come back zeroed even right after large frees.One lead.
D3D12CreateDevicereturns one WARP device per process, so every test that uses WARP shares it. All the GPU tests serialise onvalu_tests::ONE_AT_A_TIME, throughrun,run_casesandcheck, except:rect.rs::rectangles_get_their_fourth_corner, which draws on WARP with no lock;diff_tests(hardware unlessVICTORY_WARP=1) andmod.rs::stub_pipeline_is_created(hardware only), which only matter with that variable set.In a full run, that draw can overlap this test on the shared WARP device. I could not make that produce the failure here, so it is only a lead. Taking the lock in that test would be cheap if the failure comes back.
Since
mainpassed both of your runs and the failures came from trees with your bundles merged in, one of the bundled PRs might be what writes into this test's memory. Root UAV writes are not bounds-checked, and WARP has no protection between resources. A bisect over the bundle should be quicker than catching it onmain.AI-assisted (Claude Code); run on our machine, no game data.
@jules47800 on GitHub · 2026-11-25 01:25 UTC · original
Doesn't reproduce on
main42363abon RDNA2. Three suspected causes are ruled out here, and the unlocked GPU tests your bundles add are listed below as bisect candidates.Setup: AMD RX 6600 XT (RDNA2, the closest card to your RX 6950 XT so far), driver 32.0.21045.29003, Windows 11, Rust 1.98.1 MSVC,
victory-shaderlib test binary.title_memory_is_read_and_written_at_computed_addressesbesiderect::rectangles_get_their_fourth_corner(on main it draws on WARP without the lock), 2 threadsvalidate_and_create_cs_psoand #189'srecommended_wave64_mode_matches_device_capabilitiesdo)The runs overlapped: the scratch test alone takes 0.4 s and the memory test 0.19 s. On this machine, concurrent WARP use (draws, pipeline creation or dispatches) does not corrupt the page bitmap.
About #1892: the three
diff_testsit locks needVICTORY_CONSOLE_DXC(the GDK console compiler) and return early without it. That includes this machine, and probably yours. They can't be what raced here unless that variable was set on your side.GPU tests that PRs in your bundles (#1632, #1638) add without
ONE_AT_A_TIME, from their diffs:shader.rs::validate_and_create_cs_pso: hardware and WARP pipelines (#1145; also in #1644)host.rs::recommended_wave64_mode_matches_device_capabilities: hardware and WARP pipelines (#189, #586)valu_tests.rs::dispatch_oob_caseandoob_raw_store_does_not_corrupt_element_zero: hardware dispatches with deliberate out-of-bounds raw stores (#542)mod.rs::compute_shader_implicit_sample_uses_valver_1_8_and_validates: a hardware pipeline (#1597)None of these is shown to be the cause. They are the bundle's GPU users that run outside the lock, so they are where a bisect should start. A small hardening commit that makes main's two remaining unlocked tests (
rectandstub_pipeline_is_created) take the lock is on a local branch, if wanted.AI-assisted (Claude Code); run on our machine, synthetic programs only, no game data.
@Marvisak on GitHub · 2026-11-25 12:51 UTC · original
Automated triage for the maintainers.
Reading
main(940d32f) alone can't settle this. The GPU test modules incrates/victory-shader/src/emit/serialise onvalu_tests::ONE_AT_A_TIME.diff_testsis the one that doesn't, and open PR #1892 adds the lock there. But as noted above, its three tests return early without the console compiler (VICTORY_CONSOLE_DXC), so they can only race if that variable is set.Two independent attempts on
maindid not reproduce the failure: an RTX 5060 Ti with 6 full and 8 targeted runs, and an RX 6600 XT with 20 full runs and 360 targeted overlaps. The three failures came from trees with your own bundles merged in;mainpassed both of its runs.What would settle it:
VICTORY_CONSOLE_DXCwas set in the failing runs;main, if you see one.Generated by Claude Code