Shader count reconciliation: 24,064 programs, 26,503 programs and 25,043 streams — what does each count? #36

Closed
opened 2026-11-26 04:05:32 +00:00 by github-bot · 3 comments
Owner

@⁠JoshRob297 on GitHub · 2026-11-22 14:43 UTC · original

Three projects now publish a "shader count" for the same retail package, and the numbers differ
enough that a reader could think someone is wrong:

project published count wording
xcl 24,064 "all 24 064 RDNA2 programs of its shader pack"
Leonida 26,503 "Shaders: carve, unpack native RDNA2 code, disassemble — All 26,503", split as 2,236 VS · 12,101 PS · 2,689 CS · 9,282 mesh · 195 geometry
rpf9-research (ours) 25,043 streams of type sgd5_shader_dxbc that carry a program name in their header, across all 22 archives

The arithmetic is suggestive rather than contradictory: 26,503 − 25,043 = 1,460, which is what you
would get if a handful of streams hold more than one program (a VS+PS pair, for instance), and
26,503 − 24,064 = 2,439, which would be the programs outside the shader pack.

So the question I would like to close, in the interest of anyone comparing these three READMEs:

  1. Does the 24,064 count only shaders.rpf, or every archive? The wording says "its shader pack",
    which reads like the archive alone.
  2. When you split a stream that holds two programs, do you count one carved stream or two programs?

If the answer is "shader pack only, counted after splitting", then the three numbers agree and the
difference is just scope. If not, one of us has a real discrepancy worth chasing.

Context on the third number, in case it helps: the 25,043 comes from walking all 22 .rpf
archives (150 GiB) and counting streams whose SGD5 header block decodes to a name; 25,043 of
25,043 such streams decoded, so it is a complete count of that type, not a sample. The method,
the per-archive breakdown and the negative results are in
https://github.com/JoshRob297/rpf9-research — the per-type table is in docs/INDEX.md.

**@⁠JoshRob297** on GitHub · 2026-11-22 14:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/36) Three projects now publish a "shader count" for the same retail package, and the numbers differ enough that a reader could think someone is wrong: | project | published count | wording | |---|---:|---| | xcl | 24,064 | *"all 24 064 RDNA2 programs of its shader pack"* | | Leonida | 26,503 | *"Shaders: carve, unpack native RDNA2 code, disassemble — All 26,503"*, split as 2,236 VS · 12,101 PS · 2,689 CS · 9,282 mesh · 195 geometry | | rpf9-research (ours) | 25,043 | streams of type `sgd5_shader_dxbc` that carry a program name in their header, across all 22 archives | The arithmetic is suggestive rather than contradictory: 26,503 − 25,043 = 1,460, which is what you would get if a handful of streams hold more than one program (a VS+PS pair, for instance), and 26,503 − 24,064 = 2,439, which would be the programs outside the shader pack. So the question I would like to close, in the interest of anyone comparing these three READMEs: 1. Does the 24,064 count only `shaders.rpf`, or every archive? The wording says "its shader pack", which reads like the archive alone. 2. When you split a stream that holds two programs, do you count one carved stream or two programs? If the answer is "shader pack only, counted after splitting", then the three numbers agree and the difference is just scope. If not, one of us has a real discrepancy worth chasing. Context on the third number, in case it helps: the 25,043 comes from walking all 22 `.rpf` archives (150 GiB) and counting streams whose SGD5 header block decodes to a name; 25,043 of 25,043 such streams decoded, so it is a complete count of that type, not a sample. The method, the per-archive breakdown and the negative results are in https://github.com/JoshRob297/rpf9-research — the per-type table is in `docs/INDEX.md`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:05:32 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-22 15:41 UTC · original

Short version: 24,064 covered shaders.rpf only, counted after splitting, and it was low because of #34. 26,503 is the complete record count of shaders.rpf, and xcl now finds the same.

  • 24,064 = FSSM programs in the 23,869 records the old scan() found in shaders.rpf. 195 GS records carry two programs (the ES and GS halves), so 23,869 + 195 = 24,064: PS 12,101, MS 9,282, VS 2,236, GS 195, ES 195, CS 55.
  • 26,503 = every record of shaders.rpf. The per-stage split matches ours exactly for PS, MS, VS and GS. The only difference is CS: 2,689 vs our 55. That gap is the 2,634 effect-qualified compute shaders scan() dropped (#34). So 26,503 − 24,064 = 2,439 = 2,634 − 195 (the ES halves we counted separately). No program from outside the shader pack is involved.
  • After the fix xcl sees 26,503 records / 26,698 programs, and all 26,698 translate to HLSL in full. The new compute shaders needed three translator fixes first; see #34.
  • Outside shaders.rpf: we searched all 22 archives (~150 GB) for the name ending that every shader record has, _Wrapped\0. It occurs exactly 26,503 times in shaders.rpf and zero times in the other 21. That only covers records stored in this plain form; a shader inside an encrypted or compressed resource would not show up.
  • 25,043: a different unit, which I cannot reproduce from our side. In shaders.rpf each record is one DXBC container, so streams that hold several programs would not explain a count below the record count. For reference: 26,503 records, 25,889 distinct payloads, 8,145 distinct names – none of them is 25,043. If your streams are per resource rather than per record, the per-archive table should show where the difference sits.

The README now says what is counted: "26 698 RDNA2 programs (26 503 records) of its shader pack".

**@⁠ivall** on GitHub · 2026-11-22 15:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/36#issuecomment-7081499819) Short version: 24,064 covered `shaders.rpf` only, counted after splitting, and it was low because of #34. 26,503 is the complete record count of `shaders.rpf`, and xcl now finds the same. - **24,064** = FSSM programs in the 23,869 records the old `scan()` found in `shaders.rpf`. 195 GS records carry two programs (the ES and GS halves), so 23,869 + 195 = 24,064: PS 12,101, MS 9,282, VS 2,236, GS 195, ES 195, CS 55. - **26,503** = every record of `shaders.rpf`. The per-stage split matches ours exactly for PS, MS, VS and GS. The only difference is CS: 2,689 vs our 55. That gap is the 2,634 effect-qualified compute shaders `scan()` dropped (#34). So 26,503 − 24,064 = 2,439 = 2,634 − 195 (the ES halves we counted separately). No program from outside the shader pack is involved. - After the fix xcl sees 26,503 records / 26,698 programs, and all 26,698 translate to HLSL in full. The new compute shaders needed three translator fixes first; see #34. - **Outside `shaders.rpf`:** we searched all 22 archives (~150 GB) for the name ending that every shader record has, `_Wrapped\0`. It occurs exactly 26,503 times in `shaders.rpf` and zero times in the other 21. That only covers records stored in this plain form; a shader inside an encrypted or compressed resource would not show up. - **25,043:** a different unit, which I cannot reproduce from our side. In `shaders.rpf` each record is one DXBC container, so streams that hold several programs would not explain a count *below* the record count. For reference: 26,503 records, 25,889 distinct payloads, 8,145 distinct names – none of them is 25,043. If your streams are per resource rather than per record, the per-archive table should show where the difference sits. The README now says what is counted: "26 698 RDNA2 programs (26 503 records) of its shader pack".
Author
Owner

@⁠ivall on GitHub · 2026-11-22 15:46 UTC · original

Landed in e80ce8d.

**@⁠ivall** on GitHub · 2026-11-22 15:46 UTC · [original](https://github.com/xcl-dev/xcl/issues/36#issuecomment-7081555319) Landed in e80ce8d.
Author
Owner

@⁠JoshRob297 on GitHub · 2026-11-22 16:15 UTC · original

Thanks — that closes it cleanly, and the CS gap is the part that mattered.

For the record, the third number maps to yours the way you would expect: my 25,043 is a count of
streams of type sgd5_shader_dxbc across all 22 archives, not records. If a stream can carry
more than one record, then 26,503 − 25,043 = 1,460 records would be sitting in multi-record
streams, which is consistent with your 23,869 records producing 24,064 programs before the fix.

So the three figures agree on scope: shaders.rpf only, counted after splitting at the record
level, and the 2,634 effect-qualified compute shaders were the real discrepancy — not a
disagreement between projects.

One thing I can add if useful: I have per-archive stream counts for that type, so if you ever want
to check that shaders.rpf is the whole story (that no SGD5 stream lives outside it), the numbers
are there. On my side the split was 29,248 streams classified in shaders.rpf, of which 25,043
decoded to an SGD5 name — the rest are other stream types in the same archive.

**@⁠JoshRob297** on GitHub · 2026-11-22 16:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/36#issuecomment-7081935131) Thanks — that closes it cleanly, and the CS gap is the part that mattered. For the record, the third number maps to yours the way you would expect: my 25,043 is a count of **streams** of type `sgd5_shader_dxbc` across all 22 archives, not records. If a stream can carry more than one record, then 26,503 − 25,043 = 1,460 records would be sitting in multi-record streams, which is consistent with your 23,869 records producing 24,064 programs before the fix. So the three figures agree on scope: `shaders.rpf` only, counted after splitting at the record level, and the 2,634 effect-qualified compute shaders were the real discrepancy — not a disagreement between projects. One thing I can add if useful: I have per-archive stream counts for that type, so if you ever want to check that `shaders.rpf` is the whole story (that no SGD5 stream lives outside it), the numbers are there. On my side the split was 29,248 streams classified in `shaders.rpf`, of which 25,043 decoded to an SGD5 name — the rest are other stream types in the same archive.
This discussion has been locked. Commenting is limited to contributors.
No description provided.