shader: follow constant/uniform prefix terms, u32 products, and readfirstlane in wave sections #512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/512"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T23:17:14Z.
Summary
Sym::K), uniform (Sym::Uni), and idempotent reduction (Sym::Red) active-lane terms inv_cndmask_b32inside whole-wave sections (for examplev_cndmask_b32 vdst, 0, s_stride, s_maskfor constant-stride prefix scans), as well as constant scalar lane-select masks (s_mov_b32/s_mov_b64of row or half bitmasks) without requiringEXECsaves/restores.wave - 1of aShape::Prefixinclusive scan) inLower::section_lanesso a constant-lanev_readlane_b32after the section evaluates the total reduction cleanly even when lanewave - 1was inactive before the section.WaveActiveProductreductions (v_mul_lo_u32ands_mul_i32, identity1) across single and split wave64 host waves (halves_reduce), while keeping prefix products refused.v_readfirstlane_b32under a known constantEXECmask (exec.trailing_zeros()) both inside a whole-wave section and immediately after one (Lower::section_rfl).Verification
victory_shader::emit::wave::tests:whole_wave_const_uniform_cndmask_const_masks_mulu_and_readfirstlane_lower(covering both wave64 single-wave andwave32_hostsplit-wave translation, plus negative refusal checks for prefix products and non-identity inactive inputs)victory_gpu::native::tests::split_wave_tests:whole_wave_const_uniform_prefixes_integer_products_and_readfirstlane_run_across_halvescargo test -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtaskcargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warningscargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyCloses #508
Refs #4, #258
cc @Olima34
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T23:21:05Z.
Thanks @Sheffy007, this is right on our current focus. We're now working on translator coverage, to get as many refused world shaders as possible to translate, and whole-wave sections are one of the larger families. We'll run #512 over our boot corpora (4,921 translated and 4,129 refused containers), by output fingerprint as for #464, and post gained / lost / changed per stage here. We'll also note the overlap with marcus-4's #438 and with your own #448 and #464 where they touch the same sections.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:31:54Z.
Thanks for this PR! An offline check of
b864cf72, with no game run:Corpus sweep (
examples/sweep+tools/corpus/compare.sh), measured on maina6a58361, which translates shaders the same way as current main226645f9. Main → main + #512:No shader in these three sets has a whole-wave section of the kind #512 handles as its first refusal, so this is a no-regression check rather than a coverage measurement.
Checks: on an earlier main (
b998bb65) + #512, the tests (victory-gpu on arm64, victory-hle, victory, xtask, victory-shader), Windows clippy (-D warnings) andcargo xtask policyall pass. CI is green onb864cf72.Merging on
a6a58361:split_wave_tests.rs: both PRs add GPU tests at the same spot.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.