Shader tests: check Wave64 binary64 sums after one half exits a loop #3501
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3501"
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 Venom2054 on 2026-11-27T10:45:25Z.
This is the masked-loop regression requested in #2978, stacked on
f923b5d. Review the single test commit. The other commits shown against main belong to the parent stack.Three synthetic groups each start with 64 lanes. Only the upper half, lower half, or lane 63 continues to the second iteration. The readback checks both words of the binary64 sum for each active lane and both initialized marker words for each lane that exited. The inputs keep all intermediate sums exactly representable and give each lane a distinct contribution to the low word.
40400000_00000c2040400000_000004203ff00000_00001000A native Wave64 hardware readback is requested. On Microsoft app-local WARP 1.0.22, all 192 first-iteration results and 127 inactive-lane markers matched. All 65 continuing lanes returned the first sum,
40500000_00000820. A separate DXC-compiled HLSL control usingWaveActiveSum(double)inside a divergent loop showed the same result on WARP. A uniform two-iteration HLSL control that zeroed inactive contributions passed all 65 second-iteration sums. This leaves the cause on native Wave64 hardware open.On an RTX 5070 Ti, the parent stack requires a native wave of 64 for this program and correctly skips dispatch on the 32-lane adapter. In a separate split-Wave64 implementation based on #439, the identical synthetic instruction words, inputs and expected results passed all 768 output-word checks on that card.
To reproduce, run
cargo test -p victory-shader --lib --features host --locked a_wave64_binary64_sum_observes_early_loop_exits -- --nocapture. The output identifies devices skipped for wave width and devices that executed the check. For the software comparison, run a copy of the test executable next to the x64d3d10warp.dllfrom Microsoft.Direct3D.WARP 1.0.22.The patch passes shader all-target/all-feature Clippy with warnings denied and the repository asset check. The full local shader suite also encountered an access violation in
heap_direct_texture_reads_mark_their_heap_index; the same isolated test crashed at the unmodified parent. The new fixture uses hand-written instructions and synthetic inputs. Implementation and testing were assisted by Codex.Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T11:35:37Z.
Independent WARP/CPU verification (no physical GPU), Windows 11 build 26200, Rust 1.98.1 debug build,
cargo test -p victory-shader --lib --features host --locked,VICTORY_WARP=1andVICTORY_D3D12_WARP=1, dxil.dll 10.0.19041.5609 (Windows SDK redist). Synthetic tests only.Commits: base
63bcca4(main), parentf923b5d, head55353e5b.The new test, on head
55353e5b(masked_sum_tests::a_wave64_binary64_sum_observes_early_loop_exits):native Wave64/FP64 unavailable (lanes 4..4); skipped), so it checks nothing here.40500000_00000820(the first-iteration sum) where40400000_00000c20,40400000_00000420and3ff00000_00001000were expected. This is the same result the PR describes for WARP 1.0.22, so the fixture reproduces it. It is red by design until the Wave64 behaviour is resolved; it will be red in any environment that runs it on that WARP.Parent
f923b5d: the test does not exist (312 tests listed, 313 on head);masked_sumfilters to 0 tests.Suite, base vs head (
--test-threads 1; the same sets also appeared at 4 threads):63bcca455353e5bsynthetic_tests::{gathers_at_a_level_match_the_hardware, permutes_read_the_lane_named_and_zero_from_lanes_left_out, permutes_mask_high_address_bits_and_divergent_branches, a_mask_joined_with_data_at_a_uniform_loop_is_its_number}on the system WARP, and a similar set (plushosts_that_do_not_fuse_are_named,wave64_permutes_stay_within_each_32_lane_half,edge_flagged_triangles_draw_as_unflagged_ones) on 1.0.22.valu_tests::a_whole_wave_binary64_sum_counts_the_active_lanes_onlyandvalu_tests::a_whole_wave_binary64_sum_reaches_the_host. They panic atcrates/victory-shader/src/emit/valu_tests.rs:239withhardware: compute_pipeline failed: The parameter is incorrect.They fail the same way at the parentf923b5d, so they are not from the reviewed commit. The commit message ofab08acbsays they skip WARP's 4-lane waves, but on this system WARP they fail instead. They pass on 1.0.22.Findings: no blockers in the reviewed commit. The new test is a deliberate failing repro on WARP 1.0.22 and a vacuous pass on 4-lane WARP. The
valu_tests.rs:239failure on the system WARP belongs to the parent stack.Not verified: native Wave64 hardware (no GPU here).
AI-assisted (Claude Code / Claude Sonnet 5.5).
Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T13:52:07Z.
AMD run: RX 5700 XT (RDNA1, 32–64 lanes, native Wave64 and FP64), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1, debug. The head was merged onto
main63bcca4and run on the native adapter (VICTORY_WARPunset), no game files. Head55353e5. This is the native Wave64 readback the description asks for.a_wave64_binary64_sum_observes_early_loop_exitspasses on hardware:hardware: verified both iterations in all three Wave64 groups. The upper half, the lower half and lane 63 each get their second-iteration sum, so on native Wave64 the translated program gives the right results. The system WARP in the same run skipped (native Wave64/FP64 unavailable (lanes 4..4)). That points to the continuing lanes returning40500000_00000820being WARP 1.0.22's behaviour, which matches your DXCWaveActiveSum(double)control on WARP, and not the translation's. I didn't run app-local WARP 1.0.22 here.a_whole_wave_binary64_sum_reaches_the_hostanda_whole_wave_binary64_sum_counts_the_active_lanes_onlypass on this card. The system WARP skips them withno pipeline for a wave of 32, asab08acbintends; on @oni-swr's machine they panicked there instead.a_64_bit_value_converts_to_f32_round_to_nearestand bothwave::testsbinary64 tests pass.victory-shadersuite (--features host): 310 passed, 0 failed, 3 ignored.heap_direct_texture_reads_mark_their_heap_indexdidn't crash on this card.cargo clippy -p victory-shader --all-targets --features host -- -D warnings: clean.AI use: Claude Code (Claude Opus 5.5).
Imported from Marvisak/VIctory. Originally posted by oddmaniv on 2026-11-27T14:18:51Z.
Independent verification of the PR author's concurrent WARP pipeline/draw test at
55353e5b08412d7d42aed77946415737238ca2b8.cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocaptureMain baseline pin:
63bcca43c6a00a758510398fa43096ce7e4f7df0.Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.
AI-assisted verification.
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.