Corpus census: 185 emitted DXIL modules fail dxil.dll validation #201

Open
opened 2026-11-26 03:54:24 +00:00 by github-bot · 18 comments
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 01:23 UTC · original

Summary

I ran victory translate --validate --pipelines --list over the 26,503 DXBC containers extracted from my own 1.0.2.1 copy, on main 97c78d1 + the Agility exports from #84 (RTX 4080, driver 621.01). AI-assisted (Claude); I ran the translation and grouped the results myself.

All 26,084 programs translate. DXIL is emitted for 12,272 / 14,001 VS/PS, 1,685 / 2,581 compute and 8,191 / 8,506 mesh. 185 of the emitted modules fail validation with dxil.dll 1.8.2502 (from Windows SDK 10.0.26100):

Stage Validator failures
Pixel 68
Mesh 62
Vertex 32
Compute 23

Grouped by reason:

  • 53 — vertex plus primitive output size is greater than 32768 (mesh)
  • 49 — interpolation modes disagree between elements packed into the same signature row
  • 46 — Container part 'Program Input/Output Signature' does not match expected for module (25 output, 21 input)
  • 23 — Entry function performs some operation that is incompatible with the shader stage (compute)
  • 14 — PS input position interpolation must be linear_noperspective_centroid / sample when writing oDepthGE / oDepthLE

Notably, the D3D12 runtime still created host pipelines for all of the VS/PS and mesh modules: 12,272/12,272 VS/PS and 8,191/8,191 mesh. So these are validator rejections, not driver rejections, and the game may still be fine with them. I haven't checked whether any of the 185 are among the shaders actually bound in my runs. The full per-shader output is too large to post, but I can extract any specific group.

For contrast, the driver's refusals are a separate matter: 321 compute pipelines with E_INVALIDARG, cross-tabulated in my #71 comment.

**@⁠Proudnoob4** on GitHub · 2026-11-24 01:23 UTC · [original](https://github.com/Marvisak/VIctory/issues/201) ### Summary I ran `victory translate --validate --pipelines --list` over the 26,503 DXBC containers extracted from my own 1.0.2.1 copy, on main `97c78d1` + the Agility exports from #84 (RTX 4080, driver 621.01). AI-assisted (Claude); I ran the translation and grouped the results myself. All 26,084 programs translate. DXIL is emitted for 12,272 / 14,001 VS/PS, 1,685 / 2,581 compute and 8,191 / 8,506 mesh. **185 of the emitted modules fail validation** with `dxil.dll` 1.8.2502 (from Windows SDK 10.0.26100): | Stage | Validator failures | |---|---:| | Pixel | 68 | | Mesh | 62 | | Vertex | 32 | | Compute | 23 | Grouped by reason: - 53 — `vertex plus primitive output size is greater than 32768` (mesh) - 49 — interpolation modes disagree between elements packed into the same signature row - 46 — `Container part 'Program Input/Output Signature' does not match expected for module` (25 output, 21 input) - 23 — `Entry function performs some operation that is incompatible with the shader stage` (compute) - 14 — PS input position interpolation must be `linear_noperspective_centroid` / `sample` when writing `oDepthGE` / `oDepthLE` Notably, the D3D12 runtime still created host pipelines for **all** of the VS/PS and mesh modules: 12,272/12,272 VS/PS and 8,191/8,191 mesh. So these are validator rejections, not driver rejections, and the game may still be fine with them. I haven't checked whether any of the 185 are among the shaders actually bound in my runs. The full per-shader output is too large to post, but I can extract any specific group. For contrast, the driver's refusals are a separate matter: 321 compute pipelines with `E_INVALIDARG`, cross-tabulated in [my #71 comment](https://git.gtahub.st/github/Marvisak--VIctory/issues/71).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:54:24 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 02:03 UTC · original

Ran the synthetic shader suite against a real validator to see which groups reproduce on current main (d2a4bae):

  • Environment: Windows build under Wine 11.22, VICTORY_DXIL pointing at dxil.dll 1.8.2502, cargo test -p victory-shader with --test-threads=1.
  • Result: 68 passed, 1 failed. The failure is emit::tests::stub_pipeline_is_created, and only because vkd3d-proton accepts a zeroed container digest (the digest-rejection check); it is not a translator/validator failure.
  • emit::tests::constant_color_validates passes, so the validator is actually loaded and validating (no "no dxil.dll; skipped" message).

One code observation on the groups:

  • The 14 PS input position interpolation must be linear_noperspective_centroid / sample failures: emit/mod.rs already sets every pixel-shader position input (kind == 3) to interpolation mode 4 ((3, _) => 4, present since the initial import, before the census commit). So either those modules' position is not kind == 3, or the failure comes from a row that mixes modes (the same shape as the 49 "interpolation modes disagree" group).
  • The 49 and 46 groups look like the packed-row/signature area #176 is working on, so I would not duplicate that.

To reproduce the remaining unowned groups synthetically (53 mesh output size, 23 compute stage-incompatible ops, and the 14 if they persist), could you share the signature layout of one failing module — semantic names, kinds, rows/cols, component types, interpolation — rather than the shader bytes? That is enough to build the same container layout in a test and validate it. With victory translate --validate --list you can also tell whether the 14/46/49 groups still occur on d2a4bae; the census was on 97c78d1.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 02:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7119715204) Ran the synthetic shader suite against a real validator to see which groups reproduce on current `main` (`d2a4bae`): - Environment: Windows build under Wine 11.22, `VICTORY_DXIL` pointing at **dxil.dll 1.8.2502**, `cargo test -p victory-shader` with `--test-threads=1`. - Result: **68 passed, 1 failed**. The failure is `emit::tests::stub_pipeline_is_created`, and only because vkd3d-proton accepts a zeroed container digest (the digest-rejection check); it is not a translator/validator failure. - `emit::tests::constant_color_validates` **passes**, so the validator is actually loaded and validating (no "no dxil.dll; skipped" message). One code observation on the groups: - The 14 `PS input position interpolation must be linear_noperspective_centroid / sample` failures: `emit/mod.rs` already sets every pixel-shader position input (`kind == 3`) to interpolation mode **4** (`(3, _) => 4`, present since the initial import, before the census commit). So either those modules' position is not `kind == 3`, or the failure comes from a **row** that mixes modes (the same shape as the 49 "interpolation modes disagree" group). - The 49 and 46 groups look like the packed-row/signature area **#176** is working on, so I would not duplicate that. To reproduce the remaining unowned groups synthetically (53 mesh output size, 23 compute stage-incompatible ops, and the 14 if they persist), could you share the **signature layout of one failing module** — semantic names, kinds, rows/cols, component types, interpolation — rather than the shader bytes? That is enough to build the same container layout in a test and validate it. With `victory translate --validate --list` you can also tell whether the 14/46/49 groups still occur on `d2a4bae`; the census was on `97c78d1`. No game data used.
Author
Owner

@⁠AnoHunted on GitHub · 2026-11-24 03:44 UTC · original

#459 addresses the 53 mesh modules in the "vertex plus primitive output size is greater than 32768" group. It measures the outputs the way dxil.dll does, and lowers the declared maxima to the lane count when they don't fit. Each lane writes only its own vertex and primitive, so nothing the shader writes is lost. A module that still doesn't fit at the lane count is emitted as before, so no draw is dropped. Its synthetic tests pass dxil.dll (DXC 1.9.2609) validation.

If you rerun the census with #459 on top, I'd be glad to know how the 53 split between "now valid" and "still over at the lane count". I can't measure that without the corpus.

AI-assisted (Claude Code). No game files.

**@⁠AnoHunted** on GitHub · 2026-11-24 03:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7121380045) #459 addresses the 53 mesh modules in the "vertex plus primitive output size is greater than 32768" group. It measures the outputs the way `dxil.dll` does, and lowers the declared maxima to the lane count when they don't fit. Each lane writes only its own vertex and primitive, so nothing the shader writes is lost. A module that still doesn't fit at the lane count is emitted as before, so no draw is dropped. Its synthetic tests pass `dxil.dll` (DXC 1.9.2609) validation. If you rerun the census with #459 on top, I'd be glad to know how the 53 split between "now valid" and "still over at the lane count". I can't measure that without the corpus. AI-assisted (Claude Code). No game files.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 04:29 UTC · original

The compute group of this census (23 modules, Entry function performs some operation that is incompatible with the shader stage) now has a cause and an open fix.

  • Common factor. A whole-title translate --validate run on the #233 stack found 43 compute modules with this message, and all 43 call sample. (More than 23 because that stack lets more compute programs translate; main has 23, as in this census.)
  • Cause, reproduced with a hand-assembled compute program: a compute program's image_sample is emitted as dx.op.sample, the modules declare validator version 1.6, and under 1.6 / 1.7 rules that operation is not allowed outside pixel shaders. It fails in every thread-group shape and with every wave size. The validator's second line, which translate does not print, is Function uses features incompatible with the shader stage (cs) of the entry function.
  • Fix. #180 replaces these samples with sampleGrad from quad gradients. #306's description lists a compute implicit-derivative fix too; I have not compared the two.
  • Why it may matter in the title. One of these modules (c4183d3cbee28e8e) is the one compute pipeline an older NVIDIA driver refused, right after a first-chance exception in its shader compiler, in this run. That the invalid module is the reason is the simplest reading, not proven.

If you rerun the census, two things would close this group:

  1. With #180 on top: does the compute group go to 0, and does any module that validated before stop validating?
  2. #439's head (e49302a) makes translate --validate add to each validator failure what the emitted module declares and calls (thread-group size, wave size, its dx.op operations; nothing of the console program). That line is what found the common factor above in one run, and it may sort the other groups the same way.

No game data used on my side. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 04:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7122070152) The compute group of this census (23 modules, `Entry function performs some operation that is incompatible with the shader stage`) now has a cause and an open fix. - **Common factor.** A whole-title `translate --validate` run on the #233 stack found 43 compute modules with this message, and [all 43 call `sample`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233). (More than 23 because that stack lets more compute programs translate; `main` has 23, as in this census.) - **Cause**, [reproduced with a hand-assembled compute program](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233): a compute program's `image_sample` is emitted as `dx.op.sample`, the modules declare validator version 1.6, and under 1.6 / 1.7 rules that operation is not allowed outside pixel shaders. It fails in every thread-group shape and with every wave size. The validator's second line, which `translate` does not print, is `Function uses features incompatible with the shader stage (cs) of the entry function.` - **Fix.** #180 replaces these samples with `sampleGrad` from quad gradients. #306's description lists a compute implicit-derivative fix too; I have not compared the two. - **Why it may matter in the title.** One of these modules (`c4183d3cbee28e8e`) is the one compute pipeline an older NVIDIA driver refused, right after a first-chance exception in its shader compiler, in [this run](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233). That the invalid module is the reason is the simplest reading, not proven. If you rerun the census, two things would close this group: 1. With #180 on top: does the compute group go to 0, and does any module that validated before stop validating? 2. #439's head (`e49302a`) makes `translate --validate` add to each validator failure what the emitted module declares and calls (thread-group size, wave size, its `dx.op` operations; nothing of the console program). That line is what found the common factor above in one run, and it may sort the other groups the same way. No game data used on my side. AI-assisted.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 04:59 UTC · original

I reran the census you both asked about, on the full 26,503-container corpus, as a clean A/B. Both builds are main d2a4bae + our Agility exports (Win10 SM 6.6), release, translate --validate --list, 10 parallel chunks, all exit 0:

base + #180 + #459
programs with a validation result 22,156 22,616
validation failures 185 173
mesh output > 32768 53 53
compute stage op 23 0
signature mismatch 46 56
interpolation packing 49 49
conservative depth 14 15

Answer to r4tedx's question 1 (#180): yes, cleanly. The 23 Entry function performs some operation that is incompatible with the shader stage failures all clear (23 → 0), none of those 23 fail for a different reason, and zero programs that validated on base fail on the fix build. So #180 removes that whole group with no regressions in this census.

Answer to AnoHunted's question 2 (#459): 0 now valid, 53 still over. All 53 still fail with the identical message; none switched to another reason. I checked one of them in detail ((MS_VS_PedTransformFire_52f61330_Wrapped~3.dxbc, emitted DXIL):

  • NumThreads=(128,1,1), setMeshOutputCounts(…, 128, 128), 79 vertex outputs, 0 primitive outputs.
  • By mesh_output_bytes's formula that is 4 × (79 × roundup(128, 32) + 0) = 40,448 B, above the 32 KiB cap as the validator says.
  • The PR reduces the maxima to the lane count — but the lane count here is already 128, so the maxima do not change. The emitted DXIL is byte-for-byte identical between base and fix (same 27,368 B, same hash). That explains all 53: the programs that hit this group are the ones where the lane count is already at or near the maximum, so lowering to it cannot help.

So #459 as posted does not clear any of the 53 in this corpus. A fix would need to lower the maxima below the lane count (with the prologue culling lanes whose indices exceed the new maximum), or reduce the declared output rows. I have the emitted DXIL for that example and the per-program failure list if useful.

Note on the other groups: signature mismatches rose 46 → 56 and conservative depth 14 → 15, while 460 more programs got a validation result. Those extra programs come from #180 letting 23 more compute programs translate, several of which now emit DXIL that fails for a different reason; the net failure count still drops 185 → 173. I have not attributed each of the 10 extra signature failures individually.

Counts and build identities only; no game data beyond shader hashes. AI-assisted (Claude Code). I ran the translation on Windows 10, RTX 4080; corpus tooling and the A/B script are mine.

**@⁠Proudnoob4** on GitHub · 2026-11-24 04:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7122527604) I reran the census you both asked about, on the full 26,503-container corpus, as a clean A/B. Both builds are `main d2a4bae` + our Agility exports (Win10 SM 6.6), release, `translate --validate --list`, 10 parallel chunks, all exit 0: | | base | + #180 + #459 | |---|---|---| | programs with a validation result | 22,156 | 22,616 | | validation failures | **185** | **173** | | mesh output > 32768 | 53 | 53 | | compute stage op | 23 | **0** | | signature mismatch | 46 | 56 | | interpolation packing | 49 | 49 | | conservative depth | 14 | 15 | **Answer to r4tedx's question 1 (#180): yes, cleanly.** The 23 `Entry function performs some operation that is incompatible with the shader stage` failures all clear (23 → 0), none of those 23 fail for a different reason, and **zero programs that validated on base fail on the fix build**. So `#180` removes that whole group with no regressions in this census. **Answer to AnoHunted's question 2 (#459): 0 now valid, 53 still over.** All 53 still fail with the identical message; none switched to another reason. I checked one of them in detail (`(MS_VS_PedTransformFire_52f61330_Wrapped~3.dxbc`, emitted DXIL): - `NumThreads=(128,1,1)`, `setMeshOutputCounts(…, 128, 128)`, 79 vertex outputs, 0 primitive outputs. - By `mesh_output_bytes`'s formula that is 4 × (79 × roundup(128, 32) + 0) = **40,448 B**, above the 32 KiB cap as the validator says. - The PR reduces the maxima to the lane count — but the lane count here is **already 128**, so the maxima do not change. The emitted DXIL is byte-for-byte identical between base and fix (same 27,368 B, same hash). That explains all 53: the programs that hit this group are the ones where the lane count is already at or near the maximum, so lowering to it cannot help. So #459 as posted does not clear any of the 53 in this corpus. A fix would need to lower the maxima below the lane count (with the prologue culling lanes whose indices exceed the new maximum), or reduce the declared output rows. I have the emitted DXIL for that example and the per-program failure list if useful. **Note on the other groups:** signature mismatches rose 46 → 56 and conservative depth 14 → 15, while 460 more programs got a validation result. Those extra programs come from #180 letting 23 more compute programs translate, several of which now emit DXIL that fails for a different reason; the net failure count still drops 185 → 173. I have not attributed each of the 10 extra signature failures individually. Counts and build identities only; no game data beyond shader hashes. AI-assisted (Claude Code). I ran the translation on Windows 10, RTX 4080; corpus tooling and the A/B script are mine.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 05:51 UTC · original

@⁠Proudnoob4 thank you, that settles question 1: with #180 the 23 compute modules of this group go to 0, and nothing that validated on main fails.

One correction to my comment above. I wrote that the 43 modules were found "on the #233 stack". They were counted on #439's head 9745f35, the top of that stack (that run). The same tester's per-head table gives:

Head Compute modules that fail validation New against main
main 23 –
#233 22 0
#320 (a5ba4a4) 42 20
#439 (9745f35) 43 not stated

So the extra ones come in with #320, which lets 21 more compute programs translate, 20 of them with this message. All 43 call sample, so they are the class #180 fixes.

Question 2 (the summary line translate --validate prints on #439's head) is not needed for this group any more. It may still help sort the other groups, for example the signature mismatches that went from 46 to 56 in your rerun.

I ran nothing myself for this comment; the numbers are the linked testers'. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 05:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7123336223) @⁠Proudnoob4 thank you, that settles question 1: with #180 the 23 compute modules of this group go to 0, and nothing that validated on `main` fails. One correction to my comment above. I wrote that the 43 modules were found "on the #233 stack". They were counted on #439's head `9745f35`, the top of that stack ([that run](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233)). The same tester's [per-head table](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233) gives: | Head | Compute modules that fail validation | New against `main` | |---|---|---| | `main` | 23 | – | | #233 | 22 | 0 | | #320 (`a5ba4a4`) | 42 | 20 | | #439 (`9745f35`) | 43 | not stated | So the extra ones come in with #320, which lets 21 more compute programs translate, 20 of them with this message. All 43 call `sample`, so they are the class #180 fixes. Question 2 (the summary line `translate --validate` prints on #439's head) is not needed for this group any more. It may still help sort the other groups, for example the signature mismatches that went from 46 to 56 in your rerun. I ran nothing myself for this comment; the numbers are the linked testers'. AI-assisted.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 06:04 UTC · original

Update on the 53 mesh modules (vertex plus primitive output size is greater than 32768), measured on main d2a4bae with dxil.dll 1.9.2602.17.

  • The other 132 validator failures go away with #306. Main + #306 leaves exactly these 53 (details on #306). #459 does not change them (details on #459).
  • Why they exceed the limit. I looked at three of them. Each is a 128-thread mesh program with MaxVertices = 128, MaxPrimitives = 128, no per-primitive outputs, and 19 packed vertex output rows: 128 × 19 × 16 B = 38,912 B.
  • Packing can't fix it. They use 65–67 components per vertex, and 128 × 67 × 4 B = 34,304 B is still over 32,768. Packing only takes it to that floor, so any fix has to lower the vertex count or the outputs.
  • #459 doesn't help here. It caps the maxima at the lane count, but here the lane count is already 128.

Options I can see:

  1. Declare fewer vertices when the GS_ALLOC_REQ count is a known constant ≤ 107 (19 rows) — related to #586, which decodes the request but keeps the declared maxima.
  2. Drop vertex outputs the paired pixel shader does not read, when the pipeline is made. Several of these programs feed prepass-type pixel shaders that likely read few attributes. This would also shrink the 19 rows in general.

Not verified: whether NVIDIA or AMD drivers misbehave on these at runtime. Your census says the runtime still created all mesh pipelines.

**@⁠iurysf** on GitHub · 2026-11-24 06:04 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7123548842) Update on the 53 mesh modules (`vertex plus primitive output size is greater than 32768`), measured on main `d2a4bae` with dxil.dll 1.9.2602.17. - **The other 132 validator failures go away with #306.** Main + #306 leaves exactly these 53 (details on #306). #459 does not change them (details on #459). - **Why they exceed the limit.** I looked at three of them. Each is a 128-thread mesh program with `MaxVertices = 128`, `MaxPrimitives = 128`, no per-primitive outputs, and **19 packed vertex output rows**: 128 × 19 × 16 B = 38,912 B. - **Packing can't fix it.** They use 65–67 components per vertex, and 128 × 67 × 4 B = 34,304 B is still over 32,768. Packing only takes it to that floor, so any fix has to lower the vertex count or the outputs. - **#459 doesn't help here.** It caps the maxima at the lane count, but here the lane count is already 128. Options I can see: 1. Declare fewer vertices when the `GS_ALLOC_REQ` count is a known constant ≤ 107 (19 rows) — related to #586, which decodes the request but keeps the declared maxima. 2. Drop vertex outputs the paired pixel shader does not read, when the pipeline is made. Several of these programs feed prepass-type pixel shaders that likely read few attributes. This would also shrink the 19 rows in general. Not verified: whether NVIDIA or AMD drivers misbehave on these at runtime. Your census says the runtime still created all mesh pipelines.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 06:29 UTC · original

Measured offline with victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17, against main d2a4bae: 3,733 translation failures, 185 modules rejected.

Best stack that merges cleanly as-is: seven PRs, in this order: #306, #592, #309, #571, #573, #576, #585.

  • Translation failures: 3,733 -> 3,356 (-377).
  • Rejected modules: 185 -> 53. Only the mesh "vertex plus primitive output size" class is left (analysis above); every vertex/pixel and compute module that emits validates.
  • Nothing regresses: no program that validated on main fails now, and every program a member PR fixed on its own stays fixed in the stack.

Conflicts as-is (these need a rebase, or a pick between overlapping pairs):

  • #569, #563, #599 and #565 collide with #306/#309's versions of the same fixes.
  • #307/#566 collide with #309/#585's lane-mask work.
  • #585 and #385 collide with each other. An alternate stack with #385 instead of #585/#573 reaches 3,359 with the same 53 rejects, and it also clears "lane-mask join of an untracked mask".

Per-PR numbers are in comments on each PR. This is CPU-side translation and validation only; in-game runs on an RTX 4070 are in progress.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 06:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7123992849) Measured offline with `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17, against main `d2a4bae`: 3,733 translation failures, 185 modules rejected. **Best stack that merges cleanly as-is:** seven PRs, in this order: #306, #592, #309, #571, #573, #576, #585. - Translation failures: 3,733 -> **3,356** (-377). - Rejected modules: 185 -> **53**. Only the mesh "vertex plus primitive output size" class is left (analysis above); every vertex/pixel and compute module that emits validates. - Nothing regresses: no program that validated on main fails now, and every program a member PR fixed on its own stays fixed in the stack. **Conflicts as-is** (these need a rebase, or a pick between overlapping pairs): - #569, #563, #599 and #565 collide with #306/#309's versions of the same fixes. - #307/#566 collide with #309/#585's lane-mask work. - #585 and #385 collide with each other. An alternate stack with #385 instead of #585/#573 reaches 3,359 with the same 53 rejects, and it also clears "lane-mask join of an untracked mask". Per-PR numbers are in comments on each PR. This is CPU-side translation and validation only; in-game runs on an RTX 4070 are in progress. AI-assisted.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 03:25 UTC · original · edited 2026-11-24 06:52 UTC

I checked the DXIL writer on d2a4bae with signatures from an SDK-compiled synthetic mesh shader. Both output maxima were 256. The case with 27 vertex scalars and 5 primitive scalars passed dxil.dll 1.8.2502 at exactly 32,768 bytes. Adding one primitive scalar reproduced the reported output-size error at 33,792 bytes. The passing case includes partially filled signature rows, so row padding did not inflate its declared scalar count.

For one of the failing modules, could you share just the declared maximum vertex and primitive counts and the total scalar count of each output signature, before and after translation? Four integers per side are enough to see whether the emitted declaration grew or the source already exceeds the DXIL limit.

Follow-up on the proposed declaration cap. I compiled two original 128-thread mesh shaders with 19 vertex signature elements, containing 67 and 76 float components respectively and no per-primitive attributes. Both always call SetMeshOutputCounts(3, 1). Windows SDK DXIL 1.8.2502.11 accepts declared MaxVertices=96 for both and rejects 97 and 107 with the same 32 KiB error.

The declared maximum is rounded up to a multiple of 32, so 97 through 107 all budget 128 vertices. For these two output widths the declaration needs to be at most 96. This synthetic check establishes the cap threshold. Applying it to a recovered program still requires proving its allocation and export indices fit. D3D12 output-size rule

**@⁠fuzeofficlal** on GitHub · 2026-11-24 03:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7121068944) · edited 2026-11-24 06:52 UTC I checked the DXIL writer on `d2a4bae` with signatures from an SDK-compiled synthetic mesh shader. Both output maxima were 256. The case with 27 vertex scalars and 5 primitive scalars passed `dxil.dll` 1.8.2502 at exactly 32,768 bytes. Adding one primitive scalar reproduced the reported output-size error at 33,792 bytes. The passing case includes partially filled signature rows, so row padding did not inflate its declared scalar count. For one of the failing modules, could you share just the declared maximum vertex and primitive counts and the total scalar count of each output signature, before and after translation? Four integers per side are enough to see whether the emitted declaration grew or the source already exceeds the DXIL limit. Follow-up on the proposed declaration cap. I compiled two original 128-thread mesh shaders with 19 vertex signature elements, containing 67 and 76 float components respectively and no per-primitive attributes. Both always call `SetMeshOutputCounts(3, 1)`. Windows SDK DXIL 1.8.2502.11 accepts declared `MaxVertices=96` for both and rejects `97` and `107` with the same 32 KiB error. The declared maximum is rounded up to a multiple of 32, so 97 through 107 all budget 128 vertices. For these two output widths the declaration needs to be at most 96. This synthetic check establishes the cap threshold. Applying it to a recovered program still requires proving its allocation and export indices fit. [D3D12 output-size rule](https://microsoft.github.io/DirectX-Specs/d3d/MeshShader.html#mesh-shader-output-size-limits)
Author
Owner

@⁠Catskan on GitHub · 2026-11-24 07:37 UTC · original

RX 9070 XT (RDNA4): the driver creates every emitted pipeline, compute included (0 refused)

Setup: RX 9070 XT 16 GB, driver 32.0.32029.2010, Windows 11 Pro 26200 (SM 6.6 without the Agility exports), main d2a4bae, release build, dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100). This is an offline run; I did not run the title. I used the same 26,503 DXBC containers from my own 1.0.2.1 copy, passed as 54 files of 500 containers, with victory translate --validate --pipelines --jobs 8.

The 9070 XT is not DXGI adapter 0 in every session on this machine, so I reran one of the 54 files in the same session type and watched the process's GPU memory counters. It allocates only on the 9070 XT's LUID.

Stage Emitted Host pipelines created Refused
VS/PS 12,272 12,272 0
Compute 1,693 1,693 0
Mesh 8,191 8,191 0

Emitted counts are the deduplicated totals of one whole-corpus --validate run. None of the 54 per-file runs has a pipeline: failure line, and all 54 exit with 0, without a crash or a timeout.

dxil.dll rejects 185 modules (12,172 + 1,670 + 8,129 validated), the same count as iurysf's run with the same 1.9 dll. The driver still creates pipelines for the 23 compute modules among them.

On NVIDIA, the opening post counts 321 of 1,685 compute pipelines refused with E_INVALIDARG (RTX 4080, 97c78d1, dll 1.8.2502), and the RTX 4070 Ti count in #71 is the same on 35b054e. The commits and validators differ, but 0 refusals here fits RDNA's 64-lane waves, so the 321 refusals look specific to 32-lane hosts (#468, #578, the #223/#233 stack). I only checked pipeline creation, not whether those wave64 programs compute correctly on RDNA.

AI-assisted (Claude). I ran the translation and checked the counts myself.

**@⁠Catskan** on GitHub · 2026-11-24 07:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7125190059) **RX 9070 XT (RDNA4): the driver creates every emitted pipeline, compute included (0 refused)** Setup: RX 9070 XT 16 GB, driver 32.0.32029.2010, Windows 11 Pro 26200 (SM 6.6 without the Agility exports), `main` `d2a4bae`, release build, `dxil.dll` 1.9.2602.17 (Windows SDK 10.0.26100). This is an offline run; I did not run the title. I used the same 26,503 DXBC containers from my own 1.0.2.1 copy, passed as 54 files of 500 containers, with `victory translate --validate --pipelines --jobs 8`. The 9070 XT is not DXGI adapter 0 in every session on this machine, so I reran one of the 54 files in the same session type and watched the process's GPU memory counters. It allocates only on the 9070 XT's LUID. | Stage | Emitted | Host pipelines created | Refused | |---|---:|---:|---:| | VS/PS | 12,272 | 12,272 | 0 | | Compute | 1,693 | 1,693 | 0 | | Mesh | 8,191 | 8,191 | 0 | Emitted counts are the deduplicated totals of one whole-corpus `--validate` run. None of the 54 per-file runs has a `pipeline:` failure line, and all 54 exit with 0, without a crash or a timeout. `dxil.dll` rejects 185 modules (12,172 + 1,670 + 8,129 validated), the same count as iurysf's run with the same 1.9 dll. The driver still creates pipelines for the 23 compute modules among them. On NVIDIA, the opening post counts 321 of 1,685 compute pipelines refused with `E_INVALIDARG` (RTX 4080, `97c78d1`, dll 1.8.2502), and the RTX 4070 Ti count in #71 is the same on `35b054e`. The commits and validators differ, but 0 refusals here fits RDNA's 64-lane waves, so the 321 refusals look specific to 32-lane hosts (#468, #578, the #223/#233 stack). I only checked pipeline creation, not whether those wave64 programs compute correctly on RDNA. AI-assisted (Claude). I ran the translation and checked the counts myself.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 07:48 UTC · original

Driver-side check of the seven-PR stack above (#306, #592, #309, #571, #573, #576, #585), since passing the validator doesn't guarantee the driver accepts a module. I ran victory translate --list --pipelines on an RTX 4070 (driver 32.0.16.2101, 32-lane waves) over all 26,096 programs:

host pipelines created refused by the driver
main d2a4bae 21,847 322
main + stack 22,203 (+356) 343
  • All 27 newly refused programs are WaveSize(64) compute that the stack now translates. They are refused for the same reason as main's 322, a host without 64-lane waves (see #233 and #578). Another 6 of main's refusals are no longer refused.
  • Apart from that, the driver accepts everything the stack newly emits.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 07:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7125395390) Driver-side check of the seven-PR stack above (#306, #592, #309, #571, #573, #576, #585), since passing the validator doesn't guarantee the driver accepts a module. I ran `victory translate --list --pipelines` on an RTX 4070 (driver 32.0.16.2101, 32-lane waves) over all 26,096 programs: | | host pipelines created | refused by the driver | |---|---:|---:| | main `d2a4bae` | 21,847 | 322 | | main + stack | **22,203 (+356)** | 343 | - All 27 newly refused programs are `WaveSize(64)` compute that the stack now translates. They are refused for the same reason as main's 322, a host without 64-lane waves (see #233 and #578). Another 6 of main's refusals are no longer refused. - Apart from that, the driver accepts everything the stack newly emits. AI-assisted.
Author
Owner

@⁠YouKnowWh on GitHub · 2026-11-24 08:59 UTC · original

RTX 5070 Ti follow-up for three compute containers used in the 1.0.2.1 world-loading path. I checked DXIL validation and actual D3D12 compute PSO creation separately. The hardware reports a 32–32 lane range.

Local build / emission path DXIL validator Compute PSOs created
Previous diagnostic integration (main d2a4bae with #322, #643, #193/#704), original emitter 0/3 0/3
Same integration with the #306 compute-derivative validator/PSV changes 3/3 0/3
#439 ef14bf3, hardware wave target, legacy validator metadata 0/3 3/3
Same #439 test executable and hardware target, #306 compute-derivative metadata enabled 3/3 3/3

The last two rows use a local diagnostic switch on the same executable. The old integration emitted WaveSize=64 for all three. I used the Windows DXIL validator and the hardware adapter for the PSO tests. The #439 line is a different code base from the first two rows, so the cross-branch comparison does not isolate a single wave-lowering commit.

In a separate story-mode run of #439 plus the #306 compute-derivative changes, all three host PSOs were created and first-bound. Instrumentation immediately after the host command-list calls recorded:

  • cabb87599722e59a (particle light atlas): 204 ExecuteIndirect calls, maximum one command per call.
  • 5b2ce592c3a5dd09 (density shadow map mip generation): 21 direct Dispatch calls.
  • c4183d3cbee28e8e (projected decal resolve): 20 ExecuteIndirect calls, maximum one command per call.

These are totals across the run, stopped after 16 world-stage presents. Recording ExecuteIndirect does not establish a nonzero GPU argument count. Output correctness of these three passes and complete scene rendering remain unverified. This is independent hardware confirmation for #201, #306 and #439.

AI disclosure: Codex integrated the public changes, ran the local tests on my machine, analyzed the logs, and wrote this report at my request.

**@⁠YouKnowWh** on GitHub · 2026-11-24 08:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7126822605) RTX 5070 Ti follow-up for three compute containers used in the 1.0.2.1 world-loading path. I checked DXIL validation and actual D3D12 compute PSO creation separately. The hardware reports a 32–32 lane range. | Local build / emission path | DXIL validator | Compute PSOs created | | --- | ---: | ---: | | Previous diagnostic integration (main d2a4bae with #322, #643, #193/#704), original emitter | 0/3 | 0/3 | | Same integration with the #306 compute-derivative validator/PSV changes | 3/3 | 0/3 | | #439 ef14bf3, hardware wave target, legacy validator metadata | 0/3 | 3/3 | | Same #439 test executable and hardware target, #306 compute-derivative metadata enabled | 3/3 | 3/3 | The last two rows use a local diagnostic switch on the same executable. The old integration emitted WaveSize=64 for all three. I used the Windows DXIL validator and the hardware adapter for the PSO tests. The #439 line is a different code base from the first two rows, so the cross-branch comparison does not isolate a single wave-lowering commit. In a separate story-mode run of #439 plus the #306 compute-derivative changes, all three host PSOs were created and first-bound. Instrumentation immediately after the host command-list calls recorded: - cabb87599722e59a (particle light atlas): 204 ExecuteIndirect calls, maximum one command per call. - 5b2ce592c3a5dd09 (density shadow map mip generation): 21 direct Dispatch calls. - c4183d3cbee28e8e (projected decal resolve): 20 ExecuteIndirect calls, maximum one command per call. These are totals across the run, stopped after 16 world-stage presents. Recording ExecuteIndirect does not establish a nonzero GPU argument count. Output correctness of these three passes and complete scene rendering remain unverified. This is independent hardware confirmation for #201, #306 and #439. AI disclosure: Codex integrated the public changes, ran the local tests on my machine, analyzed the logs, and wrote this report at my request.
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-24 16:05 UTC · original · edited 2026-11-24 16:11 UTC

I checked the shaders selected by the title in a Series S WARP startup and early story-load run on the #211 head af9a911, with #197 for startup input. A local diagnostic matched title first-bind events to the emitted DXIL in VIctory's cache. I validated those cached modules after exit with Windows SDK dxil.dll 1.8.2502.11.

  • 17 distinct title shaders matched 16 distinct emitted DXIL modules. All 16 passed validation. The 17 title shaders were 7 vertex, 7 pixel, and 3 compute.
  • Four were first bound after the story archive opened, all vertex or pixel. All 17 appeared in at least one host pipeline that WARP accepted.
  • The commit guard stopped the run during loading. There were no observed mesh shader binds or confirmed world frames, so this does not cover the mesh failure group or the first cutscene.

Offline mesh follow-up. I checked the one-shader explanation above across the full output-size failure group at the closed #459 revision dc838d6. The local mesh-only probe logged the existing budget calculation before and after the clamp and paired it with the Windows SDK 1.8.2502.11 validator result. The probe preserved the emitted DXIL.

Of 8,191 emitted mesh modules, 8,129 validated, 53 failed the 32 KiB output-size rule, and 9 failed other rules. All 53 of 53 output-size failures had 128 threads and declared maxima of 128 vertices and 128 primitives both before and after the clamp. Their translated signatures had 65–71 vertex scalars and no per-primitive scalars, giving calculated budgets of 33,280–36,352 bytes. The clamp ran in all 53 cases.

With those signatures and rounding to multiples of 32, 96 is the greatest declared vertex maximum that fits. The probe did not establish whether lowering the maximum preserves the shaders' outputs. This offline run did not test runtime rendering.

AI-assisted test execution and write-up (OpenAI Codex).

**@⁠BaggyALPHA** on GitHub · 2026-11-24 16:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7137110808) · edited 2026-11-24 16:11 UTC I checked the shaders selected by the title in a Series S WARP startup and early story-load run on the #211 head `af9a911`, with #197 for startup input. A local diagnostic matched title first-bind events to the emitted DXIL in VIctory's cache. I validated those cached modules after exit with Windows SDK `dxil.dll` 1.8.2502.11. - 17 distinct title shaders matched 16 distinct emitted DXIL modules. All 16 passed validation. The 17 title shaders were 7 vertex, 7 pixel, and 3 compute. - Four were first bound after the story archive opened, all vertex or pixel. All 17 appeared in at least one host pipeline that WARP accepted. - The commit guard stopped the run during loading. There were no observed mesh shader binds or confirmed world frames, so this does not cover the mesh failure group or the first cutscene. **Offline mesh follow-up.** I checked the one-shader explanation above across the full output-size failure group at the closed #459 revision `dc838d6`. The local mesh-only probe logged the existing budget calculation before and after the clamp and paired it with the Windows SDK 1.8.2502.11 validator result. The probe preserved the emitted DXIL. Of 8,191 emitted mesh modules, 8,129 validated, 53 failed the 32 KiB output-size rule, and 9 failed other rules. All **53 of 53** output-size failures had 128 threads and declared maxima of 128 vertices and 128 primitives both before and after the clamp. Their translated signatures had 65–71 vertex scalars and no per-primitive scalars, giving calculated budgets of 33,280–36,352 bytes. The clamp ran in all 53 cases. With those signatures and rounding to multiples of 32, 96 is the greatest declared vertex maximum that fits. The probe did not establish whether lowering the maximum preserves the shaders' outputs. This offline run did not test runtime rendering. AI-assisted test execution and write-up (OpenAI Codex).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:49 UTC · original · edited 2026-11-25 06:55 UTC

Automated triage for the maintainers.

Thanks for the rerun on 940d32f. Where each group stands now:

  • Conservative depth (14): all validate.
  • Mixed interpolation (49) and signature mismatch (46): 79 validate. The other 16 now fail first with "Flags must match usage".
  • Mesh output size (53) and compute stage (23): unchanged. For the mesh class, the comments here show the vertex count and per-vertex output size come from the title's own stage data (ms_io in native.rs reads both), so the product exceeds the host's 32,768-byte limit without anything of ours to trim: it needs an emulation choice (split dispatch, or the compute fallback discussed in #1612 and PR #961), which is for the maintainers. The open PRs are #1385 for mesh and #1948 / #1065 for compute.

The "Flags must match usage" failures (867 vertex programs across the pack) are a regression from cd94d35, and main confirms it. In crates/victory-shader/src/emit/shader.rs, Shader::finish declares the view-writes UAV (used by mark_view_write in emit/lower.rs) in vertex programs. The flags module has no UAVsAtEveryStage bit (1 << 16), and SFI0 does not set its feature bit either. At least one affected vertex program is selected in real runs (latest comment), so this is not only a census finding. This regression is tracked in #1973 (oldest) and #1987. Open PRs #2016 and #1989 already carry the same change as the diff here, so review can continue there; no new PR is needed for it.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7150002447) · edited 2026-11-25 06:55 UTC <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T05:02:23Z at=2026-11-25T06:55:21Z --> Automated triage for the maintainers. Thanks for the rerun on `940d32f`. Where each group stands now: - **Conservative depth (14):** all validate. - **Mixed interpolation (49) and signature mismatch (46):** 79 validate. The other 16 now fail first with "Flags must match usage". - **Mesh output size (53) and compute stage (23):** unchanged. For the mesh class, the comments here show the vertex count and per-vertex output size come from the title's own stage data (`ms_io` in `native.rs` reads both), so the product exceeds the host's 32,768-byte limit without anything of ours to trim: it needs an emulation choice (split dispatch, or the compute fallback discussed in #1612 and PR #961), which is for the maintainers. The open PRs are #1385 for mesh and #1948 / #1065 for compute. The "Flags must match usage" failures (867 vertex programs across the pack) are a regression from cd94d35, and `main` confirms it. In `crates/victory-shader/src/emit/shader.rs`, `Shader::finish` declares the view-writes UAV (used by `mark_view_write` in `emit/lower.rs`) in vertex programs. The `flags` module has no `UAVsAtEveryStage` bit (`1 << 16`), and SFI0 does not set its feature bit either. At least one affected vertex program is selected in real runs (latest comment), so this is not only a census finding. This regression is tracked in #1973 (oldest) and #1987. Open PRs #2016 and #1989 already carry the same change as the diff here, so review can continue there; no new PR is needed for it. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠YouKnowWh on GitHub · 2026-11-25 02:41 UTC · original

I reran the census on the same local 1.0.2.1 shader pack at both 97c78d1 and 940d32f69b22265690a0b5a15d6ded572ba33baf using victory translate shaders.rpf --validate --list --jobs 8, validator DLL file version 1.8.2502.11. Both scanned 26,503 containers (614 duplicates skipped) and reported 26,084 programs translated. The old revision reproduced all five original counts exactly.

Original first validator error Old count Outcomes for those programs on 940d32f
Conservative-depth PS input position 14 14 validated
Mixed interpolation modes in one signature row 49 39 validated; 10 now report “Flags must match usage.”
Container signature mismatch 46 40 validated; 6 now report “Flags must match usage.”
Mesh output exceeds 32,768 bytes 53 53 still report mesh output size
Compute stage incompatibility 23 23 still report stage incompatibility

The three groups you asked about therefore have 93/109 fully validating and 16/109 with a different first error. None of the 185 historical cases was unmatched. The CLI lists the first validator diagnostic per module; the changed diagnostic alone does not prove every underlying signature problem is gone.

Across the whole pack on 940d32f, 25,591 modules emitted DXIL and 23,918 validated. The 1,673 first-error outcomes were 867 flags/usage, 735 compute stage, and 71 mesh output size. The old build emitted 22,148 modules. This is a different emitted population; the difference in total failed validations is not by itself a regression count. This run did not create host pipelines, launch the game, or measure in-game usage.

Cause and verified fix for the remaining 16

All 16 are vertex shaders. Their full validator reports all show exactly one missing module flag: actual minus declared is bit 16 (0x10000, DXIL UAVsAtEveryStage), with no surplus bits. Tracing resource emission on each shader gave the same result: no root UAV slots, no title-memory dirty bitmap, and a declared buffer-view writes bitmap. This is the translator-generated raw UAV used by mark_view_write.

With the emitted validator version 1.6, a declared UAV outside the pixel and compute stages requires that module flag. My candidate sets it when emitting that UAV resource list, and mirrors it in SFI0 as ShaderFeatureInfo_UAVsAtEveryStage (0x4). No signature packing, resource binding, or shader instructions were changed.

The 16/16 now pass full DXIL validation. This resolves the old signature question for these exact modules. Across the full pack all 867 former flags failures (all VS) now validate: 23,918 → 24,785 of the same 25,591 emitted modules. A comparison by original DXIL-part identity and shader stage showed no other validation outcome changes. The remaining 735 stage-incompatible and 71 mesh-size failures are unchanged. The synthetic resource/feature regression test also passes. These results are offline and do not measure runtime output or PSO creation.

AI-assisted offline rerun and comparison. No game files attached.

Candidate patch and synthetic regression test (against 940d32f)
diff --git a/crates/victory-shader/src/emit/shader.rs b/crates/victory-shader/src/emit/shader.rs
index e68e262..8957389 100644
--- a/crates/victory-shader/src/emit/shader.rs
+++ b/crates/victory-shader/src/emit/shader.rs
@@ -44,6 +44,7 @@ pub const VIEW_WRITE_BITS: u32 = 1 << 22;
 /// `ShaderFlags` bits (metadata) and their `SFI0` feature bits.
 pub(crate) mod flags {
     pub const RAW_BUFFERS: u64 = 1 << 4;
+    pub const UAVS_AT_EVERY_STAGE: u64 = 1 << 16;
     pub const STENCIL_REF: u64 = 1 << 11;
     pub const TYPED_UAV_LOADS: u64 = 1 << 13;
     pub const ROVS: u64 = 1 << 18;
@@ -657,6 +658,10 @@ impl Shader {
             }
             let mut uavs = None;
             if !self.root_uavs.is_empty() || self.memory_dirty.is_some() || self.view_writes.is_some() {
+                // With dx.valver 1.6, declared UAVs require this flag outside PS and CS.
+                if !self.pixel && (self.threads.is_none() || self.mesh.is_some()) {
+                    self.flags |= flags::UAVS_AT_EVERY_STAGE;
+                }
                 let ty = self
                     .m
                     .named_struct("struct.RWByteAddressBuffer", vec![self.t.i32]);
@@ -879,6 +884,9 @@ impl Shader {
         dxil.extend(&bitcode);
 
         let mut features = 0u64;
+        if self.flags & flags::UAVS_AT_EVERY_STAGE != 0 {
+            features |= 0x0004;
+        }
         if self.flags & flags::STENCIL_REF != 0 {
             features |= 0x200;
         }
@@ -986,3 +994,32 @@ impl Shader {
         Some(self.m.md_node(list))
     }
 }
+
+#[cfg(test)]
+mod uav_stage_tests {
+    use super::Shader;
+    use crate::emit::bitcode::Term;
+    use crate::{Container, FourCC};
+
+    #[test]
+    fn emitted_uav_stage_feature_matches_the_declared_resources() {
+        for (pixel, threads, with_uav, expected) in [
+            (false, None, false, false),
+            (false, None, true, true),
+            (true, None, true, false),
+            (false, Some([1, 1, 1]), true, false),
+        ] {
+            let mut shader = Shader::new(pixel);
+            shader.threads = threads;
+            if with_uav {
+                shader.view_writes_handle();
+            }
+            shader.m.terminate(shader.entry, Term::Ret);
+            let bytes = shader.finish();
+            let container = Container::parse(&bytes).unwrap();
+            let sfi = container.part(FourCC::SFI0).unwrap().data;
+            let features = u64::from_le_bytes(sfi.try_into().unwrap());
+            assert_eq!(features & 4 != 0, expected);
+        }
+    }
+}
**@⁠YouKnowWh** on GitHub · 2026-11-25 02:41 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7151059505) I reran the census on the same local 1.0.2.1 shader pack at both `97c78d1` and `940d32f69b22265690a0b5a15d6ded572ba33baf` using `victory translate shaders.rpf --validate --list --jobs 8`, validator DLL file version 1.8.2502.11. Both scanned 26,503 containers (614 duplicates skipped) and reported 26,084 programs translated. The old revision reproduced all five original counts exactly. | Original first validator error | Old count | Outcomes for those programs on 940d32f | |---|---:|---| | Conservative-depth PS input position | 14 | 14 validated | | Mixed interpolation modes in one signature row | 49 | 39 validated; 10 now report “Flags must match usage.” | | Container signature mismatch | 46 | 40 validated; 6 now report “Flags must match usage.” | | Mesh output exceeds 32,768 bytes | 53 | 53 still report mesh output size | | Compute stage incompatibility | 23 | 23 still report stage incompatibility | The three groups you asked about therefore have 93/109 fully validating and 16/109 with a different first error. None of the 185 historical cases was unmatched. The CLI lists the first validator diagnostic per module; the changed diagnostic alone does not prove every underlying signature problem is gone. Across the whole pack on `940d32f`, 25,591 modules emitted DXIL and 23,918 validated. The 1,673 first-error outcomes were 867 flags/usage, 735 compute stage, and 71 mesh output size. The old build emitted 22,148 modules. This is a different emitted population; the difference in total failed validations is not by itself a regression count. This run did not create host pipelines, launch the game, or measure in-game usage. ### Cause and verified fix for the remaining 16 All 16 are vertex shaders. Their full validator reports all show exactly one missing module flag: actual minus declared is bit 16 (`0x10000`, DXIL `UAVsAtEveryStage`), with no surplus bits. Tracing resource emission on each shader gave the same result: no root UAV slots, no title-memory dirty bitmap, and a declared buffer-view writes bitmap. This is the translator-generated raw UAV used by `mark_view_write`. With the emitted validator version 1.6, a declared UAV outside the pixel and compute stages requires that module flag. My candidate sets it when emitting that UAV resource list, and mirrors it in SFI0 as `ShaderFeatureInfo_UAVsAtEveryStage` (0x4). No signature packing, resource binding, or shader instructions were changed. The 16/16 now pass full DXIL validation. This resolves the old signature question for these exact modules. Across the full pack all 867 former flags failures (all VS) now validate: 23,918 → 24,785 of the same 25,591 emitted modules. A comparison by original DXIL-part identity and shader stage showed no other validation outcome changes. The remaining 735 stage-incompatible and 71 mesh-size failures are unchanged. The synthetic resource/feature regression test also passes. These results are offline and do not measure runtime output or PSO creation. AI-assisted offline rerun and comparison. No game files attached. <details><summary>Candidate patch and synthetic regression test (against 940d32f)</summary> ````diff diff --git a/crates/victory-shader/src/emit/shader.rs b/crates/victory-shader/src/emit/shader.rs index e68e262..8957389 100644 --- a/crates/victory-shader/src/emit/shader.rs +++ b/crates/victory-shader/src/emit/shader.rs @@ -44,6 +44,7 @@ pub const VIEW_WRITE_BITS: u32 = 1 << 22; /// `ShaderFlags` bits (metadata) and their `SFI0` feature bits. pub(crate) mod flags { pub const RAW_BUFFERS: u64 = 1 << 4; + pub const UAVS_AT_EVERY_STAGE: u64 = 1 << 16; pub const STENCIL_REF: u64 = 1 << 11; pub const TYPED_UAV_LOADS: u64 = 1 << 13; pub const ROVS: u64 = 1 << 18; @@ -657,6 +658,10 @@ impl Shader { } let mut uavs = None; if !self.root_uavs.is_empty() || self.memory_dirty.is_some() || self.view_writes.is_some() { + // With dx.valver 1.6, declared UAVs require this flag outside PS and CS. + if !self.pixel && (self.threads.is_none() || self.mesh.is_some()) { + self.flags |= flags::UAVS_AT_EVERY_STAGE; + } let ty = self .m .named_struct("struct.RWByteAddressBuffer", vec![self.t.i32]); @@ -879,6 +884,9 @@ impl Shader { dxil.extend(&bitcode); let mut features = 0u64; + if self.flags & flags::UAVS_AT_EVERY_STAGE != 0 { + features |= 0x0004; + } if self.flags & flags::STENCIL_REF != 0 { features |= 0x200; } @@ -986,3 +994,32 @@ impl Shader { Some(self.m.md_node(list)) } } + +#[cfg(test)] +mod uav_stage_tests { + use super::Shader; + use crate::emit::bitcode::Term; + use crate::{Container, FourCC}; + + #[test] + fn emitted_uav_stage_feature_matches_the_declared_resources() { + for (pixel, threads, with_uav, expected) in [ + (false, None, false, false), + (false, None, true, true), + (true, None, true, false), + (false, Some([1, 1, 1]), true, false), + ] { + let mut shader = Shader::new(pixel); + shader.threads = threads; + if with_uav { + shader.view_writes_handle(); + } + shader.m.terminate(shader.entry, Term::Ret); + let bytes = shader.finish(); + let container = Container::parse(&bytes).unwrap(); + let sfi = container.part(FourCC::SFI0).unwrap().data; + let features = u64::from_le_bytes(sfi.try_into().unwrap()); + assert_eq!(features & 4 != 0, expected); + } + } +} ```` </details>
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 03:43 UTC · original

The mesh refusal is arithmetic, not a flag: 128 vertices × 264 bytes = 33,792, and DXIL's mesh output budget is 32,768

I spent this round on the third class in the census (For shader 'main', vertex plus primitive output size is greater than 32768, 71 programs, every one a mesh shader), and the answer is that it cannot be fixed the way the last two were. The numbers, from one of the 71 dumped with VICTORY_EMIT_DUMP and read with dxc -dumpbin:

MSNC_VS_PedTransformSkinTransmissionFire_6c7ff3fe_Wrapped   Ms
  threads (128,1,1), max vertices 128, max primitives 128, topology triangles (2)
  output signature: 20 elements, 66 components = 264 bytes per vertex
  !58 = !{!59, i32 128, i32 128, i32 2, i32 0}

The validator's budget is on the product, not on the signature:

128 vertices × 264 bytes = 33,792 bytes   >   32,768

Three per cent over. The same signature fits with 124 vertices or fewer, and 128 vertices fit with 125 bytes or fewer per vertex (31 components). So the title asks its console mesh shaders for a combination that the host's mesh pipeline does not allow, and no shader flag changes that.

What that means for whoever picks this up — I would not want to start any of these without a decision, which is why I stopped at the measurement:

  1. the signature is ours to trim only if it carries something we added. 66 components for a vertex shader's interpolants is a lot; if any of those elements are ours (rather than the title's), dropping them answers the class for free. I have not established that — it needs the console's own signature next to ours, which the dumper can give and I have not done;
  2. split the dispatch: a mesh shader that wants 128 vertices could be run as two with 64 each. That changes how the title's draws bind (the draw count per dispatch), so it is a scheduler change, not a translator one;
  3. reduce max_vertices to 124 and let the extra four vertices be emitted by a second dispatch — same problem as 2, smaller number;
  4. translate these to compute + draws, which is what the title's own console path may be doing anyway; the largest of the options and the one that needs the most measurement first.

Of the four, only the first is a candidate for a small change, and it depends on a fact nobody has written down yet: whether our emitted signature for these mesh shaders has elements the console's does not. That is the next measurement, and it is cheap — the same dump, compared against the title's signature bytes.

For the record, the other classes I looked at this round and did not touch: 195 programs refused for "an address in an SGPR that is no root parameter" (address resolution for computed bases, a feature), 40 for "a register joining a lane mask and data, read as data" and 36 for "a descriptor read only as data" (corners of the structurisation). None is a one-line answer either, and I would rather leave four honest measurements than four half-fixes.

No game data is involved: signature element counts, thread-group sizes and byte arithmetic.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 03:43 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7152182378) **The mesh refusal is arithmetic, not a flag: 128 vertices × 264 bytes = 33,792, and DXIL's mesh output budget is 32,768** I spent this round on the third class in the census (`For shader 'main', vertex plus primitive output size is greater than 32768`, 71 programs, every one a mesh shader), and the answer is that it cannot be fixed the way the last two were. The numbers, from one of the 71 dumped with `VICTORY_EMIT_DUMP` and read with `dxc -dumpbin`: ``` MSNC_VS_PedTransformSkinTransmissionFire_6c7ff3fe_Wrapped Ms threads (128,1,1), max vertices 128, max primitives 128, topology triangles (2) output signature: 20 elements, 66 components = 264 bytes per vertex !58 = !{!59, i32 128, i32 128, i32 2, i32 0} ``` The validator's budget is on the product, not on the signature: ``` 128 vertices × 264 bytes = 33,792 bytes > 32,768 ``` Three per cent over. The same signature fits with **124 vertices or fewer**, and 128 vertices fit with **125 bytes or fewer per vertex** (31 components). So the title asks its console mesh shaders for a combination that the host's mesh pipeline does not allow, and no shader flag changes that. What that means for whoever picks this up — I would not want to start any of these without a decision, which is why I stopped at the measurement: 1. **the signature is ours to trim only if it carries something we added.** 66 components for a vertex shader's interpolants is a lot; if any of those elements are ours (rather than the title's), dropping them answers the class for free. I have not established that — it needs the console's own signature next to ours, which the dumper can give and I have not done; 2. **split the dispatch**: a mesh shader that wants 128 vertices could be run as two with 64 each. That changes how the title's draws bind (the draw count per dispatch), so it is a scheduler change, not a translator one; 3. **reduce `max_vertices` to 124 and let the extra four vertices be emitted by a second dispatch** — same problem as 2, smaller number; 4. **translate these to compute + draws**, which is what the title's own console path may be doing anyway; the largest of the options and the one that needs the most measurement first. Of the four, only the first is a candidate for a small change, and it depends on a fact nobody has written down yet: whether our emitted signature for these mesh shaders has elements the console's does not. That is the next measurement, and it is cheap — the same dump, compared against the title's signature bytes. For the record, the other classes I looked at this round and did not touch: 195 programs refused for "an address in an SGPR that is no root parameter" (address resolution for computed bases, a feature), 40 for "a register joining a lane mask and data, read as data" and 36 for "a descriptor read only as data" (corners of the structurisation). None is a one-line answer either, and I would rather leave four honest measurements than four half-fixes. No game data is involved: signature element counts, thread-group sizes and byte arithmetic. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 03:44 UTC · original

Correction to what I said one comment ago: the 264 bytes per vertex are the title's own signature, so there is nothing of ours to trim

I proposed that the first thing to check was whether our emitted signature carries elements the console's does not. It does not, and here is the measurement rather than the assumption:

  • native.rs::ms_io builds the mesh stage from the console's own stage data, and the outputs come from vs_outputs(data) — the same list the emitter writes out. MS_INFO+2 and MS_INFO+4 are max_vertices and max_primitives, read straight from the title's blob: the 128, 128 in the module is what the title declares, not a default of ours.
  • so 264 bytes per vertex and 128 vertices are both the title's numbers, and their product is 33,792 against the host's 32,768.

Which makes this a capability gap between the console's mesh shader and D3D12's, not a bug in the translation: the title asks for an output budget 3% larger than the host allows, and no flag, signature trim or max_vertices adjustment is faithful — every one of those changes what the shader may produce.

The honest options are therefore the emulation ones, and they are the maintainer's call, not a pull request I should open unilaterally:

  1. run the mesh shader as two dispatches of 64 vertices — the shader itself does not change, but whatever binds the draws has to know that one dispatch became two, so it is a scheduler change with a real failure mode (duplicate primitives at the seam);
  2. translate these to compute + draws, which is what the console's own fallback path may already do for hardware without mesh shaders — worth looking at before writing anything, and #1612 is where that ground is being discussed;
  3. accept the 71 as programs the host cannot run as mesh, and say so where the census reports them, so nobody spends another round on arithmetic that cannot come out.

What I would not do is quietly lower max_vertices to 124 or drop signature elements to fit: that passes the validator and changes what the shader outputs, which is the kind of green check this repository has been careful to avoid.

For the record, of the four classes I have measured this week, this is the only one that is not a defect at all — the other three (195 SGPR addresses, 40 lane-mask-as-data, 36 descriptor-as-data) are features we have not written yet.

No game data is involved: counts, offsets and the byte arithmetic.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 03:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7152198525) **Correction to what I said one comment ago: the 264 bytes per vertex are the title's own signature, so there is nothing of ours to trim** I proposed that the first thing to check was whether our emitted signature carries elements the console's does not. It does not, and here is the measurement rather than the assumption: - `native.rs::ms_io` builds the mesh stage from the console's own stage data, and the outputs come from `vs_outputs(data)` — the same list the emitter writes out. `MS_INFO+2` and `MS_INFO+4` are `max_vertices` and `max_primitives`, read straight from the title's blob: the `128, 128` in the module is what the title declares, not a default of ours. - so 264 bytes per vertex and 128 vertices are both the title's numbers, and their product is 33,792 against the host's 32,768. Which makes this a **capability gap between the console's mesh shader and D3D12's**, not a bug in the translation: the title asks for an output budget 3% larger than the host allows, and no flag, signature trim or `max_vertices` adjustment is faithful — every one of those changes what the shader may produce. The honest options are therefore the emulation ones, and they are the maintainer's call, not a pull request I should open unilaterally: 1. **run the mesh shader as two dispatches of 64 vertices** — the shader itself does not change, but whatever binds the draws has to know that one dispatch became two, so it is a scheduler change with a real failure mode (duplicate primitives at the seam); 2. **translate these to compute + draws**, which is what the console's own fallback path may already do for hardware without mesh shaders — worth looking at before writing anything, and #1612 is where that ground is being discussed; 3. **accept the 71** as programs the host cannot run as mesh, and say so where the census reports them, so nobody spends another round on arithmetic that cannot come out. What I would not do is quietly lower `max_vertices` to 124 or drop signature elements to fit: that passes the validator and changes what the shader outputs, which is the kind of green check this repository has been careful to avoid. For the record, of the four classes I have measured this week, this is the only one that is not a defect at all — the other three (195 SGPR addresses, 40 lane-mask-as-data, 36 descriptor-as-data) are features we have not written yet. No game data is involved: counts, offsets and the byte arithmetic. Written with an AI assistant.
Author
Owner

@⁠YouKnowWh on GitHub · 2026-11-25 05:02 UTC · original

Follow-up on whether any of the 867 VS flag failures are selected during a real run. Matching the full input containers to the census and their BLAKE3 prefixes to our archived Windows RTX 5070 Ti logs gives at least 9 distinct first-bound VS hashes in the union. The fxceless runs at 31714deb and 7b0f736 matched 8 and 9 respectively; an older local integration matched 6. These are runtime selections on those builds, not a patched-versus-unpatched game A/B on 940d32f.

One stable pair for capture filtering: VS 2634f1e308bc9ae1 (VS_TransformPreSkin_VfxVBuffer_c6448ed4_Wrapped) + PS 3dc5a8831849e058 (PS_VfxVBuffer_c6448ed4_Wrapped). The two first-bind records have the same title pipeline address and frame within each of the three runs (frames 1615, 1566 and 1645 respectively); all three also log successful host creation of that shader pair.

Offline on 940d32f and with the candidate flags fix, the VS changes from validation failure to pass. DXC dumpbin shows identical function bodies; only the entry flags and corresponding SFI0 feature differ. The PS blobs are byte-identical. Using the two exact saved VS blobs and that same PS in one WARP graphics-PSO harness, both PSOs created. Consequently this is a concrete runtime-selected validation case, not evidence that the metadata fix restores pixels or unblocks a draw. We have no matching draw-completion readback for this pair. No new game run and no game assets attached.

AI-assisted analysis.

**@⁠YouKnowWh** on GitHub · 2026-11-25 05:02 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7153392665) Follow-up on whether any of the 867 VS flag failures are selected during a real run. Matching the full input containers to the census and their BLAKE3 prefixes to our archived Windows RTX 5070 Ti logs gives **at least 9 distinct first-bound VS hashes** in the union. The fxceless runs at 31714deb and 7b0f736 matched 8 and 9 respectively; an older local integration matched 6. These are runtime selections on those builds, not a patched-versus-unpatched game A/B on 940d32f. One stable pair for capture filtering: VS `2634f1e308bc9ae1` (VS_TransformPreSkin_VfxVBuffer_c6448ed4_Wrapped) + PS `3dc5a8831849e058` (PS_VfxVBuffer_c6448ed4_Wrapped). The two first-bind records have the same title pipeline address and frame within each of the three runs (frames 1615, 1566 and 1645 respectively); all three also log successful host creation of that shader pair. Offline on 940d32f and with the candidate flags fix, the VS changes from validation failure to pass. DXC dumpbin shows identical function bodies; only the entry flags and corresponding SFI0 feature differ. The PS blobs are byte-identical. Using the two exact saved VS blobs and that same PS in one WARP graphics-PSO harness, both PSOs created. Consequently this is a concrete runtime-selected validation case, **not evidence that the metadata fix restores pixels or unblocks a draw**. We have no matching draw-completion readback for this pair. No new game run and no game assets attached. AI-assisted analysis.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 09:03 UTC · original

Retested the compute implicit-derivative case on 63bcca43 with Windows SDK dxil.dll 1.9.2602.17 and an RTX 5070 Ti. All five CS_TraceShadowRays variants emitted DXIL and failed validation on that revision. I ported just the compute metadata change from wbkepler’s #306 (dx.valver 1.8 and PSVRuntimeInfo3) for this test.

Variant SDK validation after D3D12 compute PSO after
Eighth, Quarter, Half, FullAdaptive 4/4 pass 4/4 created
Full (07c93bfb77fecebb) pass refused because it requires 64 lanes and the adapter maximum is 32

I adapted the public synthetic example from #306 to store the sampled value to a raw UAV. With the store, implicit samples at [4,8,1] and [8,8,1] fail validation before the metadata change and pass validation and PSO creation after it. Without the store both examples already passed validation on unmodified 63bcca43. A [3,3,1] implicit sample with the store still fails after the change for the expected thread-group shape. An explicit level-zero control emitted byte-identical DXIL before and after.

These are offline validation and PSO-creation results. The five shadow variants were not dispatched in this test.

**@⁠Venom2054** on GitHub · 2026-11-26 09:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7187356019) Retested the compute implicit-derivative case on `63bcca43` with Windows SDK `dxil.dll` 1.9.2602.17 and an RTX 5070 Ti. All five `CS_TraceShadowRays` variants emitted DXIL and failed validation on that revision. I ported just the compute metadata change from wbkepler’s #306 (`dx.valver` 1.8 and `PSVRuntimeInfo3`) for this test. | Variant | SDK validation after | D3D12 compute PSO after | | --- | --- | --- | | Eighth, Quarter, Half, FullAdaptive | 4/4 pass | 4/4 created | | Full (`07c93bfb77fecebb`) | pass | refused because it requires 64 lanes and the adapter maximum is 32 | I adapted the public synthetic example from #306 to **store the sampled value to a raw UAV**. With the store, implicit samples at `[4,8,1]` and `[8,8,1]` fail validation before the metadata change and pass validation and PSO creation after it. Without the store both examples already passed validation on unmodified `63bcca43`. A `[3,3,1]` implicit sample with the store still fails after the change for the expected thread-group shape. An explicit level-zero control emitted byte-identical DXIL before and after. These are offline validation and PSO-creation results. The five shadow variants were not dispatched in this test.
This discussion has been locked. Commenting is limited to contributors.
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#201
No description provided.