tools: rank xshader refusals over ProjectScarlett's recorded requests #29

Manually merged
github merged 1 commit from gh-pr/29/head into gh-pr/29/base 2026-11-26 06:26:18 +00:00
Owner

@⁠NathansDomainSolutions on GitHub · 2026-11-24 04:45 UTC · original
NathansDomainSolutions:tools/scarlett-refusal-triage → main · +257 −0 · 3 files · 1 commits · merged 2026-11-24 04:48 UTC

Refs #16.

Shader preparation and the runtime worker report only a count of refused requests (for example, "1599 unsupported"). This PR adds tools/triage_scarlett_shaders.py, which shows which translator gaps cost the most shaders. That makes it clearer which gaps to fix first.

What it does

  • Runs xshader alone (no DXC/DXV) on every recorded .dxbc, .stencil and .link request. It passes the same flags runtime_shaders.compile_request uses, so its results match the runtime's.
  • Masks program counters, registers and counts in each refusal message, then ranks the messages. A coarser table groups them by instruction or construct.
  • Exit 65 counts as a refusal. Any other non-zero exit counts as a tool or input failure and is listed separately.
  • Read-only. It never writes .unsupported markers, because the runtime compares those files byte-for-byte against the key. The report holds xshader messages and request digests, not shader bytes.
  • About 7 s for the whole corpus on 16 threads.

Current main (b8ee94a) on 9,102 requests recorded through player selection: 4,383 translated, 4,719 refused, 0 failed.

Construct Refused Share
s_load 1,377 29.2%
mimg 1,006 21.3%
wave reduction 736 15.6%
unverified mesh shader bindings 298 6.3%
unmapped descriptor at sN + 0x_ 243 5.1%
unverified EXEC election 225 4.8%
MUBUF with a dynamic SOFFSET is unsupported 131 2.8%
s_buffer_load 124 2.6%
lane op 107 2.3%
mesh root address used as shader data 73 1.5%
buffer_store to a non-UAV table 57 1.2%
raw buffer IDXEN needs the console descriptor stride 55 1.2%
v_readlane 38 0.8%
unsupported DPP16 move 36 0.8%
unsupported typed buffer format N 27 0.6%

Also adds a short "ProjectScarlett refusals" section to docs/SHADERS.md, plus tests/test_triage_scarlett_shaders.py. The 6 new tests use a fake xshader to check message masking, request flags for link and stencil requests, ranking, and that the cache stays untouched. The full Python suite passes (113 tests).

AI disclosure: written with Claude Code. I ran it against my local request corpus and reviewed the output.

🤖 Generated with Claude Code

**@⁠NathansDomainSolutions** on GitHub · 2026-11-24 04:45 UTC · [original](https://github.com/brcly/TuxBox/pull/29) `NathansDomainSolutions:tools/scarlett-refusal-triage` → `main` · +257 −0 · 3 files · 1 commits · merged 2026-11-24 04:48 UTC Refs #16. Shader preparation and the runtime worker report only a count of refused requests (for example, "1599 unsupported"). This PR adds `tools/triage_scarlett_shaders.py`, which shows *which* translator gaps cost the most shaders. That makes it clearer which gaps to fix first. **What it does** - Runs `xshader` alone (no DXC/DXV) on every recorded `.dxbc`, `.stencil` and `.link` request. It passes the same flags `runtime_shaders.compile_request` uses, so its results match the runtime's. - Masks program counters, registers and counts in each refusal message, then ranks the messages. A coarser table groups them by instruction or construct. - Exit 65 counts as a refusal. Any other non-zero exit counts as a tool or input failure and is listed separately. - Read-only. It never writes `.unsupported` markers, because the runtime compares those files byte-for-byte against the key. The report holds xshader messages and request digests, not shader bytes. - About 7 s for the whole corpus on 16 threads. **Current `main` (b8ee94a) on 9,102 requests recorded through player selection:** 4,383 translated, 4,719 refused, 0 failed. | Construct | Refused | Share | | --- | ---: | ---: | | `s_load` | 1,377 | 29.2% | | `mimg` | 1,006 | 21.3% | | `wave reduction` | 736 | 15.6% | | `unverified mesh shader bindings` | 298 | 6.3% | | `unmapped descriptor at sN + 0x_` | 243 | 5.1% | | `unverified EXEC election` | 225 | 4.8% | | `MUBUF with a dynamic SOFFSET is unsupported` | 131 | 2.8% | | `s_buffer_load` | 124 | 2.6% | | `lane op` | 107 | 2.3% | | `mesh root address used as shader data` | 73 | 1.5% | | `buffer_store to a non-UAV table` | 57 | 1.2% | | `raw buffer IDXEN needs the console descriptor stride` | 55 | 1.2% | | `v_readlane` | 38 | 0.8% | | `unsupported DPP16 move` | 36 | 0.8% | | `unsupported typed buffer format N` | 27 | 0.6% | Also adds a short "ProjectScarlett refusals" section to `docs/SHADERS.md`, plus `tests/test_triage_scarlett_shaders.py`. The 6 new tests use a fake xshader to check message masking, request flags for link and stencil requests, ranking, and that the cache stays untouched. The full Python suite passes (113 tests). AI disclosure: written with Claude Code. I ran it against my local request corpus and reviewed the output. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Shader preparation and the runtime worker keep only a count of refused
requests. triage_scarlett_shaders.py runs the HLSL emitter (no DXC) on
each recorded .dxbc, .stencil and .link request with the same flags as
compile_request, masks program counters and registers, and ranks the
refusal messages. It never writes to the shader cache.

On 9,102 requests recorded through player selection: 4,383 translate,
4,719 refuse, 0 fail. Top gaps: s_load dynamic SOFFSET (29%), inline-word
sampler descriptors (19%), wave reductions in divergent control flow (13%).

Refs #16

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:26:16 +00:00
github manually merged commit c9eaf42891 into gh-pr/29/base 2026-11-26 06:26:18 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.