d3d12: mesh pipelines are rejected when the pixel program's literal sampler is missing from the root (204 in ProjectScarlett) #227

Open
opened 2026-11-26 12:52:05 +00:00 by github-bot · 5 comments
Owner

@⁠JeffreyBytes on GitHub · 2026-11-26 12:47 UTC · original

On main (d1112f9), ProjectScarlett 1.0.2.1 has 417 distinct mesh + pixel pipelines rejected with 0x80070057 between the Account Picker and the story loading screen (RX 6700 XT, RADV 26.3.1, GE-Proton11-14; the counts are identical run to run). I traced what they are. About half have one cause in the runtime, which I'm working on. I'm claiming that half here so nobody duplicates it.

What the 417 are

pipelines (creations) cause
204 (447) The pixel program uses a literal sampler state that no static sampler of the pipeline root matches. Details below.
210 (480) The pixel program has no translation at all (lane operations 78, PS attribute with no signature register 40, v128 spill 48, dynamic soffset 19, cube LOD clamp 18, other 7). The console pixel shader is then used and fails vkd3d_validate_mesh_shader_io_signatures. Not part of this claim.
3 (3) Not explained yet.

Attribution is from the pipeline failure record joined with the shader cache's refusal reasons and the recorded root signatures, not from the log: pipeline creation runs on a worker thread, so vkd3d's messages don't line up with TuxBox's.

The 204

The console builds a sampler from literal words, so a title can pair a pixel program with a root that doesn't hold that state. In all 204 the root has a static sampler at the register the program declares, but in a different state (border, linear), while the program builds an anisotropic wrap sampler from words.

  1. The translation against the pipeline root is refused: mimg … not a sampler descriptor (InlineWord).
  2. The mesh path falls back to the root-less translation, which reads its samplers from space 32765.
  3. Nothing adds those private samplers to a mesh pipeline's root, so vkd3d-proton rejects the pipeline: dxil-spirv: Failed to remap sampler 32765:0.

The vertex + pixel path already recovers from this by appending private static samplers (missing_literal_samplers in compute_table.rs, extended in #174). The mesh path (mesh_table::reflected) copies the title's static samplers and adds none.

The 204 pipelines come from 126 distinct pixel programs, each with one to three unmatched states.

What I have

A local change that, only when the pixel translation against the root is refused, rebuilds the mesh table with the unmatched literal states appended as private static samplers, to both the host root and the root the pixel stage is translated against, and keeps the result only if the retry translates. Pipelines that translate today are untouched.

On the RX 6700 XT, two runs: 0x80070057 rejections go from 417 to 213 distinct (930 to 483 creations), 126 new pixel variants are compiled, and no other failure count changes.

Before I open the PR

  • A Lanes scenario that fails without the change. So far there is only a unit test.
  • One design point I'd like an opinion on: the translator keys a sampler by its register alone, so the private samplers are placed on registers above every sampler register the root or the program names. With plain numbering from 0, 43 of the 126 programs refuse with "overlaps another space". If keying by register and space in the translator is preferred, say so and I'll look at that instead.
  • I can't judge the picture: every AMD run still ends at the page-remap device loss from #191 a couple of minutes in. A check on NVIDIA past the loading screen would be welcome once the PR is up.
**@⁠JeffreyBytes** on GitHub · 2026-11-26 12:47 UTC · [original](https://github.com/brcly/TuxBox/issues/227) On `main` (`d1112f9`), ProjectScarlett 1.0.2.1 has 417 distinct mesh + pixel pipelines rejected with `0x80070057` between the Account Picker and the story loading screen (RX 6700 XT, RADV 26.3.1, GE-Proton11-14; the counts are identical run to run). I traced what they are. About half have one cause in the runtime, which I'm working on. **I'm claiming that half here so nobody duplicates it.** ### What the 417 are | pipelines (creations) | cause | | --- | --- | | 204 (447) | The pixel program uses a literal sampler state that no static sampler of the pipeline root matches. Details below. | | 210 (480) | The pixel program has no translation at all (lane operations 78, PS attribute with no signature register 40, v128 spill 48, dynamic `soffset` 19, cube LOD clamp 18, other 7). The console pixel shader is then used and fails `vkd3d_validate_mesh_shader_io_signatures`. Not part of this claim. | | 3 (3) | Not explained yet. | Attribution is from the pipeline failure record joined with the shader cache's refusal reasons and the recorded root signatures, not from the log: pipeline creation runs on a worker thread, so vkd3d's messages don't line up with TuxBox's. ### The 204 The console builds a sampler from literal words, so a title can pair a pixel program with a root that doesn't hold that state. In all 204 the root has a static sampler at the register the program declares, but in a different state (border, linear), while the program builds an anisotropic wrap sampler from words. 1. The translation against the pipeline root is refused: `mimg … not a sampler descriptor (InlineWord)`. 2. The mesh path falls back to the root-less translation, which reads its samplers from space 32765. 3. Nothing adds those private samplers to a mesh pipeline's root, so vkd3d-proton rejects the pipeline: `dxil-spirv: Failed to remap sampler 32765:0`. The vertex + pixel path already recovers from this by appending private static samplers (`missing_literal_samplers` in `compute_table.rs`, extended in #174). The mesh path (`mesh_table::reflected`) copies the title's static samplers and adds none. The 204 pipelines come from 126 distinct pixel programs, each with one to three unmatched states. ### What I have A local change that, only when the pixel translation against the root is refused, rebuilds the mesh table with the unmatched literal states appended as private static samplers, to both the host root and the root the pixel stage is translated against, and keeps the result only if the retry translates. Pipelines that translate today are untouched. On the RX 6700 XT, two runs: `0x80070057` rejections go from 417 to 213 distinct (930 to 483 creations), 126 new pixel variants are compiled, and no other failure count changes. ### Before I open the PR - A Lanes scenario that fails without the change. So far there is only a unit test. - One design point I'd like an opinion on: the translator keys a sampler by its register alone, so the private samplers are placed on registers above every sampler register the root or the program names. With plain numbering from 0, 43 of the 126 programs refuse with "overlaps another space". If keying by register and space in the translator is preferred, say so and I'll look at that instead. - I can't judge the picture: every AMD run still ends at the page-remap device loss from #191 a couple of minutes in. A check on NVIDIA past the loading screen would be welcome once the PR is up.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:52:05 +00:00
Author
Owner

@⁠NickStallman on GitHub · 2026-11-26 12:53 UTC · original

Thanks for claiming the mesh half. To avoid duplicate work: I have an unopened branch that does the same thing for the other root kinds, NickStallman:fix/xshader-inline-literal-samplers (bfc1d7c, based on main before #216; it hasn't had a full GPU check yet).

  • dxbc::inline_sampler::unmatched lists each literal state that no static sampler visible to the stage has.
  • Those states go at registers of the private space 32765, after every sampler register the root uses. That's the same placement you describe, and I picked it for the same "overlaps another space" reason.
  • The reflected compute root and the multi-table raster root (after omitted) append them. xshader is unchanged.
  • In our cache, that group was the largest refusal: 452 requests with sN not a sampler descriptor (Some(InlineWord(N))), mostly programs that index the heap, which #174 skips.

Two options:

  • If the helper is useful for mesh_table::reflected, take it, and I'll open the compute/raster part separately on top of yours.
  • Or I open mine first and you build on it. Whichever you prefer.

Once your PR is up, I can run it on NVIDIA past the loading screen (RTX 5090, GE-Proton11-14).

**@⁠NickStallman** on GitHub · 2026-11-26 12:53 UTC · [original](https://github.com/brcly/TuxBox/issues/227#issuecomment-7192590600) Thanks for claiming the mesh half. To avoid duplicate work: I have an unopened branch that does the same thing for the other root kinds, `NickStallman:fix/xshader-inline-literal-samplers` (bfc1d7c, based on `main` before #216; it hasn't had a full GPU `check` yet). - `dxbc::inline_sampler::unmatched` lists each literal state that no static sampler visible to the stage has. - Those states go at registers of the private space 32765, after every sampler register the root uses. That's the same placement you describe, and I picked it for the same "overlaps another space" reason. - The reflected compute root and the multi-table raster root (after `omitted`) append them. xshader is unchanged. - In our cache, that group was the largest refusal: 452 requests with `sN not a sampler descriptor (Some(InlineWord(N)))`, mostly programs that index the heap, which #174 skips. Two options: - If the helper is useful for `mesh_table::reflected`, take it, and I'll open the compute/raster part separately on top of yours. - Or I open mine first and you build on it. Whichever you prefer. Once your PR is up, I can run it on NVIDIA past the loading screen (RTX 5090, GE-Proton11-14).
Author
Owner

@⁠JeffreyBytes on GitHub · 2026-11-26 13:11 UTC · original

Thanks, that's good timing. I fetched bfc1d7c and compared: your inline_sampler::unmatched and mine are the same idea with the same placement, down to the name, so there should only be one.

I'd go with your second option: please open yours first, and I'll build the mesh part on it.

  • Your helper is the more general one (it takes the stage and reads the program's own sites), and your change covers the larger group. Mine only needs a caller in mesh_table::reflected plus the retry in stream.rs.
  • I'll drop my copy of the helper and rebase onto your branch now, so the mesh PR can follow as soon as yours is up. One thing I'll check while doing that: mine also keeps the private registers above the sampler registers the pixel program itself declares, not only those the root uses. If the 126 mesh programs need that, I'll raise it on your PR instead of working around it.
  • I still owe a Lanes scenario for the mesh path and will add it to my PR.

I can run your branch on AMD in the meantime (RX 6700 XT, RADV 26.3.1): tuxbox.py check and the ProjectScarlett failure counts before and after. And yes please to the NVIDIA run past the loading screen once the mesh PR is up.

**@⁠JeffreyBytes** on GitHub · 2026-11-26 13:11 UTC · [original](https://github.com/brcly/TuxBox/issues/227#issuecomment-7192995602) Thanks, that's good timing. I fetched `bfc1d7c` and compared: your `inline_sampler::unmatched` and mine are the same idea with the same placement, down to the name, so there should only be one. I'd go with your second option: please open yours first, and I'll build the mesh part on it. - Your helper is the more general one (it takes the stage and reads the program's own sites), and your change covers the larger group. Mine only needs a caller in `mesh_table::reflected` plus the retry in `stream.rs`. - I'll drop my copy of the helper and rebase onto your branch now, so the mesh PR can follow as soon as yours is up. One thing I'll check while doing that: mine also keeps the private registers above the sampler registers the pixel program itself declares, not only those the root uses. If the 126 mesh programs need that, I'll raise it on your PR instead of working around it. - I still owe a Lanes scenario for the mesh path and will add it to my PR. I can run your branch on AMD in the meantime (RX 6700 XT, RADV 26.3.1): `tuxbox.py check` and the ProjectScarlett failure counts before and after. And yes please to the NVIDIA run past the loading screen once the mesh PR is up.
Author
Owner

@⁠NickStallman on GitHub · 2026-11-26 13:23 UTC · original

Sounds good. I'm rebasing it onto current main now: #216 added missing_literal_samplers for roots without 0x800, so the two need reconciling. Then the AMD and NVIDIA checks, and I'll open the PR and link it here. If the 126 mesh programs need the registers kept above the pixel program's own declared sampler registers, please raise it on the PR.

**@⁠NickStallman** on GitHub · 2026-11-26 13:23 UTC · [original](https://github.com/brcly/TuxBox/issues/227#issuecomment-7193283326) Sounds good. I'm rebasing it onto current `main` now: #216 added `missing_literal_samplers` for roots without 0x800, so the two need reconciling. Then the AMD and NVIDIA checks, and I'll open the PR and link it here. If the 126 mesh programs need the registers kept above the pixel program's own declared sampler registers, please raise it on the PR.
Author
Owner

@⁠JeffreyBytes on GitHub · 2026-11-26 13:38 UTC · original

AMD numbers for both parts together. I cherry-picked bfc1d7c onto main (c6ce497) and put the mesh change on top of it, using your unmatched as is. ProjectScarlett from the Account Picker to the story loading screen, RX 6700 XT, RADV 26.3.1, GE-Proton11-14, three runs with identical counts. Distinct pipelines, creations in parentheses:

kind main your commit + mesh commit
mesh + pixel 0x80070057 417 (930) 213 (483)
vertex + pixel stand-in 179 (346) 48 (75)
compute stand-in, driver compile failed 127 112
compute stand-in, not translated 136 136
mesh + pixel 0x80004001 / 0x80004005 184 / 29 184 / 29

The mesh number is the same as with my own helper, so yours covers it: all 126 pixel programs behind those pipelines translate, compile, and use only registers the extended root has. Your numbering differs from mine in 54 of them and none fail, so I have nothing to ask for on your side. The 131 vertex + pixel stand-ins and 15 compute failures that go away are from your commit alone.

Two notes for when you rebase onto main:

  • compute_table.rs conflicts with #216 in two places. In the compute root, main now has else if flags & 0x800 == 0 { missing_literal_samplers }; I kept that and fall back to unmatched when it returns nothing. In the sampler conversion I kept main's static_sampler helper and its heap_strides block.
  • unmatched returns None for a root with no static samplers, so the mesh retry skips such pipelines. None of the 204 are like that (they have 12 to 22), so it doesn't matter here.

On the Lanes scenario I promised: the mesh path only runs for a console mesh program, and nothing in the repo can produce one by hand (the translator accepts them only with their full launch and export code). The closest automated check would be a records-only console mesh container with a prepared replacement, plus a hand-written console pixel program with literal sampler words, which is a few hundred lines of fixture. I'll say that in the PR and leave it to @⁠brcly whether it is wanted.

The mesh commit is ready to go up as soon as your PR is open.

**@⁠JeffreyBytes** on GitHub · 2026-11-26 13:38 UTC · [original](https://github.com/brcly/TuxBox/issues/227#issuecomment-7193621699) AMD numbers for both parts together. I cherry-picked `bfc1d7c` onto `main` (`c6ce497`) and put the mesh change on top of it, using your `unmatched` as is. ProjectScarlett from the Account Picker to the story loading screen, RX 6700 XT, RADV 26.3.1, GE-Proton11-14, three runs with identical counts. Distinct pipelines, creations in parentheses: | kind | `main` | your commit + mesh commit | | --- | --- | --- | | mesh + pixel `0x80070057` | 417 (930) | 213 (483) | | vertex + pixel stand-in | 179 (346) | 48 (75) | | compute stand-in, driver compile failed | 127 | 112 | | compute stand-in, not translated | 136 | 136 | | mesh + pixel `0x80004001` / `0x80004005` | 184 / 29 | 184 / 29 | The mesh number is the same as with my own helper, so yours covers it: all 126 pixel programs behind those pipelines translate, compile, and use only registers the extended root has. Your numbering differs from mine in 54 of them and none fail, so I have nothing to ask for on your side. The 131 vertex + pixel stand-ins and 15 compute failures that go away are from your commit alone. Two notes for when you rebase onto `main`: - `compute_table.rs` conflicts with #216 in two places. In the compute root, `main` now has `else if flags & 0x800 == 0 { missing_literal_samplers }`; I kept that and fall back to `unmatched` when it returns nothing. In the sampler conversion I kept `main`'s `static_sampler` helper and its `heap_strides` block. - `unmatched` returns `None` for a root with no static samplers, so the mesh retry skips such pipelines. None of the 204 are like that (they have 12 to 22), so it doesn't matter here. On the Lanes scenario I promised: the mesh path only runs for a console mesh program, and nothing in the repo can produce one by hand (the translator accepts them only with their full launch and export code). The closest automated check would be a records-only console mesh container with a prepared replacement, plus a hand-written console pixel program with literal sampler words, which is a few hundred lines of fixture. I'll say that in the PR and leave it to @⁠brcly whether it is wanted. The mesh commit is ready to go up as soon as your PR is open.
Author
Owner

@⁠bbijsterbosch on GitHub · 2026-11-26 13:52 UTC · original

Hi guys, if you want to continue on shader compilition, maybe an idea that i start on shader and pipeline performance? Seems to me everything is way to slow to run the game atm. Or maybe its my hardware. Let me know what you think.

**@⁠bbijsterbosch** on GitHub · 2026-11-26 13:52 UTC · [original](https://github.com/brcly/TuxBox/issues/227#issuecomment-7193957800) Hi guys, if you want to continue on shader compilition, maybe an idea that i start on shader and pipeline performance? Seems to me everything is way to slow to run the game atm. Or maybe its my hardware. Let me know what you think.
This discussion has been locked. Commenting is limited to contributors.
No description provided.