Wave64 folded translator, upload guard and placed-view twins: hair, beards and trails right on NVIDIA #1296
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!1296
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1296"
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 17:02 UTC · original
aventureroestelar-source:wave64-folded-hair-trails→main· +4650 −89 · 28 files · 1 commits · closed without mergingSummary
This PR brings fixes developed and measured on an RTX 5070 Ti (Series S profile, no ray tracing). They were tested on the opening cutscene (police station, social worker, Lucía, beach, boat) and the first gameplay, using fast burst captures of the game window (about 20 frames/s), side-by-side comparisons and repeated runs. Each change is behind a switch.
What improves
VICTORY_WAVE_FOLDED=0)mainChanges
Folded wave64 translator (
fold.rs,emit/mod.rsfolded(),lower.rs,ir.rs,gfx10/*;VICTORY_WAVE_FOLDED, on)Each host lane runs two console lanes, so 64-lane waves are exact on 32-lane hardware. Ballots,
readlane,mbcnt, LDS within a group and lane masks all behave as on the console.VICTORY_WAVE_FOLDED_SKIP/_ONLYchoose the programs it applies to, by name or hash prefix, for bisection.Two faults found with the hair, both fixed and covered by GPU tests:
v_cmp_eq_i32 s[0:1], s0, v0wrote the mask intos[0:1]while readings0: the low half's copy overwrotes0before the high half read it. The high half now goes first; if both halves would overwrite each other's input, the program is not folded.s_or_saveexec_b64 -1reopened EXEC after lanes had left throughv_cmpx/s_cbranch_execz. Those lanes were taken as finished, so the wave-wide OR read lane 0's unset value. Branches on EXEC are now taken wave-wide when the program sets EXEC back to all lanes.CS_HairTileClassifyhad both faults: half of each 8x8 hair tile was classified wrong, which drew beards and curly hair in rectangular patches.Upload guard (
texture.rs,list.rs;VICTORY_UPLOAD_GUARD, on)The title records lists on several threads. A list recorded a moment before the decoration bake's copy into a character's make-up texture could hold an upload of that texture from title memory (noise) and be submitted after it. Every upload from title memory now runs under a D3D12 predicate that is set to skip at submission if a host write of the same texture was submitted before. Prelude uploads (
PreludeUpload::finish_refresh) make the same check at submission.Placed views over host-written textures (
resource.rs,texture.rs,list.rs,draw.rs;VICTORY_PLACED_COPIED, on)A view the title places at the address of a texture the host copied into now reads that texture, not a copy filled from title memory, which the copy never reached. Views of another block format placed there before (BC3 written, BC7 sampled) take its levels at their first use, and later copies reach them too. A host-written texture is never re-made from title memory by
want_level.Upload pool (
upload.rs)The pool is reserved top-down in [4 GiB, 2^37), so its first piece ended on the last page of the memory-by-address directory. That entry is never filled, so shaders read zeros there. Allocations now stop one page below it.
VICTORY_UPLOAD_SPACE=0runs without the pool, for tests.Scene changes (switches, off by default)
VICTORY_RANGE_LOCK(rangelock.rs,watch.rs,xmem.rsPhysical::touched): a read of title memory waits only for a remap whose pages meet its range, instead of for every remap.VICTORY_BUFFER_POOL(host/recycle.rs): per-recording buffers are taken again once only our reference is left, instead of being made, made resident and waited for (about 8,000 reused and 50 made per run).VICTORY_REFRESH_EARLY(host.rs): not fit for use. Together with the range lock it made beards shimmer. Three faults are fixed and kept: it no longer consumes theexact/oncemarks, reads only fully mapped textures, and only textures never uploaded. It stays off.Also
Four clippy lints that the current toolchain reports on
mainare fixed, indescriptor.rs,shadow.rsandgameinput.rs. Both CI clippy builds are clean.Tests
cargo test --workspace --locked: 1,149 passed, 1 failed. The passing tests include 14 GPU tests for the folded form, one of them running the real code ofCS_HairTileClassifyon synthetic tiles: it returned zeros before the fixes and is correct now.The failure is
xtaskrepository_passes_policy, which fails onmaintoo:bindings.ini(added in4715a42) is not a file type on the asset policy's allowlist. It is not touched here.Known, not fixed here
mainwithout this PR draws it in that gameplay has not been checked yet.🤖 Generated with Claude Code
@jptorres96 on GitHub · 2026-11-28 18:25 UTC · original
Checked at
9da16ec(on9ce3cf9, currentmain) on a second 32-lane card: RTX 4080 SUPER (driver 621.01), Windows build 26300, rustc 1.98.1, DXC 1.9 validator. All synthetic.emit::folded_tests(the 14 GPU tests, including the realCS_HairTileClassifyon synthetic tiles)cargo clippy --workspace --all-targets -- -D warnings, with and without--all-featuresmain)victory-shaderlib, by default and withVICTORY_SHADER_OPT=255victory-gpulib,--test-threads=1victory-hlelibcargo test --workspace --lockedxtaskrepository_passes_policy, as you note (bindings.ini, also onmain; #1290 adds it)Since this touches
watch.rs:victory-gpu's lib tests in parallel, as CI runs them, 15 runs each, interleaved withmain. Watch tests failed 0 times here and 3 times onmain. Thesave_sharefailures in both (5 here, 1 onmain) are the OS error 32 one, outside this diff and fixed by #819 or #594 (counts in #1138).Two thoughts on landing it:
fold.rs,emit/mod.rs,lower.rs,ir.rs,gfx10/*,folded_tests.rs) would be the easiest to review and test on its own. The clippy part is also in #957, #1160 and #1290.VICTORY_REFRESH_EARLY: it is marked "not fit for use" and stays off. It might be better out of this PR, so the code that lands is code that runs.Also: #1138 section 3 lists ten PRs for 64-lane programs refused on 32-lane cards. Saying which of
main's refused programs (the five hashes there, plus the 22 you count) each of them runs would help the maintainer choose. Yours says 1 refused, 175 exact.@trustno1-coder on GitHub · 2026-11-28 19:22 UTC · original
Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.
Pull request closed