Iter 25: Support MASK_ELSEWHERE on native console-wave compute shaders (5/5 TraceShadowRays) #10
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T03:10:56Z.
Summary
Supports
MASK_ELSEWHERE("a lane mask holding lanes elsewhere read as data") on native console-wave compute shaders (self.exchange.is_none() && self.halves.is_none() && self.console_lanes && self.mask_data == MaskData::Console, such as Wave32-on-Wave32 on NVIDIA or Wave64-on-Wave64 on AMD).Previously,
Lower::mask_dwordonly checkedwholeand recordedneed(made)whenself.exchange.is_some()(console wave64 split into two 32-lane waves), andemit()did not retrywiden()onMASK_ELSEWHEREfor native-wave compute shaders. Combined with PR #7 (SLOT_VIEW_ADDRESSES), this unlocks the 5th and finalshadowmask:CS_TraceShadowRays_*ray-traced shadow shader end-to-end:shadowmask:CS_TraceShadowRays_FullAdaptive_ae7b9cf0_Wrapped(#dbdbf36298727135): emitted (1dd2b030515bd84f), validated (dxil.dll 10.0.22000.0), and D3D12 compute PSO created on RTX 4060 Ti (WAVE64-WIDE 3 branches taken wave-wide: [B721(s_cbranch_execz), B801(s_cbranch_execz), B802(s_cbranch_scc1)]).Changes
crates/victory-shader/src/emit/lower.rs:lane_regions_for(st, group, loops)andall_lane_blocks_for(st, group, loops)soall_lane_blocks_nativeandbranches_around_nativetreat per-lane loop-latch blocks as conditional on later iterations (loops = true) without altering existing paths (PAIR_MEETINGS.get()).Lower::mask_dwordsonative_consoleshaders computewholeviaall_lane_blocks_nativeand recordneed(made)when returningErr(MASK_ELSEWHERE)inside a per-lane branch.native_wave32_mask_elsewhere_in_all_lanes_block_translates_and_runs,native_wave32_mask_elsewhere_in_divergent_branch_widens_and_runs, andnative_wave32_all_lane_blocks_excludes_per_lane_loop_latch.crates/victory-shader/src/emit/mod.rs:widen()retry toMASK_ELSEWHEREwhen!(native.wave64 && lower::host_max_wave() == 32).widen()region discovery throughlower::branches_around_nativeso self-loop latches defining non-active masks can also be widened.Rig Specs Tested On
33,304,932KiB)10.0.26300/ NVIDIA Driver32.0.16.2124Run Settings & Profile
diag&release(RUSTFLAGS='-C link-self-contained=yes') @101f08a(feat/iter25-native-wave-mask-elsewhere)series-s(unattended launch smoke test viaverify-live.ps1)CS_TraceShadowRays_FullAdaptive(#dbdbf36298727135) tested in a scratch worktree combining PR #7 (aa0e88f) + Iter 25 withVICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_WHY=1; interactive open-world RT shadow gameplay has not been playtested yet.DLSS quality(VICTORY_DLSS=1,VICTORY_DLSS_MODE=quality,Streamlineloaded)offVICTORY_*Overrides:D:\victory-build\minivi\diag\victory.exe run --execute --console series-s ...viaverify-live.ps1(menu/intro telemetry only).victory.exe translate ... --validate --pipelines --listwithVICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_WHY=1.11 draws/frame, 3 active windows) + hardware D3D12 unit test dispatches + offline shader validation/PSO creation.Measurements & Verification
30.0 fps(33.3 ms/frame) in unattended menu smoke test (11 draws/frame,0 dropped)off)585indexed textures /181 MBuploaded,0passed over unmapped)0(verify-live.ps17/7 [PASS],non_system_mingw_dlls=0ondiag,--features diagnostics --release, andrelease)cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy(294 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask(6 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- --test-threads=1 lower::tests(18 passed; 0 failed; 1 ignored— includes all 3 new Wave32MASK_ELSEWHEREtests withdxil.dllvalidation + RTX 4060 Ti dispatches)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- --test-threads=1 wave64_tests(12 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1(448 passed; 0 failed; 36 ignored)victory-shaderrun (left to GitHub Actions CI due to pre-existing local Windows SDK10.0.22000.0\x64\dxil.dllPSV0 issue on 3 untouched tests)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T03:15:15Z.
CI passed cleanly: https://github.com/Androtim/MiniVI/actions/runs/46101607646
Verified checks on
101f08a:checkSUCCESSxtask policy(294 files ok) &xtask test(6 passed)clippydefault &diagnostics(0 warnings)victory-shader:lower::tests(18 passed, including 3 new Wave32 hardware-validated/dispatched tests) &wave64_tests(12 passed)victory-gpu(448 passed; 0 failed)diag,diagnostics --release, andreleasebuilds (non_system_mingw_dlls=0)CS_TraceShadowRays_FullAdaptive(#dbdbf36298727135) emitted, validated withdxil.dll, and built D3D12 PSO on RTX 4060 Ti (5/5TraceShadowRays_*unlocked)verify-live.ps1): 7/7[PASS], 30.0 fps, 0 dropped, 0 DREDImported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T04:03:24Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Logic and safety checks look solid, and CI is passing. The PR cleanly extends
MASK_ELSEWHEREhandling andwiden()retries to native console-wave compute shaders without altering existing wave64-on-wave32 (exchange) or non-compute paths.Verified Changes
crates/victory-shader/src/emit/lower.rs:lane_regions_for,all_lane_blocks_for, andbranches_around_forwith an explicitloops: boolparameter soall_lane_blocks_nativeandbranches_around_nativepassloops = truewhile preservingPAIR_MEETINGS.get()for existing callers.native_consoleinLower::mask_dwordonself.exchange.is_none() && self.halves.is_none() && self.console_lanes && self.mask_data == MaskData::Console, ensuringwaveActiveBallotis only treated aswholewhen host lanes match console lanes 1:1 andall_lane_blocks_nativeconfirms all lanes executemade.need(made.unwrap_or(0))before returningErr(MASK_ELSEWHERE)fornative_console, feedingwiden().native_wave32_mask_elsewhere_in_all_lanes_block_translates_and_runs,native_wave32_mask_elsewhere_in_divergent_branch_widens_and_runs,native_wave32_all_lane_blocks_excludes_per_lane_loop_latch) withHostWaveGuardcleanup.crates/victory-shader/src/emit/mod.rs:widen()retry inemit()tolower::MASK_ELSEWHEREwhen!(native.wave64 && lower::host_max_wave() == 32).widen()'s region lookup tolower::branches_around_nativefor native-wave programs (while keepinglower::branches_aroundfor wave64-on-wave32), which pairs cleanly withlower::needs_every_lane(MASK_ELSEWHERE) == true.Minor Observation (Non-Blocking)
Lower::mask_dwordrecomputesall_lane_blocks_native(self.x.st)per call onnative_consoleshaders rather than caching it onLower. This is unlikely to be hot in practice, but caching it alongsideall_laneswould avoid repeated post-dominator computation if a shader reads many non-active masks.Why
needs-gpu-testThis PR changes compute shader wave-widening and ballot lowering in
victory-shader(targetingCS_TraceShadowRays_FullAdaptiveand other native-wave compute shaders), and interactive RT shadow gameplay has not yet been smoke-tested on real GPU hardware. Recommend a local real-GPU test (including RT shadows once combined with PR #7) before merging.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T21:11:21Z.
Real-GPU Playtest Report (Combined Build 1 Stack — RT ON)
Tested in combined Build 1 (
origin/main+ Build 1 PRs including#3, #4, #7, #10) on NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (quality-720p, DLSS Quality,-RayTracing):1c-build1-rt.log) — 0 crashes, 0 DRED resets, clean exit.7.6 fps(132.2 ms/frame,4,022draws/frame).12,653pages /790 MBacross13arenas,98build dispatches/frame).0"a shader reads view addresses without a view heap set"warnings.1,374DLSS upscalings (0failed); VRAM stayed bounded (6,460 MBin use,554 MBfree across27texture blocks).