Shaders: verify restored compute lane masks on D3D12 (stacked on #298) #1257

Closed
github-bot wants to merge 2 commits from gh-pr/1257/head into gh-pr/1257/base
Owner

@⁠Castyan on GitHub · 2026-11-24 16:50 UTC · original
Castyan:compute-mask-spill-regression → main · +362 −35 · 4 files · 2 commits · closed without merging

Follow-up to #298. This draft carries that translator commit, followed by one D3D12 regression and a local before/after comparison.

The test spills the complement of a comparison mask to a VGPR lane, restores it, and consumes it in a compute select. Main rejects it with an untracked-mask error. With #298, the hardware adapter and WARP both return 17 for equal inputs and 29 otherwise.

The same local archive was scanned with the Windows SDK DXIL validator on ffe310e and 54f97db. Across 26,084 native programs, the mask-as-data refusal fell from 272 to 12. DXIL validates for seven additional compute and 27 additional pixel programs. Mesh and vertex totals are steady. The per-program comparison found zero lost validations.

Workspace tests passed (343 passed, 5 ignored), shader Clippy passed with warnings denied, and the asset-policy check passed. Gameplay dispatch counts and rendering impact remain unmeasured. Reproduction details and per-stage counts are in docs/compute-lane-mask-spill.md.

OpenAI Codex assisted with the regression, measurements and documentation.

**@⁠Castyan** on GitHub · 2026-11-24 16:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257) `Castyan:compute-mask-spill-regression` → `main` · +362 −35 · 4 files · 2 commits · closed without merging Follow-up to #298. This draft carries that translator commit, followed by one D3D12 regression and a local before/after comparison. The test spills the complement of a comparison mask to a VGPR lane, restores it, and consumes it in a compute select. Main rejects it with an untracked-mask error. With #298, the hardware adapter and WARP both return 17 for equal inputs and 29 otherwise. The same local archive was scanned with the Windows SDK DXIL validator on ffe310e and 54f97db. Across 26,084 native programs, the mask-as-data refusal fell from 272 to 12. DXIL validates for seven additional compute and 27 additional pixel programs. Mesh and vertex totals are steady. The per-program comparison found zero lost validations. Workspace tests passed (343 passed, 5 ignored), shader Clippy passed with warnings denied, and the asset-policy check passed. Gameplay dispatch counts and rendering impact remain unmeasured. Reproduction details and per-stage counts are in docs/compute-lane-mask-spill.md. OpenAI Codex assisted with the regression, measurements and documentation.
The console compiler spills lane masks like other SGPRs: v_writelane_b32
to a constant lane, v_readlane_b32 of that lane later. The lane pass took
the read-back value for an opaque mask, and the spill write read the
mask as data, which fails for a mask holding lanes not running there
("a lane mask holding lanes elsewhere read as data").

structure: a v_readlane_b32 of a constant lane that reads back a
v_writelane_b32 of a mask (through writes of other lanes and agreeing
joins), where the mask's value dominates the read, is that mask: each
lane's bit is the one it had when spilled. Wave64 masks need both dwords
read back from the same mask.

lower: such a read leaves its value to the mask's readers, and a spill
write of a mask is left out where that VGPR lane is read only by such
reads (no vector instruction or computed-lane read sees it). Neither
counts as reading the console's lanes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:18 +00:00
github-bot closed this pull request 2026-11-26 04:25:18 +00:00
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 16:59 UTC · original

Runtime follow-up on Windows, Series S, hardware D3D12. I ran this PR's 5981894 on top of the previous local test stack (83033b7, including the Series S PresentX compositor and root-UAV support). The resulting local test build was 27d50d0, with a fresh shader cache.

I matched shader IDs locally against the previous run's 57 compute shaders that were refused with a lane mask holding lanes elsewhere read as data. All 57 appeared in this run.

Outcome in this run Compute shaders
Translator emitted a shader 4
Reached a different translation refusal 53
Same lane-mask-as-data refusal 0

The 53 next refusals were descriptor read only as data (35), unknown structured-buffer stride (10), descriptor address or format read as data (4), scalar memory read as data (3), and an untracked lane-mask join (1).

This compares translation outcomes for the same shader IDs. Dispatch recovery, frame-rate impact, and the visual result remain to be confirmed. The process was still running at the time of measurement. The full logs were exported locally.

OpenAI Codex assisted with the test and analysis.

**@⁠Castyan** on GitHub · 2026-11-24 16:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7138525049) Runtime follow-up on Windows, Series S, hardware D3D12. I ran this PR's `5981894` on top of the previous local test stack (`83033b7`, including the Series S PresentX compositor and root-UAV support). The resulting local test build was `27d50d0`, with a fresh shader cache. I matched shader IDs locally against the previous run's 57 compute shaders that were refused with `a lane mask holding lanes elsewhere read as data`. All 57 appeared in this run. | Outcome in this run | Compute shaders | | --- | ---: | | Translator emitted a shader | 4 | | Reached a different translation refusal | 53 | | Same lane-mask-as-data refusal | 0 | The 53 next refusals were descriptor read only as data (35), unknown structured-buffer stride (10), descriptor address or format read as data (4), scalar memory read as data (3), and an untracked lane-mask join (1). This compares translation outcomes for the same shader IDs. Dispatch recovery, frame-rate impact, and the visual result remain to be confirmed. The process was still running at the time of measurement. The full logs were exported locally. OpenAI Codex assisted with the test and analysis.
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 17:22 UTC · original · edited 2026-11-24 17:29 UTC

Status of the cinematic test

151 of 153 tracked compute shaders now translate. The 3D scene still does not appear, and both hardware retests ended in DXGI_ERROR_DEVICE_HUNG.

Compute shaders previously refused for descriptor reads First retest Second retest
Translated 115 151
Encountered and still refused 0 0
Not seen in the run 38 2

Of the original 38 that were not seen, 36 translated on the second retest. The other two are still unobserved. All 115 translations from the first retest were also present in the second.

Runtime check Result
3D scene The player reported that the scene was still missing on both retests
Stability Both runs lost the D3D12 device about 293 seconds after launch, with the first unfinished list in a direct DispatchMesh
Dynamic descriptor pool No exhaustion warnings in either retest with the 262,144-slot capped-heap range
Typed null views At least 65,536 writes logged in the second run, counting repeated writes
Frame time The final three intervals of the second run ranged from 1.76 to 5.54 seconds per frame. The samples are from different frames and do not establish a speedup

Both runs used the same local Series S setup on hardware D3D12 with fresh shader caches. The first test build (9d439d5) added #1130, #483, #493 and #322 to the local #1257 integration. The second (3e5eaae) also added #568, #119 and the typed-null write counter. The second build passed 60 GPU and 131 shader tests, with two benchmarks ignored.

These measurements cover the same locally matched shader identifiers. A successful translation does not establish that its draw or dispatch ran successfully, and the DRED stop is not proof of the cause of the hang. Raw logs stay local. OpenAI Codex assisted with the integration, tests and analysis.

**@⁠Castyan** on GitHub · 2026-11-24 17:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7139086098) · edited 2026-11-24 17:29 UTC ### Status of the cinematic test **151 of 153 tracked compute shaders now translate. The 3D scene still does not appear, and both hardware retests ended in `DXGI_ERROR_DEVICE_HUNG`.** | Compute shaders previously refused for descriptor reads | First retest | Second retest | | --- | ---: | ---: | | Translated | 115 | 151 | | Encountered and still refused | 0 | 0 | | Not seen in the run | 38 | 2 | Of the original **38** that were not seen, **36 translated** on the second retest. The other two are still unobserved. All 115 translations from the first retest were also present in the second. | Runtime check | Result | | --- | --- | | 3D scene | The player reported that the scene was still missing on both retests | | Stability | Both runs lost the D3D12 device about 293 seconds after launch, with the first unfinished list in a direct `DispatchMesh` | | Dynamic descriptor pool | No exhaustion warnings in either retest with the 262,144-slot capped-heap range | | Typed null views | At least 65,536 writes logged in the second run, counting repeated writes | | Frame time | The final three intervals of the second run ranged from 1.76 to 5.54 seconds per frame. The samples are from different frames and do not establish a speedup | Both runs used the same local Series S setup on hardware D3D12 with fresh shader caches. The first test build (`9d439d5`) added #1130, #483, #493 and #322 to the local #1257 integration. The second (`3e5eaae`) also added #568, #119 and the typed-null write counter. The second build passed 60 GPU and 131 shader tests, with two benchmarks ignored. These measurements cover the same locally matched shader identifiers. A successful translation does not establish that its draw or dispatch ran successfully, and the DRED stop is not proof of the cause of the hang. Raw logs stay local. OpenAI Codex assisted with the integration, tests and analysis.
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 18:06 UTC · original

Series S hardware retest

The producer trace linked the mesh/pixel pipeline from the earlier DRED reports to two compute outputs whose PSOs were refused on this 32-lane adapter. With #439 integrated locally, D3D12 created both targeted PSOs and 77 of the 103 previously refused compute PSOs. Translation still refuses 26 of that set, including 25 with groups over 64 threads. The run also created PSOs for 150 of the 153 shaders previously blocked on descriptor reads.

The mesh/pixel pipeline stayed enabled. At 7 min 06 s, the title hit an unhandled 0x80000003 breakpoint. The log recorded zero device removals. Scene rendering and cutscene completion remain unverified. The local integration passed 64 GPU and 171 shader tests. Codex assisted with diagnostics and testing.

**@⁠Castyan** on GitHub · 2026-11-24 18:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7140169753) ### Series S hardware retest The producer trace linked the mesh/pixel pipeline from the earlier DRED reports to two compute outputs whose PSOs were refused on this 32-lane adapter. With #439 integrated locally, D3D12 created **both targeted PSOs** and **77 of the 103 previously refused compute PSOs**. Translation still refuses 26 of that set, including 25 with groups over 64 threads. The run also created PSOs for 150 of the 153 shaders previously blocked on descriptor reads. The mesh/pixel pipeline stayed enabled. At **7 min 06 s**, the title hit an unhandled `0x80000003` breakpoint. The log recorded zero device removals. Scene rendering and cutscene completion remain unverified. The local integration passed 64 GPU and 171 shader tests. Codex assisted with diagnostics and testing.
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 18:13 UTC · original

Proposed next test

I’ll start with the compute producer whose output overlapped a mesh/pixel input at frame 1250, about 12 seconds before the first PSO creation was logged. On the local #439 integration, I’ll log when that pipeline is queued, built and first used, then correlate the producer’s dispatch and GPU completion with the mesh binding and any title exception.

If the trace identifies a queue delay, I’ll test the urgent scheduling portion of #1013 in isolation. If it identifies a resource-state problem, I’ll test the relevant transition from #334 instead. The comparison will use the same Series S profile and cinematic sequence. I’ll report whether the target dispatch completes, whether its output is available at the mesh binding, and where the run ends. Raw logs stay local. Codex is assisting with the instrumentation and tests.

**@⁠Castyan** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7140330234) ### Proposed next test I’ll start with the compute producer whose output overlapped a mesh/pixel input at frame 1250, about 12 seconds before the first PSO creation was logged. On the local #439 integration, I’ll log when that pipeline is queued, built and first used, then correlate the producer’s dispatch and GPU completion with the mesh binding and any title exception. If the trace identifies a queue delay, I’ll test the urgent scheduling portion of #1013 in isolation. If it identifies a resource-state problem, I’ll test the relevant transition from #334 instead. The comparison will use the same Series S profile and cinematic sequence. I’ll report whether the target dispatch completes, whether its output is available at the mesh binding, and where the run ends. Raw logs stay local. Codex is assisting with the instrumentation and tests.
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 19:18 UTC · original

The next logical step would be to isolate the compute shader whose execution time reaches 658.1 ms to determine whether it contributes to the GPU device removal.

**@⁠Castyan** on GitHub · 2026-11-24 19:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7141899983) The next logical step would be to isolate the compute shader whose execution time reaches 658.1 ms to determine whether it contributes to the GPU device removal.
Author
Owner

@⁠Castyan on GitHub · 2026-11-24 18:37 UTC · original · edited 2026-11-24 20:03 UTC

Targeted scheduling result

With fresh caches on the same Series S setup, an opt-in priority based on #1013 reduced the selected compute producer's queue wait.

Selected producer FIFO Prioritized
Queue wait 6,492 ms 14 ms
Pipeline build time 42 ms 65 ms
Reader submissions before a traced overlapping write 2 (284 bindings) 0
Traced writer submissions with completed fences 185/185 205/205

Both runs reached the same title breakpoint (0x80000003). A separate run with DRED markers disabled lost the device at 163 seconds after all 37 traced writer submissions had completed.

Latest run with DRED and per-list timing

The targeted producer queued for 4 ms. All 28 traced writer submissions completed, with 986 overlapping reader bindings after a completed writer and zero early overlaps. D3D12 reported device removal about 105 seconds after the targeted pipeline was first queued, following a long wait at the menu. DRED returned an empty breadcrumb list for the 16-list batch. The D3D12 debug layer was unavailable on this machine.

Per-list timing sampled a different compute shader five times, up to 658.1 ms for a 64?32?1 dispatch. A separate report on #439 identified the same shader with a different dispatch size. The timing makes that shader a candidate for a focused follow-up. The command responsible for our device removal, visible 3D and cinematic completion remain unverified.

Single-shader exclusion and re-enable

The same Series S executable, fresh application caches, DRED, and per-list timing were used throughout.

Compute shader sampled at 658.1 ms Time after the traced producer queued Outcome
Enabled, reference 104.9 s D3D12 device removal
Excluded and confirmed skipped 324.8 s Title breakpoint 0x80000003
Re-enabled 206.7 s D3D12 device removal

With the shader re-enabled, timing captured 13 samples at 64?32?1 groups, with a maximum of 1,229.4 ms. DRED put a one-group DispatchMesh from the previously implicated mesh/pixel pair at command 125 of 128. The comparison supports a contribution from the selected compute shader or the work that follows it. The mechanism, visible 3D and cinematic completion remain unverified.

Compute exchange and mesh guard retests

All three Series S runs used DRED, per-list timing, and fresh application caches with the slow compute shader enabled. Time starts when the traced producer queued. The timing samples are from slow lists.

Local change Compute samples at 64?32?1 Median Max Device removal
Alternating Wave32 shared slots (8e4cd17) 14 656.05 ms 778.3 ms 216.4 s, same DispatchMesh
Fixed shared slots (2f2c64d) 1 524.2 ms 524.2 ms 29.2 s, empty DRED breadcrumbs
Mesh primitive index guard from #587 (ede9634) 34 606.7 ms 622 ms 224.7 s, same DispatchMesh

The mesh test used the reference compute lowering. Its 124 traced writer submissions all completed. DRED identified a one-group DispatchMesh at command 123/126 in the same mesh/pixel pair. It supplied no GPU fault address, and the D3D12 debug layer was unavailable. The tests leave the device-removal cause and cinematic completion open.

The compute variants passed DXIL validation and host PSO creation. The mesh guard also passed validation and PSO creation for the implicated pair, 171 shader tests, 65 GPU tests, and shader Clippy with warnings denied.

Codex assisted with the patch, tracing and tests.

**@⁠Castyan** on GitHub · 2026-11-24 18:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7140904992) · edited 2026-11-24 20:03 UTC ### Targeted scheduling result With fresh caches on the same Series S setup, an opt-in priority based on #1013 reduced the selected compute producer's queue wait. | Selected producer | FIFO | Prioritized | | --- | ---: | ---: | | Queue wait | 6,492 ms | 14 ms | | Pipeline build time | 42 ms | 65 ms | | Reader submissions before a traced overlapping write | 2 (284 bindings) | 0 | | Traced writer submissions with completed fences | 185/185 | 205/205 | Both runs reached the same title breakpoint (`0x80000003`). A separate run with DRED markers disabled lost the device at 163 seconds after all 37 traced writer submissions had completed. ### Latest run with DRED and per-list timing The targeted producer queued for **4 ms**. All **28 traced writer submissions** completed, with **986 overlapping reader bindings after a completed writer** and zero early overlaps. D3D12 reported device removal about **105 seconds after the targeted pipeline was first queued**, following a long wait at the menu. DRED returned an empty breadcrumb list for the 16-list batch. The D3D12 debug layer was unavailable on this machine. Per-list timing sampled a different compute shader five times, up to **658.1 ms** for a `64?32?1` dispatch. A [separate report on #439](https://git.gtahub.st/github/Marvisak--VIctory/pulls/439) identified the same shader with a different dispatch size. The timing makes that shader a candidate for a focused follow-up. The command responsible for our device removal, visible 3D and cinematic completion remain unverified. ### Single-shader exclusion and re-enable The same Series S executable, fresh application caches, DRED, and per-list timing were used throughout. | Compute shader sampled at 658.1 ms | Time after the traced producer queued | Outcome | | --- | ---: | --- | | Enabled, reference | 104.9 s | D3D12 device removal | | Excluded and confirmed skipped | 324.8 s | Title breakpoint `0x80000003` | | Re-enabled | 206.7 s | D3D12 device removal | With the shader re-enabled, timing captured 13 samples at `64?32?1` groups, with a maximum of **1,229.4 ms**. DRED put a one-group `DispatchMesh` from the previously implicated mesh/pixel pair at command 125 of 128. The comparison supports a contribution from the selected compute shader or the work that follows it. The mechanism, visible 3D and cinematic completion remain unverified. ### Compute exchange and mesh guard retests All three Series S runs used DRED, per-list timing, and fresh application caches with the slow compute shader enabled. Time starts when the traced producer queued. The timing samples are from slow lists. | Local change | Compute samples at `64?32?1` | Median | Max | Device removal | | --- | ---: | ---: | ---: | --- | | Alternating Wave32 shared slots (`8e4cd17`) | 14 | 656.05 ms | 778.3 ms | 216.4 s, same `DispatchMesh` | | Fixed shared slots (`2f2c64d`) | 1 | 524.2 ms | 524.2 ms | 29.2 s, empty DRED breadcrumbs | | Mesh primitive index guard from #587 (`ede9634`) | 34 | 606.7 ms | 622 ms | 224.7 s, same `DispatchMesh` | The mesh test used the reference compute lowering. Its 124 traced writer submissions all completed. DRED identified a one-group `DispatchMesh` at command 123/126 in the same mesh/pixel pair. It supplied no GPU fault address, and the D3D12 debug layer was unavailable. The tests leave the device-removal cause and cinematic completion open. The compute variants passed DXIL validation and host PSO creation. The mesh guard also passed validation and PSO creation for the implicated pair, 171 shader tests, 65 GPU tests, and shader Clippy with warnings denied. Codex assisted with the patch, tracing and tests.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:35 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Draft stacked on #298 (in main) adding one test and a 47-line document under docs/ (rule 3). Main has its own test of the restored mask.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1257#issuecomment-7148675873) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Draft stacked on #298 (in main) adding one test and a 47-line document under docs/ (rule 3). Main has its own test of the restored mask. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1257
No description provided.