shader: static Wave32 LDS alias and lane-private hazard analysis #43
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!43
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Vladimir-Human on GitHub · 2026-11-27 13:12 UTC · original
Vladimir-Human:shader/wave32-lds-hazard-analysis→main· +4010 −108 · 5 files · 1 commits · openSummary
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/21d60f009b88to075785eba1@Vladimir-Human on GitHub · 2026-11-27 14:27 UTC · original
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.@jptorres96 on GitHub · 2026-11-27 16:14 UTC · original
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.
@Aniseto on GitHub · 2026-11-27 18:01 UTC · original
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.
@CaitoV4 on GitHub · 2026-11-27 18:05 UTC · original
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!
@Vladimir-Human on GitHub · 2026-11-27 20:30 UTC · original
@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.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.