shader: static Wave32 LDS alias and lane-private hazard analysis #43
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/43"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by Vladimir-Human on 2026-11-27T13:12:44Z.
Summary
Replaces the coarse read+write check in
lds_meetingswith static LDS alias and lane-private hazard analysis (emit::lds::analyze) for lowering consoleWaveSize(64)compute shaders onto 32-lane host waves when per-lane branches keep barriers out of a region:!allregions when every access resolves to constant non-wrapping byte offsets on a single group-uniform base, everyKind::Writestores provably group-uniform data across all data dwords (making concurrent writes across both host halves idempotent), and there are zero RMW self-overlaps or RAW/WAR/WAW byte overlaps.!allregions where every writing/RMW cluster resolves to exclusive per-thread slots across active thread-group dimensions with proper alignment and non-overlapping half-open cross-cluster footprints (handling partial workgroupsn = 33..63, verified by a 48,212-case exhaustive byte-access oracle with 0 false accepts).!allregions require positive proof (Refinement A or Refinement B) by default; the legacy write-only shortcut stays behind the 32-lane opt-inVICTORY_LDS_WRITE_ONLY_OK=1switch (keyed in bothvictory-shader/build.rsandvictory-gpu/src/shader_cache.rs, and always disabled on non-32-lane hosts).VIctory-NVIDIAintegration: Cycle-safe acyclic memoization ineval_valprevents exponential DAG blowup; preservesVIctory-NVIDIA'sLdsOrder::unorderedskipping underPAIR_MEETINGS; emits specificVICTORY_WAVE_WHY=1refusal diagnostics without re-running analysis.Verification
cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings(default &--all-features): 0 warnings (0warnings in touchedcrates/victory-gpu/src/shader_cache.rs)cargo test -p xtask --locked: 6 passed; 0 failed (repository_passes_policygreen)cargo test -p victory-gpu --locked shader_cache -- --test-threads=1: 2 passed; 0 failedVICTORY_D3D12_DEBUG=1,VICTORY_REQUIRE_HW_GPU=1,--test-threads=1):emit::lds::tests: 21 passed; 0 failed (including 48,212-case exhaustive byte-access oracle,n = 33..63partial-workgroup byte alias test, 40-stepv_add_nc_u32+ 32-stepv_add3_u32shared-DAG O(N) stress tests, Refinement A lane-varying data refusal, 4 unproven write-only default-refusal / opt-in tests, andLdsOrder::unorderedtest)emit::wave64_tests: 16 passed; 0 failed (all 4 HW Wave32 LDS tests executed on hardware D3D12 withno skip, including default Wave64 refusal + opt-in Wave32 execution for unresolved dynamic WAW)emit::diff_tests: 4/4,emit::tests: 21/21Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Vladimir-Human on 2026-11-27T14:27:24Z.
Rebased cleanly onto
main(d12eb1b, PR #30pr-thread-ticket) at075785eand guardedrun_wave32_lds_on_hardwareso 4-lane WARP skips only unsupportedWaveSize(32)PSO creation after validating DXIL (still strict underVICTORY_REQUIRE_HW_GPU=1).Re-verified:
clippy(-D warnings, default &--all-features) 0 warnings,xtaskpolicy 280 files ok / 6/6, HWemit::lds::21/21 &emit::wave64_tests::17/17 (no skip), WARPemit::lds::21/21 &lds_6/6,shader_cache2/2.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jptorres96 on 2026-11-27T16:14:55Z.
Independent run on RTX 4080 SUPER 16 GB (Ada, 32-lane waves), driver 621.01, Ryzen 5 5600X, Windows build 26300, toolchain 1.98.1, DXIL validator from DXC 1.9.2609.5,
VICTORY_REQUIRE_HW_GPU=1. Head075785e.cargo test -p victory-shader --lib execute_wave32_on_hardware -- --nocapture: both tests passed and ran on the card:lds_lane_private_with_rtn_atomic_executes_wave32_on_hardware(not matched by that filter) passed in the full run below; I did not capture its output there.cargo clippy -p victory-shader --all-targets -- -D warnings: cleancargo test -p victory-shader --lib -- --test-threads=1: 314 passed, 0 failed, 4 ignoredNo game dump here, so nothing in-game.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Aniseto on 2026-11-27T18:01:43Z.
Ran the Wave32 LDS analyzer tests on an NVIDIA Blackwell part at
075785e: 21 unit tests plus three hardware-executed Wave32 cases.System
Results
cargo test -p victory-shader --lib emit::lds -- --test-threads=4: 21 passed, 0 failed, 0 ignored (exit 0)cargo test -p victory-shader --lib execute_wave32_on_hardware -- --nocapturewith VICTORY_REQUIRE_HW_GPU=1: 2 passed, 0 failed, 0 ignored (exit 0). Both printed "ran recovered WaveSize(32) on hardware D3D12 device (no skip)".cargo test -p victory-shader --lib lds_lane_private_with_rtn_atomic_executes_wave32_on_hardware -- --nocapturewith VICTORY_REQUIRE_HW_GPU=1: 1 passed, 0 failed, 0 ignored (exit 0). Same hardware line.What this adds
The independent run already in the thread is an Ada RTX 4080 SUPER. This adds a Blackwell part on a newer driver and Windows build, with VICTORY_REQUIRE_HW_GPU set so a silent skip would have failed the run. None of the three Wave32 cases skipped here: they executed on the real D3D12 device, including the returning-atomic lane-private case. No game data was used.
Not tested
Native wave64, AMD and Intel adapters, Wine, release profile, frame generation, retail titles. The full suite at this head was not run here; the unit filter covers emit::lds only.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR head in a detached worktree, ran the commands above and wrote this report; no game data was used.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CaitoV4 on 2026-11-27T18:05:44Z.
I'm testing VIctory-NVIDIA with an RTX 5070 and a Ryzen 7 7800X3D.
I'm still experiencing shader-related graphical issues during gameplay.
Some shaders and visual effects appear to be missing, incorrectly rendered, or visually broken. This affects the overall visual quality and makes certain scenes look different from how they should.
Performance and Frame Generation have improved significantly in the latest build, but shader rendering still needs some work.
Are these shader issues already known? Is there any specific diagnostic information I can provide to help identify and fix them?
I'm happy to share screenshots, logs, and additional test results.
Thanks for your work on this project!
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Vladimir-Human on 2026-11-27T20:30:17Z.
@CaitoV4 Thanks for testing on your RTX 5070 and offering to collect diagnostics!
One quick clarification on scope: PR
#43only covers static Wave32 LDS hazard analysis for compute shaders (allowing certain branched/disjoint-LDS compute shaders to run in 32-lane waves instead of falling back to slow Wave64 emulation). It does not alter general pixel/graphics shader translation.To track down the missing/broken visual effects you are seeing:
mainvs#43: If the artifacts also happen on a plainmainbuild, opening a dedicated GitHub issue intrustno1-coder/VIctory-NVIDIAwill reach everyone working on shader translation. (If something breaks only when#43is applied on top ofmain, please reply here with that difference!)VICTORY_*overrides), and your NVIDIA driver version.%LOCALAPPDATA%\victory:%LOCALAPPDATA%\victory\logs\(victory-nvidia-play-*.logorvictory-nvidia-*.log), and%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log(plus any newest*.crash.logintemp\).-Build diag, F3 panel stats orVICTORY_DUMP_TARGETS=1/VICTORY_SHADER_CENSUSnotes are also helpful locally.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T20:06:11Z.
@Vladimir-Human — reporting a 20-minute A/B regression found on RTX 5080 (Wave32 host, 1440p, DLSS Quality, release build) after
075785emerged intomain(32ecacf):Finding: 8 newly refused compute shaders by default (
refused: 2 -> 9) causing dark indoor lightingWith the default
VICTORY_LDS_WRITE_ONLY_OKoff, 8 compute shaders that previously translated and ran cleanly on 32-lane NVIDIA are now refused (no wave32 lowering for this wave64 program is not supported):0e366d15868e17bd1f1fbd86759b3da221f7ad786362032855679a0547649d0b5964b734c70b91eb7c9a6a83826cdfac89d08e561897d4e5caf96a3229145fa6(previously translated and bound during gameplay)Visual impact (default off): indoor lighting / volumetric bounce degrades sharply when facing bright light sources or windows (auto-exposure crushes surrounding rooms nearly to black).
20-minute A/B verification (same binary
32ecacf, RTX 5080 16 GB, Ryzen 7 5700X, Series X 1440p, DLSS Quality + MFG 4x)caf96a3229145fa632ecacf)main6b82bc7d,a10179ab)32ecacfdefaultLDS_WRITE_ONLY_OKoff32ecacf+ switchVICTORY_LDS_WRITE_ONLY_OK=1(+PLACED_ORDER=0,UPLOAD_POOL_MB=0)6b82bc7donly;a10179abfixed)Suggestion
Because
caf96a3229145fa6and the other 7 compute shaders are active lighting/post compute passes on NVIDIA Wave32 hosts (andVICTORY_LDS_WRITE_ONLY_OK=1restores all 8 with0errors and brings refused shaders down to1), it may be worth either:VICTORY_WAVE_WHY=1) fails Refinement A/B so static analysis can prove them safe without falling back, orVICTORY_LDS_WRITE_ONLY_OK=1enabled in the default NVIDIA launcher settings until those 8 passes are covered by Refinement A/B.(Note: on the Xbox GDK / Wave64->Wave32 contract, hardware-native Wave64 compute shaders that only perform lane-disjoint scatter writes to LDS before a single
GroupMemoryBarrierWithGroupSyncare guaranteed hazard-free across split 32-lane subwaves when no cross-subwave read precedes the barrier — extending Refinement B to recognize non-aliasing stride/tiled write-only stores before the first group barrier would cleanly cover these passes without needing the legacy shortcut.)Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by postblink on 2026-11-28T22:49:47Z.
On a host with 32-lane waves (RTX 5080 on Linux; the host reports wave lanes min=32 max=32), this change stops 9 wave64 compute programs from translating ("no wave32 lowering for this wave64 program"). Three of them are XboxBvhBuilder programs (
e63d22c4def9ba6a,caa78b8ca62bc3d6,28918b7150a7aad5), so "the ray-tracing structure builder stays off" and the title's ray tracing is silently gone.Bisected 9ce3cf9e..77df871e with
translate --warmon just those hashes:075785ebis the first bad commit. 8 of 9 translate before it and 0 of 9 after.VICTORY_LDS_WRITE_ONLY_OK=1brings back the 8 of 9, and with it the builder runs (about 10 fps full Series X, no visible corruption in a 7-minute run).Is the refusal expected for these programs, or is the proof missing a case? The other 6 hashes:
0e366d15868e17bd,1f1fbd86759b3da2,5964b734c70b91eb,55679a0547649d0b,89d08e561897d4e5,6b82bc7d22016cb5. The last one already failed before this commit.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CaitoV4 on 2026-11-29T00:33:07Z.
Hi Vladimir,
Thanks for your response and for looking into this.
Unfortunately, I'm having an even bigger problem now. The game no longer
launches at all. This issue started this morning after the latest updates.
Every time I try to open the game, it crashes almost immediately, sometimes
within a few seconds.
I'm not sure what caused this. I've already tried switching builds and
testing different configurations, but nothing seems to work. Even after
reverting to the version you suggested, the game still refuses to stay open.
I'm still willing to help with testing on my RTX 5070, but right now I
can't run the game long enough to collect the diagnostics you requested.
Do you have any suggestions on how I could troubleshoot this or recover a
working build?
I'd really like to help identify what's causing these issues.
Best regards,
Caio
Em sex., 27 de nov. de 2026 às 17:30, Vladimir @.***>
escreveu:
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CaitoV4 on 2026-11-29T00:34:18Z.
Em sáb., 28 de nov. de 2026 às 21:32, CaitoV4 @.***>
escreveu: