shaders(emit): preserve console lanes on mask-data v_cndmask_b32 selects #66
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!66
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/66/head"
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?
@Androtim on GitHub · 2026-11-28 19:25 UTC · original
Androtim:feat/iter80-select-mask-data-lanes→main· +36 −0 · 2 files · 1 commits · merged 2026-11-29 04:14 UTCSummary
Preserves console wave lanes when a compute shader executes
v_cndmask_b32selecting on a scalar mask held as data (!st.masks.contains_key):selects_on_mask_data(st, i)incrates/victory-shader/src/emit/lower.rsand includes it inconsole_lanesdetection insideLower::new. Without this,reads_mask_as_dataskippedv_cndmask_b32, causing shaders without another cross-lane instruction to lower without a required wave size (reading wrong lane bits on mismatched waves in release and asserting incross_lanein debug).emit::wave64_tests::a_select_on_a_mask_held_as_a_number_keeps_the_consoles_lanes(crates/victory-shader/src/emit/wave64_tests.rs).Upstream reference:
trustno1-coder/VIctory-NVIDIA@ed998ea(PR #52).Rig Specs Tested On
Run Settings & Profile
release&diagnostics@784c17aseries-s—quality(0.6666667, 540p internal / 960x540 captured frames)offDLSS quality(Streamline 2.14.16)offVICTORY_*Overrides:verify-world.ps1(WorldSeconds=75,AutoNudgeMenu,VICTORY_CACHE_DIR=D:\victory-data\cache-minivi)first_world_frame=8703, 75s in-world / 15 windows, up to11638draws/frame)Measurements & Verification
11.0 fpsmedian (9.68 fpsmean,0.1 fpsmin,90.9 msmedian frame time,0.9 msmedian GPU;+2.10 fpsvs8.9 fpsbaseline)framegen=false)5766 MBpeak (5748.5 MBmedian) /6884 MBmin budget (0 MBover budget;-98 MBvs5864 MBbaseline)44307uploaded,2056final waiting (-5065vs7121baseline);264median pipeline drops (261.0baseline);mapped()rate34.23 ms/s(longest29.8 ms);11/11gates PASS on first run, visually verified16/24lit frames (luma=103.57,edge_energy=7.13,0.0%near-black/magenta; inspectedframe-8735.png&frame-9567.png).0(no_host_texture_errors=0,untranslated_shaders=2)cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy(299 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask --locked(6 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warningscargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warningscargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib wave64_tests --locked -- --test-threads=1(14 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory --bin victory --locked+objdump -p(Windows system DLLs only)@Androtim on GitHub · 2026-11-28 20:03 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
selects_on_mask_data(st, i)incrates/victory-shader/src/emit/lower.rsand includes it inconsole_lanesdetection insideLower::new, plus a regression unit testa_select_on_a_mask_held_as_a_number_keeps_the_consoles_lanesincrates/victory-shader/src/emit/wave64_tests.rs.reads_mask_as_dataintentionally excludesv_cndmask_b32, so a compute shader whose only lane-dependent operation isv_cndmask_b32reading a scalar mask not tracked inst.masks(e.g., a constant bitmask or loaded value) was lowered withoutconsole_lanes/s.wave_size. Checkingv.src.get(2)forOperand::Scalar { code, .. }withi.read(Reg::S(code)).is_some_and(|m| !st.masks.contains_key(&m))cleanly closes that gap without false-matching non-SGPR operands. Onwave64shaders lowered towave == 32on 32-lane hosts,halvesis already allocated wheneverwave == 32 && x.native.wave64without needing cross-half LDSexchange, so keepingselects_on_mask_dataout ofcrossesis consistent with the existing lowering structure.reads_mask_as_dataalso skips_co_ci_instructions (v_add_co_ci_u32/v_sub_co_ci_u32); if carry-in masks held as raw scalar data ever appear in title shaders, they would need the same treatment in a follow-up.Generated with Antigravity CLI (
agy).