Preserve packed Wave32 scalar words in the adaptive shadow pass #2220
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2220"
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 BlackpawNR on 2026-11-29T10:41:54Z.
Follows #1809 and addresses the FullAdaptive refusal reported in #154 and #1396.
What changes
The Wave32 adaptive shadow-ray compute shader
dbdbf36298727135stops at0xae80. A vector compare reads a packed scalar key. The structurizer also tracks that key as a lane predicate. Rebuilding its scalar bits with a ballot would discard bits belonging to inactive lanes. Microsoft’s WaveActiveBallot referenceAfter that specific refusal, the compute lowerer retries once and keeps the numeric result of scalar AND, OR and XOR writes to ordinary SGPRs when both operands already have full-word representations. It keeps the lane predicate for its existing consumers and recomputes joins on the retry. Reachable inputs still require a full word.
The descriptor follow-up uses the final DXIL branch condition, after wave-wide decisions and loop limits. A literal condition can select only one of two distinct successors. The predecessor stays in the DXIL graph, with an unused phi input for any unavailable value on the impossible edge. Strict transitive join checking follows the edges that can carry a value. In FullAdaptive, the edge at
0x87f8that would carry the stale descriptor words is impossible. The other edge loads the data the shader uses.Verification
Tested against
829188e9on a GeForce RTX 5070 Ti with driver 621.40, targeting 32-lane host waves. Both builds used the same five locally supplied shadow compute programs. Resolution, DLSS and frame generation do not enter this offline test.The four previously successful serialized shader records, including their bindings, have identical SHA-256 hashes across the two caches.
The synthetic regression fails on the base with the same lane-mask refusal. On the RTX, eight dispatches check both paths into a scalar join, partial and empty execution masks, and high tag bits in 8- and 32-thread groups. A second regression covers unavailable predicate bits. The synthetic tests also pass with
VICTORY_STRICT_JOINS=1.Before the join follow-up, seven interleaved repeat runs of
victory shaders --jobs 1took a median of 479 ms upstream and 205 ms patched for the affected shader. Upstream retried translation on every launch. A previously cached sibling measured 206 ms and 202 ms respectively. These are whole-process preload times.The final optimized host-enabled shader suite passed 465 tests with 9 ignored. With
VICTORY_STRICT_JOINS=1, the new literal-edge regression passes on this branch and fails on the base. The separate reachable-missing-value regression and the packed scalar GPU readbacks also pass in strict mode. The staged asset-policy check passed.All-features Clippy with warnings denied reports the same four pre-existing findings as the upstream base.
Copied-save gameplay comparison
Compared the same upstream base and the patched runner on identical copies of a waterfront free-roam save. Both use the same Series X preset, 2560×1440 output, DLSS Quality requested, frame generation off, and a fixed camera. The diagnostics builds have identical build-compatibility fixes and dispatch counters. Those counters cover direct and indirect requests, including failed pipeline binds, using container identity and native instruction bytes. Timing uses the last 30 seconds of continuous gameplay in each run, from the individual intervals between the title’s presents.
The main runs were ordered stock, patched, patched, stock. The first stock run lost much of the shadow on the ground and picnic table. Stock reproduced those shadows on the second run, as did both patched runs. All six runs requested
CS_TraceShadowRays_Checkerboard. The counters saw zero requests forFullAdaptiveor its four siblings. All 50 named shadow compute shaders recorded in the first stock run emitted byte-identical DXIL with both translators.Both builds requested the ray-tracing structure builder. During gameplay it reported 50 of its 53 pipelines unavailable, with D3D12
0x8007000efailures. Across all pipeline types, the first stock run logged 170 such failures against distinct keys. The second stock run logged 85. One of the failing builder shaders created a hardware pipeline in isolation. The slow stock run did not reproduce. A gameplay frame-rate or shadow improvement from FullAdaptive remains unverified.FullAdaptive in gameplay
The game selects Checkerboard when
rtLocalShadowsis Low (0). A nonzero setting selects a sequence of six passes, with FullAdaptive fourth. Both stock console profiles tested selected Checkerboard on the waterfront. Changing the time to 23:00 alone still selected Checkerboard. For the comparison below, the copied Series X session loaded a bundled graphics preset with local and directional RT shadows set to High. The game then requested FullAdaptive through its usual render path.All three runs used the same save, viewpoint, night-time setting and output settings described above. FPS is the mean over the final 30 seconds of individual rendered presents, with frame generation off. The command counts come from the last cumulative sample of each run.
Stock refused the shader at
0xae80. The patched runner translated it, then D3D12 returnedE_OUTOFMEMORY(0x8007000E) when creating the compute pipeline during gameplay. A second trace confirmed this failure and recorded zero commands from 494 requests. With the identical translated shader and root signature prepared during loading, D3D12 created the pipeline in 5.34 seconds. The renderer then recorded anExecuteIndirectcall for each of the 858 requests observed. The GPU workgroup counts in the indirect argument buffer remain unmeasured.The waterfront ground, fence and bench looked similar in all three captures. The ray-tracing structure builder reported 46 or 47 of its 53 pipelines unavailable in these runs. The early-creation experiment changed scheduling and is confined to the diagnostic runner. These results verify the translation fix in gameplay. A repeatable improvement in shadows or rendered FPS remains unverified.
Checked for overlap
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.