Shader stages 0/8: what evidence would move Compute (and the others) to done? #187

Open
opened 2026-11-26 06:13:14 +00:00 by github-bot · 2 comments
Owner

@⁠MeNoSkills on GitHub · 2026-11-22 22:27 UTC · original

The progress map shows "Shader stages translated" at 0/8: Vertex, Pixel, Compute, Geometry and Mesh are partial, Hull, Domain and Amplification are none (tools/progress/progress.json, counted by gen.py). The label is set by hand, so I would like to understand what would move one of them to done, and where I can help without a game dump.

For the D3D12.x slots the rule in the progress notes is that a slot which runs correctly on PC with no observable problem counts as done, and the remaining console-only effects are documented in BLOCKERS.md. Does the same rule apply to stages? If not, what is the evidence you want per stage (a sweep over a shader pack, a run of a title, hardware tests)?

What I found in the repo and BLOCKERS.md, per stage. Please correct anything that is stale.

Stage Open gaps I can see Can it be closed without a dump?
Compute ds_swizzle_b32 outside pixel shaders (#184 bit/quad, #186 rotate/FFT), PC-relative far jumps (#185). Refused on purpose: ds_gws_sema_p, ds_gws_barrier, ds_gws_sema_release_all, ds_ordered_count, s_sendmsghalt yes, I think this is the closest to done
Pixel ds_swizzle_b32 only in quad mode; MIMG R128/TFE/LWE refused (#114); typed-buffer element type taken from usage, not from the descriptor format (#105) partly
Vertex the s_swappc_b64 call to the fetch shader needs the attribute fetch to be synthesised from the input layout; only about a third of GTA VI vertex shaders translate no
Geometry stream 1-3 s_sendmsg emit/cut (#104) needs stream-output (PSO StreamOutput, PointStream, SO target binding); none of the 3515 cached shaders uses it yes, but costly and not verifiable without a user
Mesh root signature missing (opt-in inference landed in #129), wave-reduction prologue in 16 programs partly
Hull, Domain not translated (the translator returns "stage ... not supported yet") no, needs real shaders
Amplification not translated: the AS leaves only through global stores into the rings, which the translator has no path for, and the per-entry ring addressing and the payload register are unknown no

Questions:

  1. Is the "runs correctly with no observable problem, console-only effects documented" rule the one for stages too? If yes, is a clean run of the exec/mesh/isa_sweep suites on hardware, plus a documented list of refused instructions, enough for Compute?
  2. Do you have shader samples (or fragments, or only their instruction histograms) for Hull, Domain and Amplification? Without them I will not guess an ABI.
  3. For the fetch shader in Vertex: is there a description of how the console runtime builds it that I can test against, or should that wait for a title run?

For context, my hardware runs so far (RTX 4070 Ti, Windows 10 19045, MSVC) are in #157. I have no title dump, so I can only do work that synthetic tests can verify.

**@⁠MeNoSkills** on GitHub · 2026-11-22 22:27 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/187) The progress map shows "Shader stages translated" at 0/8: Vertex, Pixel, Compute, Geometry and Mesh are `partial`, Hull, Domain and Amplification are `none` (`tools/progress/progress.json`, counted by `gen.py`). The label is set by hand, so I would like to understand what would move one of them to `done`, and where I can help without a game dump. For the D3D12.x slots the rule in the progress notes is that a slot which runs correctly on PC with no observable problem counts as done, and the remaining console-only effects are documented in BLOCKERS.md. Does the same rule apply to stages? If not, what is the evidence you want per stage (a sweep over a shader pack, a run of a title, hardware tests)? What I found in the repo and BLOCKERS.md, per stage. Please correct anything that is stale. | Stage | Open gaps I can see | Can it be closed without a dump? | |---|---|---| | Compute | `ds_swizzle_b32` outside pixel shaders (#184 bit/quad, #186 rotate/FFT), PC-relative far jumps (#185). Refused on purpose: `ds_gws_sema_p`, `ds_gws_barrier`, `ds_gws_sema_release_all`, `ds_ordered_count`, `s_sendmsghalt` | yes, I think this is the closest to done | | Pixel | `ds_swizzle_b32` only in quad mode; MIMG R128/TFE/LWE refused (#114); typed-buffer element type taken from usage, not from the descriptor format (#105) | partly | | Vertex | the `s_swappc_b64` call to the fetch shader needs the attribute fetch to be synthesised from the input layout; only about a third of GTA VI vertex shaders translate | no | | Geometry | stream 1-3 `s_sendmsg` emit/cut (#104) needs stream-output (PSO StreamOutput, PointStream, SO target binding); none of the 3515 cached shaders uses it | yes, but costly and not verifiable without a user | | Mesh | root signature missing (opt-in inference landed in #129), wave-reduction prologue in 16 programs | partly | | Hull, Domain | not translated (the translator returns "stage ... not supported yet") | no, needs real shaders | | Amplification | not translated: the AS leaves only through global stores into the rings, which the translator has no path for, and the per-entry ring addressing and the payload register are unknown | no | Questions: 1. Is the "runs correctly with no observable problem, console-only effects documented" rule the one for stages too? If yes, is a clean run of the `exec`/`mesh`/`isa_sweep` suites on hardware, plus a documented list of refused instructions, enough for Compute? 2. Do you have shader samples (or fragments, or only their instruction histograms) for Hull, Domain and Amplification? Without them I will not guess an ABI. 3. For the fetch shader in Vertex: is there a description of how the console runtime builds it that I can test against, or should that wait for a title run? For context, my hardware runs so far (RTX 4070 Ti, Windows 10 19045, MSVC) are in #157. I have no title dump, so I can only do work that synthetic tests can verify.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:13:14 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-22 23:23 UTC · original

Good question. A shader stage counts as done when all of these hold:

  • real titles' shaders of that stage translate;
  • the result validates as DXIL;
  • the shaders create PSOs and render correctly on PC;
  • the oracle/WARP exec tests for that stage pass bit-exact;
  • no BLOCKERS entry is open for that stage.

Unit tests or successful translation alone keep it at partial. You can help without a game dump by:

  • adding bit-exact exec tests for that stage's instructions and edge cases, as #184-#186 did for compute;
  • fixing the BLOCKERS items listed for that stage.
**@⁠omonkeyz** on GitHub · 2026-11-22 23:23 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/187#issuecomment-7087538262) Good question. A shader stage counts as **done** when all of these hold: - real titles' shaders of that stage translate; - the result validates as DXIL; - the shaders create PSOs and render correctly on PC; - the oracle/WARP exec tests for that stage pass bit-exact; - no BLOCKERS entry is open for that stage. Unit tests or successful translation alone keep it at **partial**. You can help without a game dump by: - adding bit-exact exec tests for that stage's instructions and edge cases, as #184-#186 did for compute; - fixing the BLOCKERS items listed for that stage.
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-23 17:17 UTC · original

I reproduced and fixed a scalar NULL-register defect: after s_mov_b32 null, 1, later NULL reads returned 1 instead of zero, contrary to AMD’s RDNA 2 specification.

The attached patch fixes source reads while preserving status-flag updates. Five of six synthetic cases fail before the fix; all six pass afterward on WARP and hardware. Library/opcode tests and contribution checks pass.

Logs are sanitized. This verifies instruction behavior; no console-oracle or title compatibility validation is claimed.

issue-187-scalar-null.patch
issue-187-scalar-null-before.txt
issue-187-scalar-null-after.txt
issue-187-scalar-null-notes.txt

**@⁠BaggyALPHA** on GitHub · 2026-11-23 17:17 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/187#issuecomment-7108445451) I reproduced and fixed a scalar NULL-register defect: after s_mov_b32 null, 1, later NULL reads returned 1 instead of zero, contrary to AMD’s RDNA 2 specification. The attached patch fixes source reads while preserving status-flag updates. Five of six synthetic cases fail before the fix; all six pass afterward on WARP and hardware. Library/opcode tests and contribution checks pass. Logs are sanitized. This verifies instruction behavior; no console-oracle or title compatibility validation is claimed. [issue-187-scalar-null.patch](https://github.com/user-attachments/files/35288323/issue-187-scalar-null.patch) [issue-187-scalar-null-before.txt](https://github.com/user-attachments/files/35288326/issue-187-scalar-null-before.txt) [issue-187-scalar-null-after.txt](https://github.com/user-attachments/files/35288324/issue-187-scalar-null-after.txt) [issue-187-scalar-null-notes.txt](https://github.com/user-attachments/files/35288325/issue-187-scalar-null-notes.txt)
This discussion has been locked. Commenting is limited to contributors.
No description provided.