Repository navigation
Wave64 programs on 32-lane hosts again, the shader cache key's missing switches, a relay remap wait, list-thread sampling - #1575
Conversation
Six switches the translator reads change what it makes but were not in the shader cache key, so a warm cache served the translations made without them to a run that set them (and the reverse): VICTORY_HDR_CLAMP, VICTORY_LDS_FIRST_INIT, VICTORY_LDS_INIT_HOIST, VICTORY_LOOPS_WAVE, VICTORY_SAMPLED_MARKS and VICTORY_DEFRAG. `VICTORY_HDR_CLAMP=0` on a warmed cache still clamped, for one. VICTORY_BVH_MISS is keyed by whether it is on, as VICTORY_BVH_NO_HIT is: VICTORY_BVH_BUILDER=1 (the F1 menu's ray tracing) turns it off, and a run with the builder on was served the misses of a run with it off. The list is a constant (KEYED), and a test checks every switch the translator's source names (build.rs, now emit::SWITCHES) against it, the switches keyed in other ways, and those that change no translation (tests, reports, the validator). A new switch fails the test until it is put in one of the three. Every cache key changes once: shaders are translated again on the first run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tno1-coder#631) In relay mode land_before_remap waited while any landing was in hand (line.settling), so a remap of title memory no landing writes still put the title's mapping thread behind unrelated work. With relay, line.written stays as it was until the landing is done (relay_land works it out anew only then, from the flights still in the air), so the flights being landed are still in it: waiting until no range of `written` touches the remapped one is enough. Without relay, settling is still waited for as before. Found in review of trustno1-coder#631; not measured on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nostics) The timeline's sampler looked only at the title's submitting threads. Each thread that translates lists now notes itself as it starts, and with the switch the sampler pauses those as well, so a recording shows which of our functions the list threads spend their time in. Diagnostics builds only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With VICTORY_TIMELINE_LISTS=1 the sampler copies up to 64 KB of a paused thread's stack with its registers, lets it run on, and walks the copy with RtlLookupFunctionEntry and RtlVirtualUnwind (Windows' unwinding takes locks the paused thread may hold, so it is not done while it is paused). The samples' stacks are then return addresses, so time in the driver can be put on the call of ours that led there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…osts 407eca669212d400 and 18d957e62926ed3e were refused on an RTX 5080 run of 1.0.2.1 (Series X, 1440p, DLSS); widened they translate (2 and 5 branches taken wave-wide). Added to scene_kernel by digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…osts (VICTORY_LDS_WRITE_ONLY_OK=0 turns it off) 075785e (trustno1-coder#43, static LDS alias analysis) made the legacy shortcut for write-only lane-branch regions opt-in. On a 32-lane host (NVIDIA) 19 wave64 compute programs of the game then no longer translate and their dispatches are dropped: the tree culling passes (InstanceCulling:CS_Tree_*, six), the indirect lighting gathers and screen-probe traces (six), indirect_light_probes:CS_VarianceFilterAlpha, shadowmask: CS_TraceShadowRays_Fullres, vfx_proj_decal_vbuffer: CS_ProjDecalReduceClassification_Scalarized, water_shading: CS_Classification_Water, and three kernels of XboxBvhBuilder.dll. They translated with the shortcut before 075785e. `victory translate --list` of 1.0.2.1 with VICTORY_HOST_WAVE=32 VICTORY_VIEW_LIMIT=737855: main refuses 37 programs with "no wave32 lowering for this wave64 program"; with this, 18. The strict analysis is unchanged and still decides on 64-lane hosts and with VICTORY_LDS_WRITE_ONLY_OK=0; the regions it can prove are taken as before. The tests of the strict analysis turn the shortcut off for themselves (lds::strict_for_test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A note on commit 2 (the shader cache key), so only one of the two goes in: it overlaps #807. #807 has been open since 2026-11-28 morning, and was rebuilt on 923e38c today. It keys the same six switches ( Your On commit 1: #1590 takes the write-only shortcut as a last try instead of turning it on for every program. Your 19-program measurement is the confirmation #1435 needed, thanks. |
|
Tested — it works, with an independent bisect data point and one finding from the first cold start. Setup: GeForce RTX 5070 12 GB, 31 GB RAM, Windows 11 26300, dump of the title v1.0.2.1, Series X profile. Bisect, independent of #1435's: from #1516's own two logs (the broken run refuses 13 wave64 compute programs, the release 3) I took the new hashes and used In the game: since your commit 1 is semantically identical to the change I had built and tested independently (the same default flip, First cold start, separate finding (not about this change): without any warming, the title killed itself ~60 s into the first load with its own watchdog ( |
What it changes
Six commits, independent of each other: each builds on its own, so any can be taken without the others.
Shaders: the LDS write-only shortcut on by default again on 32-lane hosts (
VICTORY_LDS_WRITE_ONLY_OK=0turns it off). 075785e (shader: static Wave32 LDS alias and lane-private hazard analysis #43) made the legacy shortcut for write-only lane-branch regions opt-in. Since then, on a 32-lane host (NVIDIA), 19 wave64 compute programs no longer translate and their dispatches are dropped:InstanceCulling:CS_Tree_*, six);CS_VarianceFilterAlpha,CS_TraceShadowRays_Fullres,CS_ProjDecalReduceClassification_ScalarizedandCS_Classification_Water;XboxBvhBuilder.dll.The strict analysis itself is unchanged. It still decides on 64-lane hosts and with
=0. Its four tests turn the shortcut off for themselves.Shader cache: the translator's switches that were not in its key. Six switches change what the translator makes but are not in the key, so a warm cache serves translations made without them:
VICTORY_HDR_CLAMP,VICTORY_LDS_FIRST_INIT,VICTORY_LDS_INIT_HOIST,VICTORY_LOOPS_WAVE,VICTORY_SAMPLED_MARKSandVICTORY_DEFRAG. For example,VICTORY_HDR_CLAMP=0on a warmed cache still clamps.VICTORY_BVH_MISSis now keyed by whether it is on, asVICTORY_BVH_NO_HITalready is.VICTORY_BVH_BUILDER=1(the F1 menu's ray tracing) turns it off, and before this both runs shared one key.build.rs's list, nowemit::SWITCHES), so a new switch fails the test until someone decides whether it is keyed.LOOPS_WAVE,LDS_FIRST_INIT) together with unrelated F7/F8 changes.Relay: a remap waits only for the landings that touch its range (follow-up to queue: flights that may write pages land before a page-mapping copy remaps them #631). In relay mode
land_before_remapalso waited while any landing was in hand. In relay modeline.writtenkeeps the ranges of the flights being landed untilrelay_landis done, so waiting until no written range touches the remapped one is enough. Without relay it waits as before. Found in review; not measured on its own.Timeline:
VICTORY_TIMELINE_LISTS=1samples the list threads too (diagnostics builds only).Timeline: real call stacks for the list threads (diagnostics builds only). The sampler pauses a list thread only long enough to copy its registers and up to 64 KB of its stack. Once the thread runs on, it walks the copy with
RtlLookupFunctionEntryandRtlVirtualUnwind, because Windows' unwinding takes locks the paused thread may hold. With this, time in the driver is charged to the call of ours that led there. On an RTX 5080 it showed that about 22–30% of the list threads' driver time isCreateShaderResourceViewfor buffer views.Shaders: two more 64-thread LDS programs taken wave-wide on 32-lane hosts.
GpuParticleEmit:CS_Emit_Dynamic_Model(18d957e62926ed3e) andCS_Emit_Dynamic_Model_AttachMesh(407eca669212d400) join thescene_kerneldigests (Shaders: four more 64-thread LDS programs taken wave-wide on 32-lane hosts #101's shape). Widened, they translate.How it was tested
GPU and profile: RTX 5080 (32-lane), Ryzen 7 9800X3D, GTA VI 1.0.2.1, Series X/S profiles at 1440p, DLSS. Items 1 and 6 were played on a local branch before 075785e reached it; those programs translated and drew right in play.
Before/after,
victory translate --list <game>withVICTORY_HOST_WAVE=32 VICTORY_VIEW_LIMIT=737855(every shader of the game, about 52,000 lines):VICTORY_LDS_WRITE_ONLY_OK=1on main)Items 1 and 6 were measured separately; together they should give 16.
For shader changes, wave sizes tested: 32 lanes (census above); the 64-lane path is unchanged (the shortcut is off unless the host's widest wave is 32).
cargo test: thevictory-gpushader_cachetests pass locally, including the new one. The workspace's clippy and tests are left to this PR's CI run. Main's clippy currently stops at two errors inlower.rs, before the tests; Shaders: the two clippy errors that stop main's clippy in lower.rs #1517 fixes them, so this PR's CI will be red there until Shaders: the two clippy errors that stop main's clippy in lower.rs #1517 (or CI: clippy and the file-size policy green on main after the 28 November merges #1527) is in.Checked for overlap
VICTORY_LDS_EXACT=1, off by default) #733 (item 1); GPU: shader cache keyed by LOOPS_WAVE and LDS_FIRST_INIT; F8/F7 let texture copies go by hand #1437, perf(gpu): VRAM DEFAULT sampled-slot marks with async present readback, WaveIsFirstLane dedup, and shader cache key fix #1425 (item 2); queue: flights that may write pages land before a page-mapping copy remaps them #631 (item 3). Clippy and the size policy on main are left to Shaders: the two clippy errors that stop main's clippy in lower.rs #1517, CI: clippy and the file-size policy green on main after the 28 November merges #1527, Policy: the file-size limit is 1 MiB, over the translator's 688 KiB lower.rs (fixes #1429) #1493 and Move shader lowering tests into their own module file #1460.🤖 Generated with Claude Code