Shaders, GPU: translate single-stream triangle geometry programs #1315

Open
github-bot wants to merge 7 commits from github-bot/gh-1315 into main AGit
Owner

@⁠r4tedx on GitHub · 2026-11-24 17:21 UTC · original
r4tedx:shader/geometry-programs → main · +1476 −113 · 13 files · 7 commits · open

Console geometry programs are refused today: their GS-to-VS ring addresses look like SGPRs that are no root parameter, and the native stage data of a geometry record was never read. As fiestorra measured on #293, no open PR reaches them. This translates the single-stream triangle case.

What it does

  • native: reads uncompressed FSSM entries (XDAT kind 0x0c; the geometry containers use them) and a geometry record's copy VS and GS-to-VS ring layout (StageIo::Gs).
  • geometry (new): one host GS invocation per console invocation. It follows the LDS offsets of the input vertices packed in v0/v1, the private slice of the ring the invocation writes, and the s_sendmsg emit/cut messages, then uses the copy VS to map each ring dword to the export target and component it ends up in.
  • Emit: DXIL geometry shaders (entry properties, PSV0 state: triangle input, triangle-strip output, stream 0, max vertices). Only the proven ring-address instructions are exempt from root resource tracking (resource::track_io).
  • victory-gpu: host graphics pipelines take a geometry stage (refused together with a mesh stage).

Limits (refused, not guessed):

  • one stream, triangle input only (point, line and adjacency inputs fail the PSV0 check), triangle-strip output, 1 to 1024 vertices;
  • no GS_OP_EMIT_CUT (0x32), no control flow in the GS body, nothing past the copy VS's stream predicate;
  • no system-value GS inputs, and no 16-bit or packed inputs or outputs;
  • no ring reads or exports the copy VS does not explain, and no ring store to a vertex already emitted (the translation takes each slot's value at its EMIT, the console's copy VS reads the ring after the GS ends).

A geometry record whose copy VS or stage data does not parse keeps no stage I/O, and its container's other programs are unaffected. The same goes for an uncompressed entry that is not a valid FSSM, which is skipped as before. The copy record at stage data +0x34 and the ring sizes at +0x27c..+0x28c are not documented anywhere I know of. Two internal checks hold on all 195 geometry programs (vertex_dwords × max_vertices == invocation_dwords, and PSV0's max vertex count equal to +0x284), and they are the evidence for that layout.

Tests

  • Synthetic, hand-assembled (the title was not used in these): emit::geometry_tests::geometry_vertices_match_reference_draw translates a console GS and draws with it, on the hardware adapter and on WARP. It compares the result with the same operation as an HLSL GS compiled by the Windows SDK's dxc.exe (the test skips without the SDK, and says so). geometry_parameters_match_reference_draw does the same for the parameter-export path: input row 1 (TEXCOORD0.xy) goes through ring dwords 4-5, which the copy VS exports as param0 (output table → signature row 1), and the PS writes it into green and blue. On an RTX 5070 and on WARP, both draws equal the reference image (44 of 256 pixels covered). Also tested: raise gives pos0 plus a two-channel param0 from all six input dwords, component order and constants in the copy export, refusal of untraced reads and exports and of a ring store to an emitted vertex, and the parse fallbacks in native.
  • Rebased onto main 940d32f (head 0d45a59); CI passes. Both CI cargo clippy commands with -D warnings are clean locally. Local tests on this head are WARP only, because after a hard PC crash no test here runs on the hardware GPU for now. Geometry and native tests: 23 passed, and both reference draws match on WARP. The victory-shader library on WARP, one thread: 254 passed. 2 failed in synthetic_tests, and those fail the same way on main under VICTORY_WARP=1 (hardware-only checks). Earlier, on 6ddbdfc, cargo test --workspace --locked passed on an RTX 5070 and with VICTORY_WARP=1 (350 passed).
  • Local title-data diagnostic, offline: victory translate --validate, CPU plus dxil.dll, no title launch, no pipelines. It covers 642 containers from the title's shader archive that an earlier build refused, 195 of them geometry programs. Counts only: on main 940d32f all 195 geometry programs stop at an address in an SGPR that is no root parameter (offset 0x44). With 0d45a59 all 195 translate and validate, and nothing that validates on main stops validating.
  • Linking with the title's own vertex stage, the question c4k3ss raised on #293. Offline, with pipeline creation and no draws: each GS_VoxelizeGeneric_<h> was paired with the VS_VoxelizeGeneric_<h> containers of the same technique hash (13 hashes, 195 of each). Their container holds both the ES and the VS payload, and the translation takes the VS. Within a hash, the VS were grouped by output signature and the GS by input signature, and one VS + GS (+ stub PS) pipeline was created per pair of groups. In 12 hashes there is one group of each, and the pipeline is created. Hash 912dfba0 has two of each (2 and 33 members): the size-matched pairs (2 with 2, 33 with 33) link, and so does 33 VS with 2 GS, but the 2 VS with the 33 GS is refused by D3D12. I can't tell from the archive which VS the title pairs with which GS. If the pairs follow the group sizes, every one links.

Where it already runs: the fork's tester tree r4tedx/VIctory integration/testers carries the first two commits since update 8 (d45ea23). The third commit is the follow-up from that tree's review. c4k3ss was about to start a geometry-stage path (#293); this is it, and review or measurements are welcome.

Overlap: main's rectangle-list GS (683ad7a, from #1020) is reused for the DXIL GS state; a pipeline with both a geometry stage and rectangle lists is refused. #1924 (a rebase of #1399) and #877 reach the same 195 programs. The comparison is in #1315. Please take one, not both.

AI-assisted

🤖 Generated with Claude Code

**@⁠r4tedx** on GitHub · 2026-11-24 17:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315) `r4tedx:shader/geometry-programs` → `main` · +1476 −113 · 13 files · 7 commits · open Console geometry programs are refused today: their GS-to-VS ring addresses look like SGPRs that are no root parameter, and the native stage data of a geometry record was never read. As fiestorra measured on #293, no open PR reaches them. This translates the single-stream triangle case. **What it does** - `native`: reads uncompressed FSSM entries (XDAT kind `0x0c`; the geometry containers use them) and a geometry record's copy VS and GS-to-VS ring layout (`StageIo::Gs`). - `geometry` (new): one host GS invocation per console invocation. It follows the LDS offsets of the input vertices packed in v0/v1, the private slice of the ring the invocation writes, and the `s_sendmsg` emit/cut messages, then uses the copy VS to map each ring dword to the export target and component it ends up in. - Emit: DXIL geometry shaders (entry properties, PSV0 state: triangle input, triangle-strip output, stream 0, max vertices). Only the proven ring-address instructions are exempt from root resource tracking (`resource::track_io`). - `victory-gpu`: host graphics pipelines take a geometry stage (refused together with a mesh stage). **Limits (refused, not guessed):** - one stream, triangle input only (point, line and adjacency inputs fail the PSV0 check), triangle-strip output, 1 to 1024 vertices; - no `GS_OP_EMIT_CUT` (`0x32`), no control flow in the GS body, nothing past the copy VS's stream predicate; - no system-value GS inputs, and no 16-bit or packed inputs or outputs; - no ring reads or exports the copy VS does not explain, and no ring store to a vertex already emitted (the translation takes each slot's value at its EMIT, the console's copy VS reads the ring after the GS ends). A geometry record whose copy VS or stage data does not parse keeps no stage I/O, and its container's other programs are unaffected. The same goes for an uncompressed entry that is not a valid FSSM, which is skipped as before. The copy record at stage data `+0x34` and the ring sizes at `+0x27c..+0x28c` are not documented anywhere I know of. Two internal checks hold on all 195 geometry programs (`vertex_dwords × max_vertices == invocation_dwords`, and PSV0's max vertex count equal to `+0x284`), and they are the evidence for that layout. **Tests** - Synthetic, hand-assembled (the title was not used in these): `emit::geometry_tests::geometry_vertices_match_reference_draw` translates a console GS and draws with it, on the hardware adapter and on WARP. It compares the result with the same operation as an HLSL GS compiled by the Windows SDK's `dxc.exe` (the test skips without the SDK, and says so). `geometry_parameters_match_reference_draw` does the same for the parameter-export path: input row 1 (`TEXCOORD0.xy`) goes through ring dwords 4-5, which the copy VS exports as `param0` (output table → signature row 1), and the PS writes it into green and blue. On an RTX 5070 and on WARP, both draws equal the reference image (44 of 256 pixels covered). Also tested: `raise` gives `pos0` plus a two-channel `param0` from all six input dwords, component order and constants in the copy export, refusal of untraced reads and exports and of a ring store to an emitted vertex, and the parse fallbacks in `native`. - Rebased onto main `940d32f` (head `0d45a59`); CI passes. Both CI `cargo clippy` commands with `-D warnings` are clean locally. Local tests on this head are WARP only, because after a hard PC crash no test here runs on the hardware GPU for now. Geometry and `native` tests: 23 passed, and both reference draws match on WARP. The `victory-shader` library on WARP, one thread: 254 passed. 2 failed in `synthetic_tests`, and those fail the same way on main under `VICTORY_WARP=1` (hardware-only checks). Earlier, on `6ddbdfc`, `cargo test --workspace --locked` passed on an RTX 5070 and with `VICTORY_WARP=1` (350 passed). - Local title-data diagnostic, offline: `victory translate --validate`, CPU plus dxil.dll, no title launch, no pipelines. It covers 642 containers from the title's shader archive that an earlier build refused, 195 of them geometry programs. Counts only: on main `940d32f` all 195 geometry programs stop at `an address in an SGPR that is no root parameter` (offset `0x44`). With `0d45a59` all 195 translate and validate, and nothing that validates on main stops validating. - Linking with the title's own vertex stage, the question c4k3ss raised on #293. Offline, with pipeline creation and no draws: each `GS_VoxelizeGeneric_<h>` was paired with the `VS_VoxelizeGeneric_<h>` containers of the same technique hash (13 hashes, 195 of each). Their container holds both the ES and the VS payload, and the translation takes the VS. Within a hash, the VS were grouped by output signature and the GS by input signature, and one VS + GS (+ stub PS) pipeline was created per pair of groups. In 12 hashes there is one group of each, and the pipeline is created. Hash `912dfba0` has two of each (2 and 33 members): the size-matched pairs (2 with 2, 33 with 33) link, and so does 33 VS with 2 GS, but the 2 VS with the 33 GS is refused by D3D12. I can't tell from the archive which VS the title pairs with which GS. If the pairs follow the group sizes, every one links. **Where it already runs:** the fork's tester tree `r4tedx/VIctory` `integration/testers` carries the first two commits since update 8 (`d45ea23`). The third commit is the follow-up from that tree's review. c4k3ss was about to start a geometry-stage path (https://git.gtahub.st/github/Marvisak--VIctory/issues/293); this is it, and review or measurements are welcome. **Overlap:** main's rectangle-list GS (`683ad7a`, from #1020) is reused for the DXIL GS state; a pipeline with both a geometry stage and rectangle lists is refused. #1924 (a rebase of #1399) and #877 reach the same 195 programs. The comparison is in https://git.gtahub.st/github/Marvisak--VIctory/pulls/1315. Please take one, not both. AI-assisted 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Raise the GS-to-VS ring writes and stream messages of a native geometry
program into geometry stage I/O, using the copy VS to map each ring dword
to its export target. Emit DXIL geometry shaders (metadata, PSV state),
exempt the proven ring-address instructions from root resource tracking,
and give host graphics pipelines a geometry slot.

On main: programs build through `range::build` from
`NativeProgram::translation_code` (the patched code, or for a geometry
program the code one host invocation runs, its EXEC set-up a no-op);
resource tracking takes a skip list for the proven ring-address steps
(`track_io`); the DXIL GS state and PSV are main's (`Shader::gs`, as for
the rectangle-list GS); a host pipeline with a geometry stage is refused
for rectangle lists, which keep main's generated GS; a geometry record
whose copy VS or stage data does not parse keeps no stage I/O instead of
failing its container; and rows of geometry inputs that hold an integer
element are constant throughout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An uncompressed (0x0c) XDAT entry that is not a valid FSSM, or lies out
of bounds, is skipped, as all were before they were read, and no longer
costs the container its packed entries. Tests for it, and for a geometry
record whose copy VS points past the payload: it keeps no stage I/O (the
geometry commit's fallback) instead of failing the container.

Review follow-up from the contribution thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From c4k3ss's review of the geometry programs on #293:

- raise takes each ring slot's value at the EMIT that consumes it, while
  the console's copy VS reads the ring after the GS ends. A store to a
  vertex already emitted would translate with the earlier value; it is
  now refused ("a geometry ring store to a vertex already emitted").
- The reference draw ran pos0 only. A second fixture carries input row 1
  (TEXCOORD0.xy, LDS dwords 4-5) in ring dwords 4-5, which the copy VS
  exports as param0 (output table: generic, row 1); it is drawn against
  the dxc-compiled GS with a PS that writes TEXCOORD0 into green and
  blue, and raise is checked to give pos0 plus a two-channel param0 per
  vertex from all six input dwords.
- The draw test says when it skips (no dxc.exe beside dxil.dll, or no
  device) instead of returning silently.

Untested at commit time: waiting for the machine's test queue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two reference draws create a host and draw on the hardware adapter
and WARP without `valu_tests::ONE_AT_A_TIME`, so on CI's WARP adapter
they could dispatch at the same time as the other GPU tests; the run on
6ddbdfc ended with the victory-shader test process dying with
STATUS_ACCESS_VIOLATION and no failing test named, the crash seen before
on #704, #160 and #265 for that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each translated EMIT runs the copy VS's exports for every active
invocation, so an EXEC write in the copy (which would suppress exports
for some lanes) is refused at its instruction. Found and fixed by
ryotdev on f74eab0 (ryotdev/VIctory f64ad72, review on #1315); taken
here on the rebased branch, with the test's program built through
`translation_code`. The test failed before the change and passes after
it (WARP).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A GS that stores all three vertices' ring slots before its first EMIT,
the write batching that made #1399 draw nothing: each EMIT still takes
its own vertex's values (checked through the input reads they come
from). raise takes each slot at the EMIT that consumes it, by its offset
in the invocation's ring, so it needs no change.

Untested at commit time: waiting for the machine's test queue (WARP).

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

@⁠KainanP on GitHub · 2026-11-24 17:52 UTC · original

Tested 6ddbdfc on an RTX 4060 Laptop (driver 32.0.16.1047, Windows 11 26200) and WARP.

  • VICTORY_WARP=1 cargo test --workspace --locked: 350 passed, 0 failed, 6 ignored.
  • Default adapter (RTX), cargo test --workspace --locked: victory-shader --lib died with STATUS_ACCESS_VIOLATION after 218 passing tests.

It is intermittent and only in parallel:

Run of cargo test -p victory-shader --lib --locked on the RTX Crashes
this PR, default threads 2 of 5
main ffe310e, default threads 0 of 4
this PR, --test-threads=1 0 of 1 (128 passed)
this PR, skipping geometry_vertices_match_reference_draw and geometry_parameters_match_reference_draw 0 of 5
this PR, only geometry_tests 0 of 8
this PR + the one-line lock below 0 of 6 (128 passed)

Cause: reference_draw in emit/geometry_tests.rs does not take valu_tests::ONE_AT_A_TIME, whose comment already says two GPU tests at once can end the test process with an access violation, and which the other GPU test modules take. The draw then races with them. Taking the lock fixes it here:

 fn reference_draw(params: bool) {
+    let _one = super::valu_tests::ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner());

The title-side numbers of the PR (195 geometry programs) are untouched by this; it only affects the test run. I have no game copy, so I did not run victory translate.

Tested and written with the help of an AI (Claude Code).

**@⁠KainanP** on GitHub · 2026-11-24 17:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7139828930) Tested `6ddbdfc` on an RTX 4060 Laptop (driver 32.0.16.1047, Windows 11 26200) and WARP. - `VICTORY_WARP=1 cargo test --workspace --locked`: 350 passed, 0 failed, 6 ignored. - Default adapter (RTX), `cargo test --workspace --locked`: **`victory-shader --lib` died with `STATUS_ACCESS_VIOLATION`** after 218 passing tests. It is intermittent and only in parallel: | Run of `cargo test -p victory-shader --lib --locked` on the RTX | Crashes | |---|---| | this PR, default threads | 2 of 5 | | `main` `ffe310e`, default threads | 0 of 4 | | this PR, `--test-threads=1` | 0 of 1 (128 passed) | | this PR, skipping `geometry_vertices_match_reference_draw` and `geometry_parameters_match_reference_draw` | 0 of 5 | | this PR, only `geometry_tests` | 0 of 8 | | this PR + the one-line lock below | **0 of 6** (128 passed) | Cause: `reference_draw` in `emit/geometry_tests.rs` does not take `valu_tests::ONE_AT_A_TIME`, whose comment already says two GPU tests at once can end the test process with an access violation, and which the other GPU test modules take. The draw then races with them. Taking the lock fixes it here: ```diff fn reference_draw(params: bool) { + let _one = super::valu_tests::ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner()); ``` The title-side numbers of the PR (195 geometry programs) are untouched by this; it only affects the test run. I have no game copy, so I did not run `victory translate`. _Tested and written with the help of an AI (Claude Code)._
Author
Owner

@⁠ryotdev on GitHub · 2026-11-24 20:25 UTC · original

I found a copy-shader case on f74eab0 where the generated geometry exports can run for lanes the shader disabled. Prepending s_mov_b32 exec_lo, 0 to the synthetic copy in geometry_part() still returns Streams. The same happens with exec_hi. Both writes change which lanes should export, but the emitted stream has no predicate for that change.

Fix and regression test on your exact head. It reports the unsupported EXEC write at its instruction offset. A control that writes zero to ordinary register s20 still translates.

AI-assisted review. The new test failed before the change and passed after it. The Linux CPU shader library suite passed 103 tests with one ignored. I haven't measured whether a retail draw uses this case.

**@⁠ryotdev** on GitHub · 2026-11-24 20:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7143519882) I found a copy-shader case on `f74eab0` where the generated geometry exports can run for lanes the shader disabled. Prepending `s_mov_b32 exec_lo, 0` to the synthetic copy in `geometry_part()` still returns `Streams`. The same happens with `exec_hi`. Both writes change which lanes should export, but the emitted stream has no predicate for that change. [Fix and regression test on your exact head](https://github.com/ryotdev/VIctory/commit/f64ad72d1f04f0c0595c90151e5379f8d7d2fc6a). It reports the unsupported EXEC write at its instruction offset. A control that writes zero to ordinary register `s20` still translates. AI-assisted review. The new test failed before the change and passed after it. The Linux CPU shader library suite passed 103 tests with one ignored. I haven't measured whether a retail draw uses this case.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:22 UTC · original · edited 2026-11-26 00:25 UTC

Automated triage for the maintainers.

Needs work: it would now break the file-size policy on main. The head is unchanged and still merges without conflicts. However, main has grown crates/victory-shader/src/emit/lower.rs to 520,563 bytes, and with this PR merged it would be 526,553 bytes. That is over the 524,288-byte limit cargo xtask policy enforces (MAX_FILE_SIZE in xtask/src/policy.rs), so CI fails after the merge even though it passed on the PR's own base. Please move this PR's additions to lower.rs (the geometry-stage lowering, about 140 lines) into a submodule such as emit/lower/geometry.rs, or into geometry.rs, so the merged file stays under the limit with some margin. #1271 and #1540 also add to this file.

The substance is as judged before. The ring-address tracing in geometry.rs and the exemption in resource.rs::track_io are narrow. The refusals cover streams other than 0, EMIT_CUT, ring stores after EMIT, and EXEC writes in the copy shader. The synthetic reference draws compare the output with a dxc-compiled GS. An independent corpus count (+195 validated, nothing lost, every other refusal unchanged) matches the author's.

Two smaller points from brainbudt's review, which the author acknowledged: HostPipeline::rectangles (victory-gpu/src/pipeline/host.rs) is true for every geometry stage, not only for the generated rectangle GS, and the specific GS refusal reason can be lost on the fallback path. Please fix the first while you are in the code.

The choice between this PR and #1924 is still open for the maintainers. Push the split and this will be reviewed again.

CI: passing on the PR's own base (it would fail the policy check once merged with current main).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7149476257) · edited 2026-11-26 00:25 UTC <!-- victory-triage v1 head=0d45a59e5d2c080b51a59dc01b351b93f31e06c6 verdict=needs-work at=2026-11-26T00:25:26Z --> Automated triage for the maintainers. **Needs work: it would now break the file-size policy on `main`.** The head is unchanged and still merges without conflicts. However, `main` has grown `crates/victory-shader/src/emit/lower.rs` to 520,563 bytes, and with this PR merged it would be 526,553 bytes. That is over the 524,288-byte limit `cargo xtask policy` enforces (`MAX_FILE_SIZE` in `xtask/src/policy.rs`), so CI fails after the merge even though it passed on the PR's own base. Please move this PR's additions to `lower.rs` (the geometry-stage lowering, about 140 lines) into a submodule such as `emit/lower/geometry.rs`, or into `geometry.rs`, so the merged file stays under the limit with some margin. #1271 and #1540 also add to this file. The substance is as judged before. The ring-address tracing in `geometry.rs` and the exemption in `resource.rs::track_io` are narrow. The refusals cover streams other than 0, `EMIT_CUT`, ring stores after EMIT, and EXEC writes in the copy shader. The synthetic reference draws compare the output with a dxc-compiled GS. An independent corpus count (+195 validated, nothing lost, every other refusal unchanged) matches the author's. Two smaller points from brainbudt's review, which the author acknowledged: `HostPipeline::rectangles` (`victory-gpu/src/pipeline/host.rs`) is true for every geometry stage, not only for the generated rectangle GS, and the specific GS refusal reason can be lost on the fallback path. Please fix the first while you are in the code. The choice between this PR and #1924 is still open for the maintainers. Push the split and this will be reviewed again. CI: passing on the PR's own base (it would fail the policy check once merged with current `main`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

One family, one instruction: 196 geometry programs that all stop at offset 0x44 on an address in an SGPR

Census over a local 1.0.2.1 archive (26,503 containers, victory translate --validate --list --jobs 10 on main 940d32f plus #2016 and #2027), looking at the "an address in an SGPR that is no root parameter" refusals, which are 196 programs:

programs 196
stage 196 × Gs, no other stage
name 196 × GS_VoxelizeGeneric_*, one family
refusal offset 196 × 0x44, the same instruction in every one

Two things fall out of that, and the second is the useful one for the work in this issue:

  • it is not 196 geometry shaders with 196 problems: it is one shader family, so a fix either covers all of them or none, and the census will say which in a single number;
  • they all fail on the same instruction, early (0x44, seventeen dwords in). So the first thing these programs do is compute an address in an SGPR that the translator will not take, and the rest of the program is never reached. Making geometry shaders translate without addressing that instruction will move 196 programs from "resources: an address in an SGPR that is no root parameter" to the same message, one line later in the log.

The code that refuses them is crates/victory-shader/src/resource.rs::why_no_base, and the branch is the one that answers "an address in an SGPR that is no root parameter" — the value's base is a shader input SGPR rather than a root parameter. #710 (closed) and #139 are the neighbours of this ground: reading through an address the console spilled somewhere, versus an address that arrives as input.

What I have not done: read the instruction at 0x44, or checked whether the family is single-stream triangles (which would put it under this issue's scope) or something else. Both are cheap with a --disasm pass over the pack and I did not run it; I would rather report the shape I measured than guess at the instruction.

If it helps whoever is on #877/#1924: the number to watch is that 196, and one program of the family is enough to iterate on, since they all stop in the same place.

No game data is involved: counts, stage letters, program names and an offset.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 04:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7152621215) **One family, one instruction: 196 geometry programs that all stop at offset `0x44` on an address in an SGPR** Census over a local 1.0.2.1 archive (26,503 containers, `victory translate --validate --list --jobs 10` on `main` `940d32f` plus #2016 and #2027), looking at the "an address in an SGPR that is no root parameter" refusals, which are 196 programs: | | | |---|---| | programs | **196** | | stage | **196 × `Gs`**, no other stage | | name | **196 × `GS_VoxelizeGeneric_*`**, one family | | refusal offset | **196 × `0x44`**, the same instruction in every one | Two things fall out of that, and the second is the useful one for the work in this issue: - it is not 196 geometry shaders with 196 problems: it is **one shader family**, so a fix either covers all of them or none, and the census will say which in a single number; - they all fail on the **same instruction, early** (`0x44`, seventeen dwords in). So the first thing these programs do is compute an address in an SGPR that the translator will not take, and the rest of the program is never reached. Making geometry shaders translate without addressing that instruction will move 196 programs from "resources: an address in an SGPR that is no root parameter" to the same message, one line later in the log. The code that refuses them is `crates/victory-shader/src/resource.rs::why_no_base`, and the branch is the one that answers "an address in an SGPR that is no root parameter" — the value's base is a **shader input SGPR** rather than a root parameter. `#710` (closed) and `#139` are the neighbours of this ground: reading through an address the console spilled somewhere, versus an address that arrives as input. What I have not done: read the instruction at `0x44`, or checked whether the family is single-stream triangles (which would put it under this issue's scope) or something else. Both are cheap with a `--disasm` pass over the pack and I did not run it; I would rather report the shape I measured than guess at the instruction. If it helps whoever is on #877/#1924: the number to watch is that **196**, and one program of the family is enough to iterate on, since they all stop in the same place. No game data is involved: counts, stage letters, program names and an offset. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 04:36 UTC · original

The address is not an instruction: it is SGPR 2, which has no producer — all 195 of them

I said in the comment above that reading the instruction at 0x44 was cheap with a --disasm pass. Two things to correct and one to add.

Correction, my invocation. My first attempt reported containers found 0, which was my own Start-Process splitting the path on its spaces, not the tool: victory shader-info <pack> does read this pack (26,503 containers, all with a DXIL part).

Correction, the method. --disasm over the whole pack is the wrong tool for one family: the dump passes 1 GB before reaching GS_VoxelizeGeneric and I stopped it there. It would tell me the instruction eventually, at the cost of a gigabyte of game-derived text on disk to answer a question a print answers.

What answers it instead, and it is the useful part: a two-line probe at the refusal site in resource.rs::why_no_base — printing the SGPR index and the defining instruction of the value that is refused — run over the same census:

195 x SONDA sgpr=2 inst=None

All 195 refusals are the same value: SGPR 2, and it has no defining instruction. That is not "an instruction we cannot lower" — it is an incoming register. In a geometry shader the SGPRs on entry are whatever the host set before invoking it, so the program is taking a memory base straight out of an input register and the address analysis refuses it because that base is not a root parameter in the layout we build for the stage.

That fits the offset too: 0x44 is early because there is nothing to compute — the first thing the program does with that register is use it as an address.

So the question for this issue is not "which instruction should we lower" but "what does SGPR 2 hold for a GS_VoxelizeGeneric program", which the container's stage data answers (the same place ms_io/vs_io read their input layouts from). If it is the primitive's vertex-data pointer, the fix is a layout entry for the geometry stage — a much smaller thing than addressing support, and it would move all 195 at once.

I have not gone further than that: reading the GS input layout is the next step and it needs the native stage data for that container, which is where I stopped.

No game data is involved: an SGPR index, an instruction-name lookup and counts.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 04:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7153001073) **The address is not an instruction: it is SGPR 2, which has no producer — all 195 of them** I said in the comment above that reading the instruction at `0x44` was cheap with a `--disasm` pass. Two things to correct and one to add. **Correction, my invocation.** My first attempt reported `containers found 0`, which was my own `Start-Process` splitting the path on its spaces, not the tool: `victory shader-info <pack>` does read this pack (26,503 containers, all with a DXIL part). **Correction, the method.** `--disasm` over the whole pack is the wrong tool for one family: the dump passes **1 GB before reaching `GS_VoxelizeGeneric`** and I stopped it there. It would tell me the instruction eventually, at the cost of a gigabyte of game-derived text on disk to answer a question a print answers. **What answers it instead**, and it is the useful part: a two-line probe at the refusal site in `resource.rs::why_no_base` — printing the SGPR index and the defining instruction of the value that is refused — run over the same census: ``` 195 x SONDA sgpr=2 inst=None ``` All 195 refusals are the same value: **SGPR 2, and it has no defining instruction**. That is not "an instruction we cannot lower" — it is an **incoming register**. In a geometry shader the SGPRs on entry are whatever the host set before invoking it, so the program is taking a memory base straight out of an input register and the address analysis refuses it because that base is not a root parameter in the layout we build for the stage. That fits the offset too: `0x44` is early because there is nothing to compute — the first thing the program does with that register is use it as an address. So the question for this issue is not "which instruction should we lower" but **"what does SGPR 2 hold for a `GS_VoxelizeGeneric` program"**, which the container's stage data answers (the same place `ms_io`/`vs_io` read their input layouts from). If it is the primitive's vertex-data pointer, the fix is a layout entry for the geometry stage — a much smaller thing than addressing support, and it would move all 195 at once. I have not gone further than that: reading the GS input layout is the next step and it needs the native stage data for that container, which is where I stopped. No game data is involved: an SGPR index, an instruction-name lookup and counts. Written with an AI assistant.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 04:42 UTC · original

Rebased onto main 940d32f, head 0d45a59, and CI passes there. Main moved in two ways this had to fit:

  • Programs now build through range::build, so this adds NativeProgram::translation_code: the patched code, or for a GS the code one host invocation runs, with its EXEC set-up as a no-op.
  • Main has its own GS emission for rectangle lists (683ad7a), and the console GS now uses it (Shader::gs, same entry state and PSV fields). A pipeline with both a geometry stage and rectangle lists is refused; rectangle lists keep main's generated GS.

@⁠KainanP your diagnosis of the parallel crash was right. The lock is f74eab0, still in. Thank you for the A/B table.

@⁠ryotdev reproduced on the rebased head: your test fails without the change and passes with it (WARP). It's taken as 5d307cd under your authorship, with the test's program now built through translation_code.

@⁠fiestorra yes. Offline count on 0d45a59: CPU plus dxil.dll, no title launch, local copy. All 195 GS_VoxelizeGeneric_* programs in my set validate. On main they stop at 0x44 with an address in an SGPR that is no root parameter. That instruction is the start of the GS-to-VS ring address: s[8:9] (the high half masked to 0xff), then s_load_dword +0xb8, then a shift by 8, plus the wave offset in s2, plus lane × stride. c4k3ss read it the same way on #293. geometry.rs traces it and exempts exactly those steps from root-parameter tracking. My set has 195 of the family, yours 196, and I can't check the one I don't have.

Compared with the other two geometry efforts. Same 642 containers, same command (victory translate --validate --list, CPU plus dxil.dll), each branch's own build:

branch geometry programs validated lost vs main 940d32f other
this PR, 0d45a59 195 0
#1924, 1aa7225 195 0 also 20 VS_*Transform*_VfxVBuffer* vertex programs (Flags must match usage on main), which is independent of geometry
#877, 828f825 195 271 still on ffe310e, so not a fair comparison until it is rebased

So the counts tie. The difference is in what each refuses rather than guesses. #1924's own description lists four open risks from its review thread. Here is how this PR handles each:

  • LDS layout assumed to follow signature rows rather than param slots: here each ring dword's export target and component come from the copy VS's own code (its ds_read offsets, exp targets and its output table), not from the signature.
  • Silent defaults for missing PSV0 geometry state: here PSV0 must say triangle in, triangle strip out, stream 0, with its max vertex count equal to the stage data's, or the program is refused.
  • Non-zero streams with no host consumer: refused here (stream config [1, 0], EMIT and CUT on stream 0 only, no EMIT_CUT).
  • A write whose signature row is missing being dropped: refused here (a geometry output missing from the copy exports, a geometry output signature row).

It also refuses a ring store to a vertex already emitted and an EXEC write in the copy (ryotdev's). It covers the write batching that #1924's second commit fixes, with a test (ring_writes_batched_before_the_emits_stay_with_their_vertex). That needed no code change here, because each EMIT reads its vertex's slots by their offset in the invocation's ring.

For #1924, whose description says its Windows GPU tests had not run: I ran emit::tests::merged_geometry_stages_draw_their_triangle at 1aa7225 on WARP (VICTORY_WARP=1, one thread). It passes, with 496 lit pixels both interleaved and batched. That's WARP only, not hardware.

My suggestion to the maintainers: take one of the two, not both. If #1924 is the one, I can port these refusals onto it. Its 20 vertex programs are worth taking either way.

Tests on 0d45a59. Local runs are WARP only today: after a hard PC crash, no test here runs on the hardware GPU until it is understood.

  • Geometry and native tests: 23 passed. Both reference draws equal the dxc-compiled GS on WARP (44 of 256 pixels), including the param0 path.
  • victory-shader library on WARP, one thread: 254 passed. Two failed: synthetic_tests::gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out. They fail the same way on main 940d32f under VICTORY_WARP=1, because they are hardware-only checks.
  • victory-gpu was not run locally, because its host takes the default adapter. CI covers it.

The title was used only for the offline counts above (counts and reasons only); none of the tests use it.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 04:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7153094143) Rebased onto main `940d32f`, head `0d45a59`, and CI passes there. Main moved in two ways this had to fit: - Programs now build through `range::build`, so this adds `NativeProgram::translation_code`: the patched code, or for a GS the code one host invocation runs, with its EXEC set-up as a no-op. - Main has its own GS emission for rectangle lists (`683ad7a`), and the console GS now uses it (`Shader::gs`, same entry state and PSV fields). A pipeline with both a geometry stage and rectangle lists is refused; rectangle lists keep main's generated GS. **@⁠KainanP** your diagnosis of the parallel crash was right. The lock is `f74eab0`, still in. Thank you for the A/B table. **@⁠ryotdev** reproduced on the rebased head: your test fails without the change and passes with it (WARP). It's taken as `5d307cd` under your authorship, with the test's program now built through `translation_code`. **@⁠fiestorra** yes. Offline count on `0d45a59`: CPU plus dxil.dll, no title launch, local copy. All 195 `GS_VoxelizeGeneric_*` programs in my set validate. On main they stop at `0x44` with `an address in an SGPR that is no root parameter`. That instruction is the start of the GS-to-VS ring address: `s[8:9]` (the high half masked to `0xff`), then `s_load_dword +0xb8`, then a shift by 8, plus the wave offset in `s2`, plus lane × stride. c4k3ss read it the same way on #293. `geometry.rs` traces it and exempts exactly those steps from root-parameter tracking. My set has 195 of the family, yours 196, and I can't check the one I don't have. **Compared with the other two geometry efforts.** Same 642 containers, same command (`victory translate --validate --list`, CPU plus dxil.dll), each branch's own build: | branch | geometry programs validated | lost vs main `940d32f` | other | |---|---|---|---| | this PR, `0d45a59` | 195 | 0 | | | #1924, `1aa7225` | 195 | 0 | also 20 `VS_*Transform*_VfxVBuffer*` vertex programs (`Flags must match usage` on main), which is independent of geometry | | #877, `828f825` | 195 | 271 | still on `ffe310e`, so not a fair comparison until it is rebased | So the counts tie. The difference is in what each refuses rather than guesses. #1924's own description lists four open risks from its review thread. Here is how this PR handles each: - LDS layout assumed to follow signature rows rather than `param` slots: here each ring dword's export target and component come from the copy VS's own code (its `ds_read` offsets, `exp` targets and its output table), not from the signature. - Silent defaults for missing PSV0 geometry state: here PSV0 must say triangle in, triangle strip out, stream 0, with its max vertex count equal to the stage data's, or the program is refused. - Non-zero streams with no host consumer: refused here (stream config `[1, 0]`, EMIT and CUT on stream 0 only, no `EMIT_CUT`). - A write whose signature row is missing being dropped: refused here (`a geometry output missing from the copy exports`, `a geometry output signature row`). It also refuses a ring store to a vertex already emitted and an EXEC write in the copy (ryotdev's). It covers the write batching that #1924's second commit fixes, with a test (`ring_writes_batched_before_the_emits_stay_with_their_vertex`). That needed no code change here, because each EMIT reads its vertex's slots by their offset in the invocation's ring. For #1924, whose description says its Windows GPU tests had not run: I ran `emit::tests::merged_geometry_stages_draw_their_triangle` at `1aa7225` on WARP (`VICTORY_WARP=1`, one thread). It passes, with 496 lit pixels both interleaved and batched. That's WARP only, not hardware. My suggestion to the maintainers: take one of the two, not both. If #1924 is the one, I can port these refusals onto it. Its 20 vertex programs are worth taking either way. **Tests on `0d45a59`.** Local runs are WARP only today: after a hard PC crash, no test here runs on the hardware GPU until it is understood. - Geometry and `native` tests: 23 passed. Both reference draws equal the dxc-compiled GS on WARP (44 of 256 pixels), including the param0 path. - `victory-shader` library on WARP, one thread: 254 passed. Two failed: `synthetic_tests::gathers_at_a_level_match_the_hardware` and `permutes_read_the_lane_named_and_zero_from_lanes_left_out`. They fail the same way on main `940d32f` under `VICTORY_WARP=1`, because they are hardware-only checks. - `victory-gpu` was not run locally, because its host takes the default adapter. CI covers it. The title was used only for the offline counts above (counts and reasons only); none of the tests use it. AI-assisted
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 06:07 UTC · original

The two reference draws on 0d45a59 ran with the D3D12 debug layer enabled, on WARP. It was the first time on this PC: the layer was installed today.

victory-shader's test host never enabled the debug layer, so I ran the two tests with a local diagnostic patch, not part of this PR. With VICTORY_D3D12_DEBUG=1 the patch enables the layer before the device is created, then reads the device's info queue after each draw. The info queue was present and held 0 messages after every draw, of any severity. The translated GS, with pos0 only and with the param0 export, drew the same image as the dxc-compiled reference both times (44 of 256 pixels).

This was WARP only; the hardware GPU here is off-limits for tests for now. GPU-based validation was not turned on. The title was not used in these tests.

If a debug-layer switch for the shader tests' host is wanted upstream, I can open it as a small separate PR.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 06:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7154466101) The two reference draws on `0d45a59` ran with the D3D12 debug layer enabled, on WARP. It was the first time on this PC: the layer was installed today. `victory-shader`'s test host never enabled the debug layer, so I ran the two tests with a local diagnostic patch, not part of this PR. With `VICTORY_D3D12_DEBUG=1` the patch enables the layer before the device is created, then reads the device's info queue after each draw. The info queue was present and held 0 messages after every draw, of any severity. The translated GS, with `pos0` only and with the `param0` export, drew the same image as the dxc-compiled reference both times (44 of 256 pixels). This was WARP only; the hardware GPU here is off-limits for tests for now. GPU-based validation was not turned on. The title was not used in these tests. If a debug-layer switch for the shader tests' host is wanted upstream, I can open it as a small separate PR. AI-assisted
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 06:44 UTC · original

@⁠fiestorra a follow-up to "my set has 195, yours 196".

A full-archive list of main 940d32f (26,503 containers, victory translate --validate --list, CPU plus dxil.dll, local copy) has exactly 195 GS_VoxelizeGeneric_* programs, each refused at 0x44. The 196th match in a line count is the list's own summary block: 195 resources: an address in an SGPR that is no root parameter (e.g. …@0xbdcce29 GS_VoxelizeGeneric_f406ea93_Wrapped Gs at 0x44). That's the same summary-block effect you described on #878. So the family is 195, and all 195 validate with this PR.

The title was used only for that offline list (counts, names and offsets).

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 06:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7155102702) @⁠fiestorra a follow-up to "my set has 195, yours 196". A full-archive list of main `940d32f` (26,503 containers, `victory translate --validate --list`, CPU plus dxil.dll, local copy) has exactly 195 `GS_VoxelizeGeneric_*` programs, each refused at `0x44`. The 196th match in a line count is the list's own summary block: `195 resources: an address in an SGPR that is no root parameter (e.g. …@0xbdcce29 GS_VoxelizeGeneric_f406ea93_Wrapped Gs at 0x44)`. That's the same summary-block effect you described on #878. So the family is 195, and all 195 validate with this PR. The title was used only for that offline list (counts, names and offsets). AI-assisted
Author
Owner

@⁠brainbudt on GitHub · 2026-11-25 20:29 UTC · original

Note

🤖 Gemini 4 Neon (with GPT-6.2 Astra, Mistral Large 4, and DeepSeek V4.1 Flash) responding on behalf of brainbudt

Independently verified 0d45a59 and its clean merge onto 13f91ca. No merge blockers found for single-stream triangles.

  • Windows WARP + DXIL Validator (1.9.2609.5): all 8 geometry tests passed; both translated shaders validated and matched the complete DXC reference images pixel for pixel (44/256 pixels covered). Repeating both draws with all three vertices written before the first EMIT also matched. (Synthetic fixtures only; no physical GPU or retail assets.)
  • Windows MSVC workspace check: cargo check --workspace --target x86_64-pc-windows-msvc --tests passed.
  • Linux x86-64: exact PR head passed 152 tests (2 ignored); guarding the three pre-existing Windows-validator tests on the merge gave 166 passed (2 ignored).

Two small follow-ups (non-blocking):

  1. HostPipeline::rectangles (crates/victory-gpu/src/pipeline/host.rs:697) is currently set to true for every translated GS rather than only the synthesized rectangle shader.
  2. When GS analysis rejects a shader (e.g., ring write after EMIT), the fallback path surfaces a generic SGPR error instead of preserving the specific GS refusal reason.
**@⁠brainbudt** on GitHub · 2026-11-25 20:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7173738801) > [!NOTE] > 🤖 **Gemini 4 Neon (with GPT-6.2 Astra, Mistral Large 4, and DeepSeek V4.1 Flash) responding on behalf of brainbudt** Independently verified `0d45a59` and its clean merge onto `13f91ca`. No merge blockers found for single-stream triangles. - **Windows WARP + DXIL Validator (`1.9.2609.5`):** all 8 geometry tests passed; both translated shaders validated and matched the complete DXC reference images pixel for pixel (44/256 pixels covered). Repeating both draws with all three vertices written before the first `EMIT` also matched. (Synthetic fixtures only; no physical GPU or retail assets.) - **Windows MSVC workspace check:** `cargo check --workspace --target x86_64-pc-windows-msvc --tests` passed. - **Linux x86-64:** exact PR head passed 152 tests (2 ignored); guarding the three pre-existing Windows-validator tests on the merge gave 166 passed (2 ignored). Two small follow-ups (non-blocking): 1. `HostPipeline::rectangles` (`crates/victory-gpu/src/pipeline/host.rs:697`) is currently set to `true` for every translated GS rather than only the synthesized rectangle shader. 2. When GS analysis rejects a shader (e.g., ring write after `EMIT`), the fallback path surfaces a generic SGPR error instead of preserving the specific GS refusal reason.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 20:32 UTC · original

@⁠brainbudt thanks for the independent run on 0d45a59 and the merge onto 13f91ca.

  1. HostPipeline::rectangles: confirmed. At crates/victory-gpu/src/pipeline/host.rs:697 it is !gs.is_empty(), so it is also true for a translated GS. Today that should not reach a rectangle draw: a translated GS on a rectangle-list pipeline is refused (host.rs:616), and the console topology type is part of the pipeline's key (GraphicsState::describe). But completes_rectangles (draw.rs:1425) checks the draw's topology against the bound pipeline's flag, so the flag should mean what its doc says. I'll set it only for the synthesized rectangle_gs case in a follow-up commit on this branch.
  2. GS refusal reason on fallback: not checked yet. I'll look at which error the fallback reports when GS analysis refuses (for example, a ring write after EMIT), and keep the specific reason if it is being lost.

Both after the current queue on this PC drains. I'll post the head and test counts here when they are done.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 20:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7173816059) @⁠brainbudt thanks for the independent run on `0d45a59` and the merge onto `13f91ca`. 1. `HostPipeline::rectangles`: confirmed. At `crates/victory-gpu/src/pipeline/host.rs:697` it is `!gs.is_empty()`, so it is also true for a translated GS. Today that should not reach a rectangle draw: a translated GS on a rectangle-list pipeline is refused (`host.rs:616`), and the console topology type is part of the pipeline's key (`GraphicsState::describe`). But `completes_rectangles` (`draw.rs:1425`) checks the draw's topology against the bound pipeline's flag, so the flag should mean what its doc says. I'll set it only for the synthesized `rectangle_gs` case in a follow-up commit on this branch. 2. GS refusal reason on fallback: not checked yet. I'll look at which error the fallback reports when GS analysis refuses (for example, a ring write after `EMIT`), and keep the specific reason if it is being lost. Both after the current queue on this PC drains. I'll post the head and test counts here when they are done. AI-assisted
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-25 21:03 UTC · original

Offline corpus measurement: this clears the whole an address in an SGPR that is no root parameter bucket — 195 programs recovered, none lost.

Merged onto main 13f91ca (clean merge), rebuilt, and run over the shipped shader archive with the same method and validator as the census on #1481: translate <archive> --list --validate --jobs 6, official DXC archive dxil.dll (1.8), release build, RTX 3080 / Windows 11 26300.

emitted of validated resources tracked address in an SGPR that is no root parameter
main 13f91ca 25,665 25,694 24,846 25,889 / 26,084 195
+ this PR 25,860 25,889 25,041 26,084 / 26,084 0
+195 +195 +195 +195 −195

Every other refusal is byte-identical to main: the 748 compute entry-point rejections, the 71 mesh output-budget ones, and the emit tail (13 / 8 / 5 / 1 / 1 / 1) all unchanged. So the 195 are recovered and nothing is traded for them.

The mechanism matches @⁠kotekompotek's decode of that bucket: all 195 are one geometry program family failing at the same instruction, and the tracker refusal is only the first wall — on main the census contains no Gs programs at all (12,051 Ps, 8,765 Ms, 2,658 Cs, 2,191 Vs, 0 Gs). With this PR 195 Gs appear, emit and validate, and the DXIL line itself changes to "vertex, geometry and pixel". That is a stage path arriving, not a tracker being loosened.

Worth stating for whoever triages the cluster: on current main this bucket is the second-largest translator-side gap after the 748 (#1065), and of the pull requests that quote its refusal string this is the one that actually moves it — I measured #2387, #2546, #2154 and #2295 the same way earlier today and none of them changes any count (results).

Not measured here: host pipeline creation (the census makes none, 0 pipelines in both rows), anything at runtime, and whether the geometry output is correct — this says the programs translate and validate, not that they draw the right thing. Counts and validator strings only, no program names, hashes or paths.

AI-assisted (Claude Code); both rows from the runs described.

**@⁠BaggyALPHA** on GitHub · 2026-11-25 21:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7174548313) **Offline corpus measurement: this clears the whole `an address in an SGPR that is no root parameter` bucket — 195 programs recovered, none lost.** Merged onto `main` `13f91ca` (clean merge), rebuilt, and run over the shipped shader archive with the same method and validator as the census on #1481: `translate <archive> --list --validate --jobs 6`, official DXC archive `dxil.dll` (1.8), release build, RTX 3080 / Windows 11 26300. | | emitted | of | validated | resources tracked | `address in an SGPR that is no root parameter` | |---|---:|---:|---:|---:|---:| | `main` `13f91ca` | 25,665 | 25,694 | 24,846 | 25,889 / 26,084 | **195** | | + this PR | 25,860 | 25,889 | 25,041 | **26,084 / 26,084** | **0** | | | +195 | +195 | **+195** | +195 | **−195** | Every other refusal is byte-identical to `main`: the 748 compute entry-point rejections, the 71 mesh output-budget ones, and the emit tail (13 / 8 / 5 / 1 / 1 / 1) all unchanged. So the 195 are recovered and nothing is traded for them. The mechanism matches @⁠kotekompotek's [decode of that bucket](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633): all 195 are one geometry program family failing at the same instruction, and the tracker refusal is only the first wall — on `main` the census contains **no `Gs` programs at all** (12,051 `Ps`, 8,765 `Ms`, 2,658 `Cs`, 2,191 `Vs`, 0 `Gs`). With this PR 195 `Gs` appear, emit and validate, and the DXIL line itself changes to "vertex, geometry and pixel". That is a stage path arriving, not a tracker being loosened. Worth stating for whoever triages the cluster: on current `main` this bucket is the second-largest translator-side gap after the 748 (#1065), and of the pull requests that quote its refusal string this is the one that actually moves it — I measured #2387, #2546, #2154 and #2295 the same way earlier today and none of them changes any count ([results](https://git.gtahub.st/github/Marvisak--VIctory/issues/1481)). Not measured here: host pipeline creation (the census makes none, `0 pipelines` in both rows), anything at runtime, and whether the geometry output is *correct* — this says the programs translate and validate, not that they draw the right thing. Counts and validator strings only, no program names, hashes or paths. AI-assisted (Claude Code); both rows from the runs described.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 21:04 UTC · original

@⁠BaggyALPHA thank you. An independent count on current main with the archive validator is what this PR lacked. Your +195, 0 lost, with every other refusal unchanged, matches our own offline count of the same programs: local title data, CPU only, counts only.

On what isn't measured, you're right. The PR's own evidence for correct output is the synthetic reference draws in emit/geometry_tests.rs: hand-assembled programs checked against a dxc-compiled reference geometry shader by rasterized coverage, on WARP and under the D3D12 debug layer with 0 messages. None of that comes from the title. The open question for the maintainers is still the one in the triage: this PR or #1924, which covers the same 195.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 21:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7174581039) @⁠BaggyALPHA thank you. An independent count on current `main` with the archive validator is what this PR lacked. Your +195, 0 lost, with every other refusal unchanged, matches our own offline count of the same programs: local title data, CPU only, counts only. On what isn't measured, you're right. The PR's own evidence for correct output is the synthetic reference draws in `emit/geometry_tests.rs`: hand-assembled programs checked against a dxc-compiled reference geometry shader by rasterized coverage, on WARP and under the D3D12 debug layer with 0 messages. None of that comes from the title. The open question for the maintainers is still the one in the triage: this PR or #1924, which covers the same 195. AI-assisted
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 15:04 UTC · original

Tested 0d45a59 on a physical RTX 5070 Ti. I used the vertex, geometry and pixel program IDs recorded together in each effect pass to check which pairs the title declares. This resolves the pairing question for technique 912dfba0 in the PR description.

  • All 35 declared VS/GS pairs in that technique created a D3D12 pipeline with the test pixel shader. As a negative control I crossed all 35 vertex stages with all 35 geometry stages. D3D12 refused 66 of the 1,225 combinations, all outside the declared pairs.
  • Across the full family, all 195 declared VS/GS pairs linked with the test pixel shader. All 294 distinct declared VS/GS/PS triples also linked with their actual pixel shader via Host::geometry_pipeline. Windows DXIL validation passed for the 195 vertex, 195 geometry and 294 pixel containers used here.
  • Both synthetic reference draws in emit::geometry_tests matched their DXC reference on hardware and WARP, with 44 of 256 pixels covered in each case.

These are offline pipeline-creation results for the title combinations. Pixel readback was measured on the two synthetic draws only.

**@⁠Venom2054** on GitHub · 2026-11-26 15:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7195744334) Tested `0d45a59` on a physical RTX 5070 Ti. I used the vertex, geometry and pixel program IDs recorded together in each effect pass to check which pairs the title declares. This resolves the pairing question for technique `912dfba0` in the PR description. - All 35 declared VS/GS pairs in that technique created a D3D12 pipeline with the test pixel shader. As a negative control I crossed all 35 vertex stages with all 35 geometry stages. D3D12 refused 66 of the 1,225 combinations, all outside the declared pairs. - Across the full family, all 195 declared VS/GS pairs linked with the test pixel shader. All 294 distinct declared VS/GS/PS triples also linked with their actual pixel shader via `Host::geometry_pipeline`. Windows DXIL validation passed for the 195 vertex, 195 geometry and 294 pixel containers used here. - Both synthetic reference draws in `emit::geometry_tests` matched their DXC reference on hardware and WARP, with 44 of 256 pixels covered in each case. These are offline pipeline-creation results for the title combinations. Pixel readback was measured on the two synthetic draws only.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1315/head:github-bot/gh-1315'
git switch 'github-bot/gh-1315'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1315'
git switch 'github-bot/gh-1315'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1315'
git switch 'github-bot/gh-1315'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1315'
git switch 'main'
git merge --squash 'github-bot/gh-1315'
git switch 'main'
git merge --ff-only 'github-bot/gh-1315'
git switch 'main'
git merge 'github-bot/gh-1315'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

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