D3D12.X: a console MS in the AS slot gets a mesh stand-in #738

Closed
abilliontokens wants to merge 3 commits from upstream-pr/743 into main
abilliontokens commented 2026-11-24 04:24:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by abilliontokens on 2026-11-24T04:24:58Z.


Stacked on #541 (head 24635db); only the top commit (8273a36) belongs here.

With #541, a pipeline stream with a console MS in the AS slot and no MS subobject is translated as a mesh pipeline. Its stand-in did not follow: fallback_stream still decided "mesh" from an MS subobject only. So it nulled the AS and kept a plain PS, a stream with no VS and no MS that the driver refuses with E_INVALIDARG (no stand-in pipeline (0x80070057), logged only 3 times). go_background then fell back to building each of those pipelines in the title's call. That serialised the title's pipeline-creating threads on DXC.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • console_ms holds the check mesh_shader_slots already made.
    • fallback_stream uses it: a console MS alone in the AS slot becomes an MS subobject with the stand-in MS (and the stand-in mesh PS).
    • Unit test the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader. It fails without the change (left: [(24, 0), (2, …)]: a null AS and the plain PS) and passes with it.

Tested

  • RTX 5060 Ti 16 GB (32-lane waves), driver 621.24; Ryzen 5 7600X; 32 GB RAM; Windows 11 26200; Rust 1.100.0; SDK DXC 1.8.2502.11. Tests in a debug build, title runs in a release build.
  • cargo test --workspace -- --test-threads=4 on 8273a36: 689 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title 1.0.2.1, cold DXIL cache, 240 s, XCL_NETWORK=0, the same scripted input (XCL_PRESS_AT), XCL_THREAD_DUMP_AT=20,40,70,110,160:
#541 head ce41f94 this change (a68ad44, same diff as fcfe511 before the rebase)
title threads inside dxc::compile (dev_create_pipeline_state → translated_mesh_stream) at the 5 dumps 5 at every dump 0 at every dump
DXC workers busy at the dumps 4–5 of 11 0 of 11
DXIL programs compiled in 240 s 2947 804 (the rest wait for their first bind, as other pipelines do)
translation_errors / failed_pipelines 0 / 0 0 / 0

Regression run
Main f4ce27c:

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 5060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2484 (PresentX 2484)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15473 MB

This PR 8273a36:

xcl-smoke v1
commit: 8273a369f37739512d4ee4e05d63325a83590ade
gpu: NVIDIA GeForce RTX 5060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2484 (PresentX 2484)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14701 MB

Not tested

  • AMD, and wave64 hardware.
  • Whether the minimap draws correctly: there was no visual check of it.
  • Three MS-in-AS pipelines during world loading (~180 s) still get no stand-in (0x80070057); the cause is not known yet, and this PR does not cover them.
  • With #541's 24635db (a moved MS deferred to the background path) in a run that reaches world loading: only the 90 s regression run was made on this head; the thread-dump table is from 3d7604b.
  • This change without #541 under it: on main these pipelines are refused before a stand-in is made, so the path is not reached.

AI use
Claude Code (Claude Opus 5.5) traced the stall from thread dumps, wrote the change and the test, ran the tests and runs above on my machine, and drafted this description.

<!-- greyfinch-sync:ivall/xcl:issue:6574586103 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/743). Originally posted by [abilliontokens](https://github.com/abilliontokens) on 2026-11-24T04:24:58Z. --- Stacked on #541 (head `24635db`); only the top commit (`8273a36`) belongs here. With #541, a pipeline stream with a console MS in the AS slot and no MS subobject is translated as a mesh pipeline. Its stand-in did not follow: `fallback_stream` still decided "mesh" from an MS subobject only. So it nulled the AS and kept a plain PS, a stream with no VS and no MS that the driver refuses with `E_INVALIDARG` (`no stand-in pipeline (0x80070057)`, logged only 3 times). `go_background` then fell back to building each of those pipelines in the title's call. That serialised the title's pipeline-creating threads on DXC. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: - `console_ms` holds the check `mesh_shader_slots` already made. - `fallback_stream` uses it: a console MS alone in the AS slot becomes an MS subobject with the stand-in MS (and the stand-in mesh PS). - Unit test `the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader`. It fails without the change (`left: [(24, 0), (2, …)]`: a null AS and the plain PS) and passes with it. **Tested** - RTX 5060 Ti 16 GB (32-lane waves), driver 621.24; Ryzen 5 7600X; 32 GB RAM; Windows 11 26200; Rust 1.100.0; SDK DXC 1.8.2502.11. Tests in a debug build, title runs in a release build. - `cargo test --workspace -- --test-threads=4` on `8273a36`: 689 passed, 0 failed, 41 ignored. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). - Retail title 1.0.2.1, cold DXIL cache, 240 s, `XCL_NETWORK=0`, the same scripted input (`XCL_PRESS_AT`), `XCL_THREAD_DUMP_AT=20,40,70,110,160`: | | #541 head `ce41f94` | this change (`a68ad44`, same diff as `fcfe511` before the rebase) | |---|---|---| | title threads inside `dxc::compile` (`dev_create_pipeline_state` → `translated_mesh_stream`) at the 5 dumps | 5 at every dump | 0 at every dump | | DXC workers busy at the dumps | 4–5 of 11 | 0 of 11 | | DXIL programs compiled in 240 s | 2947 | 804 (the rest wait for their first bind, as other pipelines do) | | `translation_errors` / `failed_pipelines` | 0 / 0 | 0 / 0 | **Regression run** Main `f4ce27c`: ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 5060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2484 (PresentX 2484) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15473 MB ``` This PR `8273a36`: ``` xcl-smoke v1 commit: 8273a369f37739512d4ee4e05d63325a83590ade gpu: NVIDIA GeForce RTX 5060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2484 (PresentX 2484) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14701 MB ``` **Not tested** - AMD, and wave64 hardware. - Whether the minimap draws correctly: there was no visual check of it. - Three MS-in-AS pipelines during world loading (~180 s) still get no stand-in (`0x80070057`); the cause is not known yet, and this PR does not cover them. - With #541's `24635db` (a moved MS deferred to the background path) in a run that reaches world loading: only the 90 s regression run was made on this head; the thread-dump table is from `3d7604b`. - This change without #541 under it: on `main` these pipelines are refused before a stand-in is made, so the path is not reached. **AI use** Claude Code (Claude Opus 5.5) traced the stall from thread dumps, wrote the change and the test, ran the tests and runs above on my machine, and drafted this description.
upstream-sync closed this pull request 2026-11-24 06:59:46 +00:00
crosettiremi commented 2026-11-24 07:06:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crosettiremi on 2026-11-24T04:40:27Z.


Radeon RX 7900 XT / Windows 11 build 26100 / SDK DXC 1.9.2602.17. I tested #541 + #743 (8273a36) with the stand-in target/depth format fix from the #541 discussion, in a local Series S integration build. Same saved profile, A at 37 s and independent copies of the same starting application caches in both runs.

Result Before mesh changes With mesh changes
Recorded shader translation errors 40, all lone console MS in the AS slot 0
Presents 1,718 1,755
Stand-in draws 622 1,709
Device removals 0 0

Both runs showed the account picker and loading artwork. Both eventually crashed during world loading at different title instructions. These totals cover different run lengths. This confirms the reported AS-slot refusal disappeared on this adapter. Playable world rendering remains unverified, and this comparison includes the linked depth-format change.

The integration workspace reported 737 passed, 0 failed, 41 ignored. Both the shader slot and PC target-format regressions passed. One counted pass skipped at runtime because xgameruntime.dll was unavailable for the debug-layer draw test.

Codex (GPT-6) ran the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7122234214 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/743#issuecomment-7122234214). Originally posted by [crosettiremi](https://github.com/crosettiremi) on 2026-11-24T04:40:27Z. --- Radeon RX 7900 XT / Windows 11 build 26100 / SDK DXC 1.9.2602.17. I tested #541 + #743 (`8273a36`) with the stand-in target/depth format fix from [the #541 discussion](https://github.com/ivall/xcl/pull/541#issuecomment-7122058140), in a local Series S integration build. Same saved profile, A at 37 s and independent copies of the same starting application caches in both runs. | Result | Before mesh changes | With mesh changes | | --- | ---: | ---: | | Recorded shader translation errors | 40, all lone console MS in the AS slot | 0 | | Presents | 1,718 | 1,755 | | Stand-in draws | 622 | 1,709 | | Device removals | 0 | 0 | Both runs showed the account picker and loading artwork. Both eventually crashed during world loading at different title instructions. These totals cover different run lengths. This confirms the reported AS-slot refusal disappeared on this adapter. Playable world rendering remains unverified, and this comparison includes the linked depth-format change. The integration workspace reported 737 passed, 0 failed, 41 ignored. Both the shader slot and PC target-format regressions passed. One counted pass skipped at runtime because xgameruntime.dll was unavailable for the debug-layer draw test. Codex (GPT-6) ran the tests and drafted this report.
JoaoPauluu commented 2026-11-24 07:06:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T04:41:41Z.


Test report: #743 under Wine (Linux, NVIDIA): GTA VI's refused mesh pipelines are gone on vkd3d-proton

Mesh shaders under Wine go DXC → DXIL → vkd3d-proton's dxil-spirv → VK_EXT_mesh_shader on NVIDIA's Vulkan driver. On this PR's head (which includes #541), GTA VI's 40 refused mesh pipelines are no longer refused, nothing fails to build, and the title runs a little faster than on main.

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXC 1.9.2609, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0); debug for the tests, release for the runs
  • Commits: this PR's head 8273a36 (with #541 under it) and main 64b3f35

Unit tests (lib test binary under Wine, filter mesh_slot_tests): 3 passed, 0 failed, in 2 of 2 runs, including the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader. A first run without XCL_DXC_DIR set printed SKIPPED … no DXC; that was my setup, not the test.

GTA VI 1.0.2.1 (my own dump; 60 s runs with scripts/linux/smoke.sh from #257, XCL_NETWORK=0, alternating base / PR / PR / base, warm DXIL and vkd3d-proton caches from earlier runs)

build frames shown … mesh pipeline with its MS … in the AS slot – refused draws removals / crashes
64b3f35 969, 970 40, 40 12387, 12344 0 / 0
8273a36 1030, 1028 0, 0 12621, 12543 0 / 0
  • Neither build logs no stand-in pipeline (…) or stand-in mesh shaders: …, so here the stand-ins were built (or weren't needed with warm caches; the log doesn't say which).
  • One difference I didn't look into: the main runs log the pipelines of N shader sets an earlier run used are built ahead of their first use and N pipelines built ahead of their first use, and the PR runs don't. So the two builds may not have started with the same prebuilt pipelines. The PR still shows more frames.
xcl-smoke v1
commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 969 (PresentX 969)
presents per 2 s (last 3): 47 33 0
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: 8273a369f37739512d4ee4e05d63325a83590ade
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1030 (PresentX 1030)
presents per 2 s (last 3): 42 44 60
device removals: 0
crashes: 0
peak commit: 0 MB

(The first pair. peak commit: 0 MB is XCL reading 0 MB committed under Wine, see #257.)

Not tested

  • Windows (covered in the description), AMD; a cold DXIL cache and the 240 s scripted run of the description; the rest of the suite on this branch; #541 on its own; the picture (and so whether the mesh draws look right)

AI use: Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks, counts and log lines are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

<!-- greyfinch-sync:ivall/xcl:comment:7122252620 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/743#issuecomment-7122252620). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T04:41:41Z. --- ### Test report: #743 under Wine (Linux, NVIDIA): GTA VI's refused mesh pipelines are gone on vkd3d-proton Mesh shaders under Wine go DXC → DXIL → vkd3d-proton's dxil-spirv → `VK_EXT_mesh_shader` on NVIDIA's Vulkan driver. On this PR's head (which includes #541), GTA VI's 40 refused mesh pipelines are no longer refused, nothing fails to build, and the title runs a little faster than on `main`. **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 (`4522cc1a`) + the patch from #257, DXVK from Proton, DXC 1.9.2609, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0); debug for the tests, release for the runs - Commits: this PR's head `8273a36` (with #541 under it) and `main` `64b3f35` **Unit tests** (lib test binary under Wine, filter `mesh_slot_tests`): 3 passed, 0 failed, in 2 of 2 runs, including `the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader`. A first run without `XCL_DXC_DIR` set printed `SKIPPED … no DXC`; that was my setup, not the test. **GTA VI 1.0.2.1** (my own dump; 60 s runs with `scripts/linux/smoke.sh` from #257, `XCL_NETWORK=0`, alternating base / PR / PR / base, warm DXIL and vkd3d-proton caches from earlier runs) | build | frames shown | `… mesh pipeline with its MS … in the AS slot – refused` | draws | removals / crashes | |---|---|---|---|---| | `64b3f35` | 969, 970 | 40, 40 | 12387, 12344 | 0 / 0 | | `8273a36` | 1030, 1028 | 0, 0 | 12621, 12543 | 0 / 0 | - Neither build logs `no stand-in pipeline (…)` or `stand-in mesh shaders: …`, so here the stand-ins were built (or weren't needed with warm caches; the log doesn't say which). - One difference I didn't look into: the `main` runs log `the pipelines of N shader sets an earlier run used are built ahead of their first use` and `N pipelines built ahead of their first use`, and the PR runs don't. So the two builds may not have started with the same prebuilt pipelines. The PR still shows more frames. ``` xcl-smoke v1 commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 969 (PresentX 969) presents per 2 s (last 3): 47 33 0 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: 8273a369f37739512d4ee4e05d63325a83590ade gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1030 (PresentX 1030) presents per 2 s (last 3): 42 44 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` (The first pair. `peak commit: 0 MB` is XCL reading 0 MB committed under Wine, see #257.) **Not tested** - Windows (covered in the description), AMD; a cold DXIL cache and the 240 s scripted run of the description; the rest of the suite on this branch; #541 on its own; the picture (and so whether the mesh draws look right) **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks, counts and log lines are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
ethandepstein-del commented 2026-11-24 07:06:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ethandepstein-del on 2026-11-24T04:45:28Z.


Code audit + NVIDIA RTX 5080 test run on 8273a369f37739512d4ee4e05d63325a83590ade:

Review

Looks clean — rewriting subobject tag 24 (AS) in-place to 25 (MS) with the dummy mesh shader bytecode when ms_in_as is true cleanly resolves the stand-in E_INVALIDARG refusal on console MS-in-AS-slot pipelines.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 689 passed, 0 failed, 41 ignored.
  • New tests mesh_split_accounts_vertex_chunks, mesh_layout_independent_of_group_count, a_console_ms_in_the_as_slot_is_the_mesh_shader, a_moved_ms_defers_in_the_attempt_only, the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader: all 5 passed.
  • SKIPPED GPU tests (2, wave32-only adapter): gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu_wave32_program_in_wave64_hardware: no wave64.

Not tested

  • Retail title / scripts/smoke.ps1 run (test suite only); AMD / Intel GPUs.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

<!-- greyfinch-sync:ivall/xcl:comment:7122310335 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/743#issuecomment-7122310335). Originally posted by [ethandepstein-del](https://github.com/ethandepstein-del) on 2026-11-24T04:45:28Z. --- Code audit + NVIDIA RTX 5080 test run on `8273a369f37739512d4ee4e05d63325a83590ade`: ### Review Looks clean — rewriting subobject tag `24` (`AS`) in-place to `25` (`MS`) with the dummy mesh shader bytecode when `ms_in_as` is true cleanly resolves the stand-in `E_INVALIDARG` refusal on console MS-in-AS-slot pipelines. ### Tested - Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), `rustc 1.100.0` (MSVC), debug build. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: **689 passed, 0 failed, 41 ignored**. - New tests `mesh_split_accounts_vertex_chunks`, `mesh_layout_independent_of_group_count`, `a_console_ms_in_the_as_slot_is_the_mesh_shader`, `a_moved_ms_defers_in_the_attempt_only`, `the_stand_in_of_a_console_ms_in_the_as_slot_has_a_mesh_shader`: **all 5 passed**. - `SKIPPED` GPU tests (2, wave32-only adapter): `gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu_wave32_program_in_wave64_hardware: no wave64`. ### Not tested - Retail title / `scripts/smoke.ps1` run (test suite only); AMD / Intel GPUs. *AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.*

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
xcl-dev/xcl!738
No description provided.