shader: SafeSingleWave widening for 64-lane compute shaders and IC SH integration #1006
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1006
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1006"
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?
@whoalin1 on GitHub · 2026-11-28 10:59 UTC · original
whoalin1:pr/safe-single-wave→main· +199 −8 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCSummary
Adds
WidenMode::SafeSingleWaveincrates/victory-shader/src/emit/mod.rsfor single-wave64 compute shaders (threads == 64), and addsCS_IrradianceCache_IntegrateIrradianceSH_cb05754f(eb1c062c...) toscene_kernel.Problem
Without
VICTORY_WAVE_WIDE=1, 64-lane compute shaders needing wave-wide branch widening fell back tolocal waves(approximate, no cross-half synchronization), breaking cross-half prefix sums, LDS reductions, and lane-63 broadcasts in GI and bin-offset passes (e.g.,CS_GenerateShaderBinOffsets_84edd24cproduced 269 overlapping shader-bin intervals;CS_IrradianceCache_*broke outdoor auto-white-balance / irradiance integration). FullWidenMode::Allcannot be turned on globally because widening inside divergent loops can deadlock at group barriers.Change (
crates/victory-shader/src/emit/mod.rs)active_loop_only: boolonwidenwithWidenMode::{All, SafeSingleWave, DriverLoop}.safe_single_wave_widen, which only permits widening forward branches in RPO (never loop latches) and rejects any natural loop enclosing a meeting/widened block if it is irreducible, hasEnd/Indirectexits, or has non-Uniformloop exits/back-edges.CS_IrradianceCache_IntegrateIrradianceSH_cb05754f(eb1c062c..., 5-stage LDS tree reduction + bounded uniform-exit SH loop) inscene_kernel.Verification
Verified on Windows (
x86_64-pc-windows-msvc, RTX 4070 SUPER):git diff --check origin/main..HEAD— cleancargo run --locked -p xtask -- policy—asset policy: 294 files okcargo clippy --workspace --all-targets --locked&--all-features— 0 new warnings incrates/victory-shader/src/emit/mod.rs(1 pre-existinglet_and_returnon untouched line 2961)cargo test --release -p victory-shader --locked --lib -- --test-threads=1— 293 passed, 0 failed, 5 ignored (including all 13wave64_tests)@Bj0rnis on GitHub · 2026-11-28 12:47 UTC · original
Independent RTX 5070 Ti 16 GB (Blackwell, Wave32 host) verification on
101cdf28(Windows 11, Ryzen 7 9800X3D, 32 GB RAM, driver621.24, Rust 1.98.1,--releasebuild from source).Automated checks & Wave32 shader corpus:
main(63b902f);cargo xtask policy: 294 files ok.cargo test --release --locked -p victory-shader --lib -- --test-threads=1: 293 passed, 0 failed, 5 ignored (233.35 s, including allwave64_testsandbvh::tests).VICTORY_HOST_WAVE=32):25,763translated /222failed vs25,760/225onmain(63b902f) — unsupported wave64→wave32 count dropped22 → 19(+3 shaders lowered cleanly, 0 new translation errors).Live gameplay check (~4 min, opening diner → prison cell → prison break room; Series X, 2560×1440, DLSS Quality, FG off):
28.9 fpsmedian in mid-scenes (3.5k–6.5kdraws, avg4,941— vs27.6 fpsonmain),27.3 fpsin break room (avg9,849draws; RAM27.0 GB, VRAM12.8/14.3 GB),27.4 fpsoverall world median (35samples).Not tested:
VICTORY_BVH_BUILDER=1(RT) orVICTORY_WAVE_WIDE=1comparison. No game data, shader hashes, logs, or captures attached.AI-assisted test run and summary.
101cdf2842toc2caea8348