RX 6950 XT (RDNA2), Windows 11: 5 xmem tests fail every run, clippy fails in victory-shader #2
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/Belobug--VIctory-Belobug-AMD#2
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 11:04 UTC · original
I ran the checks on
4cbe9d7on a different AMD card from the one in the README: RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, a GPU present. The title was not run.1. Five
xmemtests fail on every run (cargo test -p victory-hle --lib xmem: 10 runs of 10, and also with--test-threads=1):modules::xmem::tests::a_run_keeps_the_placeholders_it_spans(xmem.rs:1578: left(0x1000b0000, 131072), right(0x1000d0000, 131072))modules::xmem::tests::a_run_maps_across_two_placeholders(xmem.rs:1549: left 4096, right 8192)modules::xmem::tests::a_run_maps_again_after_a_partial_unmap(xmem.rs:1524: left 4096, right 8192)modules::xmem::tests::mapping_no_pages_changes_nothing(xmem.rs:1382:assert!(map_alias(at, a, 0)))modules::xmem::tests::physical_pages_map_alias_and_unmap(xmem.rs:1330: left 4096, right 8192)Two of them,
physical_pages_map_alias_and_unmapandmapping_no_pages_changes_nothing, also exist on upstreammain(940d32f) and onfxceless/victory-forkmain(f85101b), and pass there on this machine; the other three (a_run_*) exist only in this fork. So in this fork'sxmem.rssomething changes how mapping behaves for the tests that the other trees pass. A region size of 4096 where 8192 is expected looks like pages not merged into one region, or a mapping made in two parts; I have not looked into the cause.2.
cargo clippy --workspace --all-targets --locked -D warningsfails invictory-shader, with and without--all-features: 10 errors (a hex literal grouping innative.rs:389, the never-usedModule::int_value, three complex types, twoget(&site).is_none(), two returns of aletbinding, a uselessu32::from). I am sending a PR for them. Cargo stops at the first crate that fails, so other crates may have more.3. One
victory-gputest failed once in 7 runs:query::tests::occlusion_queries_around_draws_not_run_stay_visible. Not reproduced since; I note it only as seen.The numbers are for one machine. No game data.
AI-assisted (Claude Code); no game data.
@MamaLeVrai on GitHub · 2026-11-25 11:09 UTC · original
Another result on the same machine (RX 6950 XT,
4cbe9d7, unmodified):cargo test -p victory-shader --libhas two failures every time (3 runs, each alone and in the whole library):emit::valu_tests::scalar_counted_in_a_divergent_loop_read_after_it(valu_tests.rs:1504): expects all 64 lanes to count 64 iterations; got 32 for lanes 0 to 31 and 64 for lanes 32 to 63.emit::valu_tests::scalar_counted_in_nested_divergent_loops(valu_tests.rs:1591): the inner count is 8 for lanes 0 to 31 and 16 for the next lanes (the beginning of the list; I did not read the whole line).Both tests exist only in this fork (not in upstream
mainor infxceless/victory-fork). The split at lane 32 suggests the second half of a 64-lane program counts what both halves did, on a host whose waves are 32 lanes wide here. I have not looked at the code, and I do not know the wave width your RX 9070 XT runs these programs at, so this may well pass there.AI-assisted (Claude Code); no game data.
@MamaLeVrai on GitHub · 2026-11-25 11:11 UTC · original
I found the cause of the five
xmemfailures, and checked it.XMemMapPhysicalPagesnow triesmap_wholefirst (added infa07481, "uncap frame pacing by default"): when the reservation is as long as the section of the pages mapped into it (len == first.section.1) and no view overlaps it, one view shows the whole reservation. Those tests reserve exactly 3 pages and map pages from a 3-page allocation, so they take that path. Then unmapping the middle page (XMemMapPhysicalPages(at(a, 1), 1, null)) leaves it committed:xmem.rs:1330expectsMEM_RESERVE(8192) and getsMEM_COMMIT(4096), which is the "left 4096, right 8192" of the failures.Checked: with a local one-line switch that makes
map_wholereturn false, all 14xmemtests pass (they fail 5 of 14 with it). The behaviour does not depend on the card or on the Windows build.So it is a conflict between the new whole-reservation view and the per-page behaviour the old tests check, not a bug I can call in the new design. Two ways out, yours to pick:
len != section size), and add a test for the whole path;map_wholeto reservations above a size (your debug line already looks atpages.len() > 64), if tiny reservations should stay per page.I did not change
xmem.rs: the first needs the tests rewritten around your intent, and the second changes what the title gets, which I cannot check without the game.AI-assisted (Claude Code); no game data.
@MamaLeVrai on GitHub · 2026-11-25 11:18 UTC · original
The two
valu_testsfailures (scalar_counted_in_a_divergent_loop_read_after_it,scalar_counted_in_nested_divergent_loops) on the RX 6950 XT: I found why, and checked it with a local change.Why. In
emit/lower.rs(around line 1224) the translated compute program only gets aWaveSizeattribute whensplit(a console wave64 on a host that cannot run 64 lanes) or whenconsole_lanes || one_wave && s.lds_dwords > 0. These two test programs are wave64 programs whose only dependence on the wave width is a scalar counter in a divergent loop (the console runs the loop until the 64th lane leaves, so every lane reads 64). They get noWaveSize, and this card's driver then picks 32-lane waves for compute: lanes 0 to 31 count 32, lanes 32 to 63 count 64, which is exactly the output. On your RX 9070 XT the default may be 64-lane waves, which would explain why they pass for you; that part is a guess.Checked. With a local change that also sets
s.wave_size = Some(wave)whenx.native.wave64 && x.target.runs(64), on this machine: both tests pass, and the wholecargo test -p victory-shader --libgoes from 264 passed, 2 failed to 266 passed, 0 failed.What I did not check. That change asks for
WaveSize(64)for every wave64 program on a host that can run it, which is broader than these two tests need. I do not know what it does to compile times or to the AMD compiler crashes you skip (it may change which pipelines crash), or to pipelines in the title; I did not run the title. A narrower rule (set the attribute when the program has a counted loop like these, or a read of a scalar written under divergence) is the safer shape if you want one. I did not open a PR for it for that reason.AI-assisted (Claude Code); no game data.
@kanav-khanna on GitHub · 2026-11-25 12:51 UTC · original · edited 2026-11-25 12:59 UTC
Reproduced on a second AMD machine: Ryzen 7 5800X, RX 6750 XT, 24 GB RAM, Windows 11,
The same five xmem tests fail every run, with default threads and with --test-threads=1. My line numbers are 1334, 1553 and 1582 (so I'm on a slightly different commit than the report). The 1582 failure shows the same (0x…, 131072) pair.
Reading xmem.rs, the 4096/8192 values look like memory state flags rather than sizes: 4096 = MEM_COMMIT (0x1000), 8192 = MEM_RESERVE (0x2000). At 1334 and 1553 the test unmaps and expects query(..).host.State == MEM_RESERVE, but Windows reports MEM_COMMIT. At 1582, the left AllocationBase is the start of the whole reservation instead of at(2), so the split placeholders were coalesced after the unmap. That might point at how unmapped placeholders behave on this Windows build.
@alexdeliu on GitHub · 2026-11-25 14:44 UTC · original
The narrower rule for the two
valu_testswave-size failures is in #110, building on @MamaLeVrai's diagnosis above.The rule.
leave_loops(emit/lower.rs) takes a divergent loop's scalars with a wave maximum over the host's wave. That matches the console only in a 64-lane wave. #110 asks forWaveSize(64)at that point only when all of these hold:Across the unit tests, that is 2 programs out of the 85 wave64 compute programs lowered for a 64-lane host (the two failing tests). The broad rule would set it for 10.
Checked on one machine with both generations,
cargo test -p victory-shader --lib -- --test-threads=1:71652a2The extra test checks the requested wave range without a GPU.
@MamaLeVrai, @kanav-khanna: if you have a few minutes, a run of #110's branch on your RX 6950 XT / RX 6750 XT would show whether it holds on discrete RDNA2 too. Our RDNA2 is an iGPU.
AI-assisted (Claude Code); no game data.
@alexdeliu on GitHub · 2026-11-25 15:05 UTC · original
A related note: two of the AMD compiler bugs this fork meets are now reported to AMD, with DXIL repros made from this fork's own output: AMD Developer Community.
v_add_f64 v[0:1], v[1:2], v[2:3]gives1.5 + x= 3.0). In the shape this fork emits it is wrong on the RX 9070, and on RDNA2 too whenmakeDoubletakes the dwords directly.Both were re-checked today. Vectors: rdna2-conformance.
@MamaLeVrai on GitHub · 2026-11-26 00:26 UTC · original
Status of the failures in this issue, on the same RX 6950 XT (release lib tests,
main4f62c2a):xmemtests: #93 fixes them here (103 passed, 0 failed, in 3 runs out of 3). #99 is a related change I have not run.valu_testswave-size tests: #110, #204 and #92 each fix them here (#110: 278 passed, 0 failed; #204: 277 passed, 0 failed). #204 conflicts with #144 inemit/mod.rs. #110 merges cleanly with #144.list::tests::lists_are_cut_at_waits_that_follow_work, from undefined behaviour in the test itself. #210 fixes it.xtaskasset-policy test: it fails becauseemit/lower.rsis now over the 512 KiB limit. #72 and #84 split that file.With #93, #110 and #210 in,
victory-gpu,victory-shaderandvictory-hlewould pass here, apart from occasional flakes that already have PRs (#102 with #112/#115, and #116 with #132).AI-assisted (Claude Code); no game data.
@blpeters67 on GitHub · 2026-11-27 00:36 UTC · original
Same five xmem failures as #8. Status there: #8
In short: PR #14 fixes them on main. On a-publier (default branch), map_whole was removed, and CI #385 at
4eb6cfdpasses on Windows, including the victory-shader clippy run with -D warnings.github-bot referenced this issue2026-11-27 17:08:09 +00:00