d3d12: a pipeline stream the PC numbering cannot read is read with the console's, its 24 the mesh shader (D3D-CONSOLE-STREAM-ENUM) #496

Closed
Kokonotcu wants to merge 1 commit from upstream-pr/496 into main
Kokonotcu commented 2026-11-24 06:27:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kokonotcu on 2026-11-24T06:27:31Z.


Claim: D3D-CONSOLE-STREAM-ENUM (#14).

What was wrong: the console's pipeline-state subobject enum has no gap at 23, where the PC's has one. The PC numbering is VIEW_INSTANCING 22, AS 24, MS 25, DEPTH_STENCIL2 26, and so on. As a result, the title's mesh-shader subobject is 24, which the PC reading takes for an amplification shader. The layer refuses an AS, so those PSOs fail as unsupported.

docs/retail_boot_intel_host.md section 3 measured this in a retail boot: 430 such PSOs were refused, and each one's 24 carried a payload the size of one of the title's mesh-shader containers (430 of 430; 280 of those sizes match no vertex shader, against the VS reading proposed on the old repository's issue 8815). The translator makes 9,282 of the title's 26,503 shaders mesh shaders.

What changed: CreatePipelineState reads a stream again with the console numbering (a type from 23 on is the PC type one above it) when either:

  • the PC reading refuses it, or
  • the PC reading leaves it with an AS and no MS, which is no valid PC stream.

It takes the console reading only when that reading holds an MS and no AS. A stream the PC reading accepts is never read differently, so no PSO that builds today changes. LEONIDA_XS_STREAM_ENUM=pc turns it off. The first renumbered stream is logged once.

What this assumes beyond the measurement: that the console shifts every type from 23 on, not only the mesh shader. Only 24 is measured. The shift of 25 and up is the reading under which a 24 = MS is consistent; it is used only for streams that fail today anyway.

Tests (d3d12_mesh_test, new checks):

  • A console stream with the MS as 24 makes a mesh PSO.
  • So does the MS as 24 with RASTERIZER1 as 26 (the PC reading refuses that one as a truncated DEPTH_STENCIL2).
  • An MS (25) with a 24 in PC numbering is still refused as an AS.
  • The existing 9 invalid and 2 not-implemented refusals are unchanged, and the draws still match all 4096 pixels.

Tested on Windows 10, i7-11800H, RTX 3080 Laptop (NVIDIA driver), on main 8f481cf16: d3d12_mesh passes. Not yet tested on a retail boot.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467273617 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/496). Originally posted by [Kokonotcu](https://github.com/Kokonotcu) on 2026-11-24T06:27:31Z. --- Claim: D3D-CONSOLE-STREAM-ENUM (#14). **What was wrong:** the console's pipeline-state subobject enum has no gap at 23, where the PC's has one. The PC numbering is VIEW_INSTANCING 22, AS 24, MS 25, DEPTH_STENCIL2 26, and so on. As a result, the title's mesh-shader subobject is 24, which the PC reading takes for an amplification shader. The layer refuses an AS, so those PSOs fail as unsupported. `docs/retail_boot_intel_host.md` section 3 measured this in a retail boot: 430 such PSOs were refused, and each one's 24 carried a payload the size of one of the title's mesh-shader containers (430 of 430; 280 of those sizes match no vertex shader, against the VS reading proposed on the old repository's issue 8815). The translator makes 9,282 of the title's 26,503 shaders mesh shaders. **What changed:** `CreatePipelineState` reads a stream again with the console numbering (a type from 23 on is the PC type one above it) when either: - the PC reading refuses it, or - the PC reading leaves it with an AS and no MS, which is no valid PC stream. It takes the console reading only when that reading holds an MS and no AS. A stream the PC reading accepts is never read differently, so no PSO that builds today changes. `LEONIDA_XS_STREAM_ENUM=pc` turns it off. The first renumbered stream is logged once. What this assumes beyond the measurement: that the console shifts every type from 23 on, not only the mesh shader. Only 24 is measured. The shift of 25 and up is the reading under which a 24 = MS is consistent; it is used only for streams that fail today anyway. **Tests (`d3d12_mesh_test`, new checks):** - A console stream with the MS as 24 makes a mesh PSO. - So does the MS as 24 with RASTERIZER1 as 26 (the PC reading refuses that one as a truncated DEPTH_STENCIL2). - An MS (25) with a 24 in PC numbering is still refused as an AS. - The existing 9 invalid and 2 not-implemented refusals are unchanged, and the draws still match all 4096 pixels. Tested on Windows 10, i7-11800H, RTX 3080 Laptop (NVIDIA driver), on `main` `8f481cf16`: `d3d12_mesh` passes. Not yet tested on a retail boot. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
towade commented 2026-11-24 13:33:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by towade on 2026-11-24T13:33:32Z.


The retail-boot test the description lists as not done, on Windows 11 26300, MSVC 19.44, own 1.0.2.1 copy, AMD Radeon RX 9070 XT (RDNA4, 32.0.32029.2010): pass.

Base: #321 at e0d4fd2b8 + #511 (LEONIDA_LAZY_PSO=1, LEONIDA_ARENA_MB=2048, so the boot gets past the up-front PSOs on AMD) + #588 (format 118), all cherry-picked, --trace --trace-d3d12, the executable's network blocked. Then this PR's 30dd1a450 on top (no conflict). Counts only.

without this PR with it
amplification shaders are not supported (the game has none) lines 98 (distinct sizes) 0
CreatePipelineState unsupported 1,443 615
D3D12 calls up to the run's end (the title's int3, unchanged) 84,737 84,657

The runtime logs a pipeline stream the PC numbering cannot read ... is read with the console's subobject numbering (its 24 is the mesh shader) once, and no PSO the run made before fails now (failed stays at 2). The remaining 615 refusals are not this PR's: most are pipeline-library compute programs my work folder doesn't have translated (1,538 of 2,684), the rest the rectangle-list/#511 interaction I described on #511.

d3d12_mesh_test: passes on the RX 9070 XT; on an Intel UHD 770 it exits 77 (no VK_EXT_mesh_shader), as expected.

Not checked: whether the renumbered streams draw correctly (the run doesn't get far enough into frames to tell).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7133002704 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7133002704). Originally posted by [towade](https://github.com/towade) on 2026-11-24T13:33:32Z. --- The retail-boot test the description lists as not done, on Windows 11 26300, MSVC 19.44, own 1.0.2.1 copy, AMD Radeon RX 9070 XT (RDNA4, 32.0.32029.2010): **pass**. **Base:** #321 at `e0d4fd2b8` + #511 (`LEONIDA_LAZY_PSO=1`, `LEONIDA_ARENA_MB=2048`, so the boot gets past the up-front PSOs on AMD) + #588 (format 118), all cherry-picked, `--trace --trace-d3d12`, the executable's network blocked. Then this PR's `30dd1a450` on top (no conflict). Counts only. | | without this PR | with it | |---|---:|---:| | `amplification shaders are not supported (the game has none)` lines | 98 (distinct sizes) | **0** | | `CreatePipelineState` `unsupported` | 1,443 | **615** | | D3D12 calls up to the run's end (the title's `int3`, unchanged) | 84,737 | 84,657 | The runtime logs `a pipeline stream the PC numbering cannot read ... is read with the console's subobject numbering (its 24 is the mesh shader)` once, and no PSO the run made before fails now (`failed` stays at 2). The remaining 615 refusals are not this PR's: most are pipeline-library compute programs my work folder doesn't have translated (1,538 of 2,684), the rest the rectangle-list/#511 interaction I described on #511. **`d3d12_mesh_test`:** passes on the RX 9070 XT; on an Intel UHD 770 it exits 77 (no `VK_EXT_mesh_shader`), as expected. Not checked: whether the renumbered streams draw correctly (the run doesn't get far enough into frames to tell). AI-assisted (Claude Code).
otaviosza commented 2026-11-24 15:39:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by otaviosza on 2026-11-24T15:39:09Z.


Tested on native Windows: Windows 10 22H2 (19045), NVIDIA GeForce RTX 3060, driver 610.88 (32.0.16.1088), MSVC 19.44, own 1.0.2.1 copy, LEONIDA_D3D12=vulkan, LEONIDA_LAZY_PSO=1. Runtime = #321 + #470 + #588 + #461 + #511 + this PR (cherry-picked cleanly); shaders built with main + #387 + #583 + #674 + #647 + #593.

  • Without this PR the log has four amplification shaders are not supported (the game has none) refusals (stream payloads 2580–2796 bytes) shortly before the run ends.
  • With it, those refusals are gone and the log shows the fallback once: a pipeline stream the PC numbering cannot read (an AS and no MS, or refused) is read with the console's subobject numbering (its 24 is the mesh shader). No other new failure.
  • The run still ends at about 15 s with the same title-side access violation as without the PR, so that stop is not caused by these refused mesh PSOs (details in #14).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7136385651 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7136385651). Originally posted by [otaviosza](https://github.com/otaviosza) on 2026-11-24T15:39:09Z. --- Tested on native Windows: Windows 10 22H2 (19045), NVIDIA GeForce RTX 3060, driver 610.88 (32.0.16.1088), MSVC 19.44, own 1.0.2.1 copy, `LEONIDA_D3D12=vulkan`, `LEONIDA_LAZY_PSO=1`. Runtime = #321 + #470 + #588 + #461 + #511 + this PR (cherry-picked cleanly); shaders built with `main` + #387 + #583 + #674 + #647 + #593. - Without this PR the log has four `amplification shaders are not supported (the game has none)` refusals (stream payloads 2580–2796 bytes) shortly before the run ends. - With it, those refusals are gone and the log shows the fallback once: `a pipeline stream the PC numbering cannot read (an AS and no MS, or refused) is read with the console's subobject numbering (its 24 is the mesh shader)`. No other new failure. - The run still ends at about 15 s with the same title-side access violation as without the PR, so that stop is not caused by these refused mesh PSOs (details in #14).
Snooozs commented 2026-11-24 17:01:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T17:01:53Z.


Independent check. Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, LEONIDA_VK_VALIDATION=1, merged onto main 82a2aabcc without conflicts, test targets rebuilt; RTX 5060 Ti (621.01) and a Ryzen 7 7700 iGPU (1002:164E, AMD 31.0.22044.1). On the iGPU the pipeline tests fail on plain main too (128 push-constant bytes), so they say nothing there.

  • RTX 5060 Ti: d3d12_mesh_test passes on main and with this PR, with the new line console-numbered streams: 2 mesh PSOs (MS as 24, RASTERIZER1 as 26); 0 VUID lines.

Reading note: the comment above parse_pipeline_stream says the console numbering is used "only for a stream the PC reading leaves with an AS and no MS", but CreatePipelineState also retries any stream the PC reading refuses (FAILED(parsed)), as its own comment says. The second reading must still hold an MS and no AS, so I see no valid PC stream changing, but the first comment should say it.

Synthetic tests only, no game files. AI-assisted (Claude Code): I read the diff and ran the tests on that machine.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7138578377 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7138578377). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-24T17:01:53Z. --- Independent check. Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, `LEONIDA_VK_VALIDATION=1`, merged onto `main` 82a2aabcc without conflicts, test targets rebuilt; RTX 5060 Ti (621.01) and a Ryzen 7 7700 iGPU (1002:164E, AMD 31.0.22044.1). On the iGPU the pipeline tests fail on plain `main` too (128 push-constant bytes), so they say nothing there. - RTX 5060 Ti: `d3d12_mesh_test` passes on `main` and with this PR, with the new line `console-numbered streams: 2 mesh PSOs (MS as 24, RASTERIZER1 as 26)`; 0 VUID lines. Reading note: the comment above `parse_pipeline_stream` says the console numbering is used "only for a stream the PC reading leaves with an AS and no MS", but `CreatePipelineState` also retries any stream the PC reading refuses (`FAILED(parsed)`), as its own comment says. The second reading must still hold an MS and no AS, so I see no valid PC stream changing, but the first comment should say it. Synthetic tests only, no game files. AI-assisted (Claude Code): I read the diff and ran the tests on that machine.
MoonEyes commented 2026-11-27 23:19:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:19:54Z.


Hi @Kokonotcu, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/d3d12_vulkan_device.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230057170 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/496#issuecomment-7230057170). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:19:54Z. --- Hi @Kokonotcu, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/d3d12_vulkan_device.cpp`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
DadaCap commented 2026-11-28 10:34:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:34:19Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: superseded by main.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237983045 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/496#issuecomment-7237983045). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:34:19Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: superseded by main. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!496
No description provided.