Wave64 programs exact on 32-lane cards (37 → 0 refused in shaders.rpf), upload guard, placed views over host-written textures #1504
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!1504
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1504"
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?
@aventureroestelar-source on GitHub · 2026-11-28 20:58 UTC · original
aventureroestelar-source:wave64-folded-v2→main· +4551 −86 · 26 files · 4 commits · merged 2026-11-29 08:16 UTCWave64 programs exact on 32-lane cards (37 → 0 refused in shaders.rpf), upload guard, placed views over host-written textures
This is #1296, rebased on the current
mainand split into four independent commits, following the review there (thanks @jptorres96).VICTORY_REFRESH_EARLYis gone, and so are the clippy fixes, whichmainhas meanwhile taken. Each commit builds on its own, so any of them can be taken without the others.What it fixes
Measured on an RTX 5070 Ti (32-lane), Series S profile, no ray tracing. Most of it was measured in the opening cutscene and the first gameplay, with fast burst captures of the game window, before and after:
maintranslate --listwithVICTORY_HOST_WAVE=32, all ofshaders.rpfXboxBvhBuilder.dll)XboxBvhBuilder.dll, ray tracing only)VICTORY_WAVE_FOLDED=0)The 34 programs
mainrefuses and this PR runs exactly:CS_GenerateShadowMasks_SampleHairScreenSpace(2889c213…),CS_GenerateShadowMasksHairOnly_SampleHairScreenSpace(888af37a…),CS_TraceShadowRays_Fullres(4e816e1e…).CS_Tree_BatchCull,_ImposterOnly,_ValidateInst,_ValidateInstInv,CS_Tree_BatchCullReflectandCS_Tree_BatchNoCull(55679a05…, 89d08e56…, 7c9a6a83…, 21f7ad78…, 6b638f32…, da96a811…). These were translated before #43 merged and have been refused since; #43 itself is not touched here.CS_DeferredGather_Shared/_Mixed, the fourCS_ScreenProbes_TraceRays_BVH_*_ShaderBinning(_WithFar)andCS_VarianceFilterAlpha.CS_Classification_Water,CS_TransmissionVolumetrics.GpuParticleEmitprograms, among them 407eca66… from #1138's list.vfx_proj_decal_trailprograms, among themCS_DefragHeap_ComputeRelocationsand f38f8343…;vfx_triangleClipCS_CollectTrianglesandCS_CollectTriangles_Meshlets(6b82bc7d… from #1138's list);CS_ProjDecalReduceClassification_Scalarized.The three still refused are in
XboxBvhBuilder.dll(28918b71…, caa78b8c…, e63d22c4…) and run only with the ray-tracing structure builder.Commits
1. Shaders: wave64 programs folded exactly onto 32-lane hosts (
VICTORY_WAVE_FOLDED, on)Each host lane runs two console lanes: VGPRs in pairs, SGPRs shared, lane masks as two 32-bit ballot words and the scalar control flow native. Ballots,
readlane,mbcnt, LDS within a group and lane masks then behave as on the console. Programs that cannot be folded keep the forms they had before (#43's analysis included).VICTORY_WAVE_FOLDED_SKIP/_ONLY(name or hash prefixes) pick programs, for bisecting. VGPR numbers areu16, because folded pairs pass 255: #43'slds.rsand the ray intersection add to them inu16.Faults found and fixed, each with a GPU test using the real instruction words:
v_cmp_eq_i32 s[0:1], s0, v0: the high half now goes first, and a program whose halves overwrite each other's input is not folded.s_or_saveexec_b64 -1after lanes left throughv_cmpx/s_cbranch_execz: branches on EXEC are now taken wave-wide in such a program.op_selonv_permlanex16_b32. It was refused as an input modifier, which kept the six tree-culling programs out. Bit 3 (the destination) does nothing in 32 bits; onlyabsandnegare refused now.v_cmpxin SDWA form. On GFX10 it writes only EXEC; it is still refused with ansddestination.CS_HairTileClassifyhad the first two faults: half of each 8x8 hair tile was classified wrong.2. Textures: a host write is never overwritten by a later upload from title memory; placed views read the host's copy (
VICTORY_UPLOAD_GUARD,VICTORY_PLACED_COPIED, on)main's own check at submission (VICTORY_PRELUDE_RECHECK) covers the same case, so it is kept as is.want_levelnever makes a host-written texture again from title memory.3. Uploads: the pool stays below the page directory's last, never-filled entry
The pool is reserved top-down in [4 GiB, 2^37), so its first piece ended on the last 64 KiB page of the memory-by-address directory, which is never filled. Allocations now stop one page below it.
VICTORY_UPLOAD_SPACE=0runs without the pool, as a test.4. Scene changes: title memory locked by range, per-recording buffers reused (
VICTORY_RANGE_LOCK,VICTORY_BUFFER_POOL, off by default)VICTORY_RANGE_LOCK: a read of title memory waits only for a remap whose pages meet its range, instead of for every remap.VICTORY_BUFFER_POOL: per-recording buffers are taken again once only our reference is left. Withmain's upload pool on, list uploads use that pool as before, and this one covers the rest.Tests
cargo test --workspace --locked: 1,328 passed, 1 failed.maingives 1,304 passed and the same failure:xtaskrepository_passes_policy, because ofbindings.ini, which #1290 adds to the allowlist.translate --validate --list,VICTORY_HOST_WAVE=32(defaults, andVICTORY_GROUP_SYNC=2VICTORY_LDS_WRITE_ONLY_OK=0): 2,726 of 2,726 compute programs validated, none above 32 KiB of shared memory. The 71 mesh programs over 32,768 bytes of vertex plus primitive output fail the same way withVICTORY_WAVE_FOLDED=0.maincurrently reports 15 with-D warnings(two invictory-shader, which hide 13 invictory-gpu), and they are not touched here.9ce3cf9. The results in the table above come from these runs.main: the opening, where faces, shadows and Lucía are right, at 29-30 fps.+0x23cf683) shows up on the first runs of each new exe:mainwithout this PR: 2 of its first 4 runs.VICTORY_PIPELINE_COMPUTE_WAIT=0, 2 with the PR's own switches as is).victory warm --used/ preload before the first run should avoid it. This is noted rather than changed here.Known, not fixed here
🤖 Generated with Claude Code
@novaaaax on GitHub · 2026-11-28 21:23 UTC · original
We tested the shader commit
da9e412separately on the ten programs from #1435, forcing a 32-lane host with the default barrier and LDS settings (VICTORY_GROUP_SYNC=2,VICTORY_LDS_WRITE_ONLY_OK=0). With folding enabled, 9 of 10 passed the Windows SDK 10.0.26100 DXIL validator. With folding disabled, onlyCS_CollisionRaytracedpassed.One reproducible exception is
vfx_triangleClip:CS_CollectTriangles_Meshlets(6b82bc7d…). It folds to 512 host threads, but the validator reportsTotal Thread Group Shared Memory storage is 32772, exceeded 32768.The guest already uses 8,192 dwords. The extra dword is the per-group wave ticket.For
indirect_light_probes:CS_VarianceFilterAlpha(5964b734…), we also ran the emitted folded DXIL and the 64-lane reference translation through a CPU interpreter on five synthetic dispatches, including partial and boundary groups. Both UAVs matched on all 524 RGBA texels and their write coverage. All 3,200 shared-memory word comparisons matched. Flipping one metadata bit changed 64 of 128 interior outputs in the negative control.That output check covers one shader with synthetic inputs and point-clamp sampling. The reference was the 64-lane translation. Console-image and GPU-performance comparisons are still open.
cb15b7b3fdto53af86053a@aventureroestelar-source on GitHub · 2026-11-28 21:41 UTC · original
Thanks for testing it this carefully, and for the CPU interpreter check on
CS_VarianceFilterAlpha.CS_CollectTriangles_Meshletsis fixed in8f0a0c2(the branch is now at53af860, rebased on the currentmain):run()refuses any translation that would declare more than 32 KiB of shared memory, so a program like this one falls back instead of reaching the validator.a_folded_program_using_all_32_kib_of_lds_fits_without_the_wave_counter.translate --validate --listwithVICTORY_HOST_WAVE=32, onshaders.rpfandXboxBvhBuilder.dll, with your settings (VICTORY_GROUP_SYNC=2,VICTORY_LDS_WRITE_ONLY_OK=0) and with the defaults:6b82bc7d…is emitted and validated.XboxBvhBuilder.dll(28918b71…,caa78b8c…,e63d22c4…).VICTORY_WAVE_FOLDED=0, so this predates the PR.I agree that console-image and GPU-performance comparisons are still open. What I have so far is from the game itself on an RTX 5070 Ti: burst captures of the opening cutscene and the first gameplay, before and after.
@nick0451 on GitHub · 2026-11-28 22:35 UTC · original
Tested in play: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main
923e38c, run in turn with main and four other PR builds. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony, standing still. A warm-up start per build, then two rounds, each run 40 s to settle and 60 s measured, then a screenshot. Main: 25.4 and 24.8 fps, 10 compute programs refused (no wave32 lowering). I compare round 2 only, because round 1 was slow for every new build.Translation: 10 refused on main → 0 with this PR (
0e366d15…,18d957e6…,1f1fbd86…,21f7ad78…,407eca66…,55679a05…,5964b734…,6b82bc7d…,7c9a6a83…,89d08e56…all translate), with noERRORline. Picture: the vegetation behind the railing, missing on923e38c, is drawn again (as with #1450, which fixes 5 of these 10).Speed: 19.6 fps in round 2 against 24.8-25.4 for main. Frame 51.1 ms against about 40, preparing 35.5 ms against 26.1, card 86% busy against 96%. Some of that is the newly translated programs doing real work, but the preparing time went up by 9 ms, so the CPU side costs more too.
One crash on a later start: the first measured run, the build's second start, also crashed while loading at
+0x23cf683, after the warm-up start had too. The other five builds crashed only on their first start. With one round I can't tell whether that is this PR or chance; worth a look.The first start of every new build in this session crashed while loading at
+0x23cf683(main and all five PRs alike; see #628), so that is not from this change.Tested with an AI assistant (Claude Code); results are from this PC.
0x8007000E, Wave64→Wave32 Failure, Unimplemented Pipeline Slots & 1M View Heap Cap #17980x8007000E, Wave64→Wave32 Failure, Unimplemented Pipeline Slots & 1M View Heap Cap #1798@amazedturnip on GitHub · 2026-11-29 05:38 UTC · original
Tested commits 1-3 on 9800X3D + RTX 5070 Ti 16 GB (Series X 1440p). Non-RT wave64 refusals in shaders.rpf dropped to 0 (all 25,777 shaders pretranslated cleanly, only RT-only BVH shaders remain). Zero issues across 20+ min live sessions. (Minor rebase note: needed two u16 VGPR cast widenings in lower.rs against current main.)
@eleboucher on GitHub · 2026-11-29 06:18 UTC · original
PC result: RTX 4070 Ti SUPER 16 GB (32-lane waves), Ryzen 7 9800X3D, 16 GB RAM, Windows 11, native 1440p,
VICTORY_BVH_BUILDER=1 VICTORY_ACTIVATE_RAYS=1, diagnostics build of main568c5e5dplus this PR and a few others, 10-minute runs, medians after 200 s.71883e40,34992f2b,7168dd78,6b82bc7d, all "no wave32 lowering for this wave64 program"; the first three are the SSR / temporal-resolve programs onWIDE_SKIP_DEFAULT), 0 with it.f9dfb76f, the same PR cost us about 60%: 15 to 5.8 fps; the newer main's own wave64 changes seem to have removed that.)d1486134: "green floors, glitter in windows"), so either the folded SSR / temporal-resolve programs are not exact yet, or these passes read something wrong whichever way they are translated. I can runVICTORY_WAVE_FOLDED_SKIP=CS_RayPrePass_Opaque_SSR,CS_TemporalResolveor aVICTORY_FOLD_DUMPfor those three if that helps.@eleboucher on GitHub · 2026-11-29 06:38 UTC · original
Follow-up on the green patches: they come from aliased transient render targets, not from the fold. Same build, same scenes, only
VICTORY_ALIAS_TARGETS=0added: the green blocks on the building through the prison window are gone (2 of 1128 frame pairs flagged against the run that had them). fps unchanged (20.9 vs 20.7 with captures on); the aliasing had been saving 850 MB of card memory (300 targets). This matches #1976. So the folded SSR / temporal-resolve programs look right; they were reading targets an aliasing barrier had left undefined, which probably also explains the "green floors, glitter in windows" that put them onWIDE_SKIP_DEFAULTind1486134(#1147, the aliasing, was merged about five hours before it). #1887 looks like the matching fix on the aliasing side.@NotADonky43 on GitHub · 2026-11-29 08:34 UTC · original
A narrowly enabled port of the folded translator also recovered CS_CollectTriangles_Meshlets on our Series X configuration (RTX 5070 Ti). The recorded 1024-thread, 32 KiB LDS compute pipeline was refused with folding off and created with it on. A synthetic returning-atomic/triangle-compaction test matched the CPU reference for counts and compacted IDs across three hardware dispatches. The three previously recovered reflection recipes still created with this extension. This is not a finding that every real collected triangle or glossy pixel matches console output. No title payloads attached.
@Melow-code on GitHub · 2026-11-29 12:34 UTC · original
I checked the folded form at
53af8605(and main829188e9, wherefold.rsis the same) against an interpreter of the machine code, on an RTX 3070 (32 lanes). These hand cases fail on both commits. Shader tests only: no game run, no title programs.On the card:
s_cbranch_execz, a scalar set in the skipped code is only the taken lanes'. Expected 44, got 35 in a 64-lane loop case.s_cbranch_execzthere tests one half. With lanes t < 20 a three-pass loop ends after one pass.v_mbcnt_lo_u32_b32 exec_lo, thenv_cmpxin one run: the upper half counts after the lower half's compare. Lane 32: 9, expected 31.v_readfirstlane_b32with EXEC 0 reads lane 32, not lane 0.v_cmpwith EXEC as destination: E is not updated.v_writelane_b32is lowered under EXEC (the ISA ignores it), folded and not folded:v_cmpx_lt_u32 s0, v0; v_writelane_b32 v3, 99, 1with s0 = 20 leaves lane 1 unchanged.On Linux, without a card:
v_lshlrev_b64 v[15:16]with 16 VGPRs).BASES_MAGICbut is not folded panics inir.rs(overflow, debug build).Not tested here, by reading only: a panic inside
with_foldedleaves the thread's flag set.The fix for 1 that I have takes every lane-mask branch of a folded program wave-wide. It must keep the fallback for "lane conditions too large".
AI-assisted (Claude Code).
@TheBen420 on GitHub · 2026-11-29 17:10 UTC · original
Heads up: the hang I reported here reproduces in current
main(55d06914), so the fix for it needs to land before or with this. Same machine (RTX 4080 SUPER, Ryzen 7 5800X, DDR4-3600, Windows 11 22631), built from source,victory shadersran first (25,789 cached, 196 refusals of which 195 are the new "container without a vertex, pixel, compute or mesh program" class).Symptom, twice: the window appears, Windows reports it not responding, CPU time freezes, and the frame counter in the title bar collapses to
0 fps 21023.2 ms/framewhile the log stops dead after pipeline translations.victory-nvidia-play-20261129-165633-2808.log— first launch: helpers spawned, no window ever appeared.victory-nvidia-play-20261129-170745-3136.log— second launch: window appeared, then hung. ProcessResponding=False, CPU frozen at 742.2 s, 27.5 GB RSS, last log line a pixel pipeline translation at 17:09:19, nothing after it. Killed after two minutes.One difference worth noting about current main: it runs as twelve processes — a launcher, the title host, and ten children of the host. If the deadlock is between those, the earlier PR-only build (single process, same freeze) suggests it predates the split rather than being caused by it.
Happy to run whatever build you want with logging switches on;
mainis unusable for us until this clears, and it is the only build that carries the VRAM work in #2753 that we were about to measure.@TheBen420 on GitHub · 2026-11-29 17:18 UTC · original
Narrowed the hang on current
main(55d06914) to a single switch:VICTORY_TEXTURE_NO_WAIT=0freezes it. Everything else we were passing is innocent.Bisected by starting the same build with progressively more of our usual switches, waiting for the title to reach a window each time (Ryzen 7 5800X, DDR4-3600, RTX 4080 SUPER, Windows 11 22631):
VICTORY_ALIAS_TARGETS=0+ VICTORY_ROOM_REAL=1+ VICTORY_SHOW_AFTER=0+ VICTORY_TEXTURE_NO_WAIT=0(what we reported above)VICTORY_SHOW_AFTER=0is fine on its own, andVICTORY_TEXTURE_NO_WAIT=1is the default, so the deadlock is specifically in the no-wait-off path — the one that makes uploads wait for a settled frame. On568c5e5that switch combination runs for hours, so it is new on this branch, and it may well be the same freeze I saw in the PR-only build at frame 16411.We're back on
mainwithVICTORY_ALIAS_TARGETS=0,VICTORY_ROOM_REAL=1,VICTORY_AMBIENT_CHROMA_SCRUB=1, no waiting switches, and the title is stable — which also meansVICTORY_SHOW_AFTER/VICTORY_TEXTURE_NO_WAITmay no longer be needed at all on this branch once that deadlock is fixed. If it's useful I can re-run any of these four with RUST_LOG at debug and send the last thousand lines.