docs: name the shader census tiers and the key behind each count #625

Manually merged
github merged 3 commits from gh-pr/625/head into gh-pr/625/base 2026-11-26 22:06:48 +00:00
Owner

@⁠MoonYueya on GitHub · 2026-11-22 16:20 UTC · original
MoonYueya:docs-shader-census-tiers → main · +16 −0 · 1 files · 3 commits · merged 2026-11-22 19:14 UTC

Change

Refs #594. Adds one subsection to docs/experiments.md, ### Shader census tiers and what each percentage divides by, placed directly before ### Fixed-profile archive rescan so the first coverage table is read with the convention in hand. It advances S1 of #594 — a contributor quoting a percentage can now see which population it divides by — and answers the convention question raised for a second corpus in drycheetah84/TomBox#5.

The section names the three counts with their own source and key, as requested:

Count Population Key
26,503 accepted archive records named records in the plaintext archive, before the PSO cache end offset plus the 16-byte DXBC digest at container bytes 4..20
25,889 distinct DXBC header digests the same 26,503 records, counted by container header container bytes 4..20 alone
21,522 cache index entries programs in the console PSO cache, a separate population behind the archive the 8-byte entry itself: a 4-byte offset from a code-area base and a 4-byte allocation span

It states the convention the profile tables already follow: they divide by the 26,503 accepted archive records, and each per-stage row divides by that stage's own count (PS 12,101, CS 2,689, MS 9,282, VS 2,236, GS 195). tools/shader_profile_audit.py is named as the counter, with the full-container SHA-256 as its classification cache key. The text also records why the two archive keys stay apart: 26,721 accepted candidates include 218 re-detections, leaving 26,503 records and 25,889 digests.

21,044 is now described as the earlier extractor result, together with the reason it was revised: that scan ended every program at a fixed 40-byte S_CODE_END tail and missed 478 index entries (419 carry the standard gate and S_ENDPGM — 407 end with a 20-byte tail and 12 carry no S_CODE_END fill — 58 begin directly with the program body, one has no terminator), and a further 4,485 entries were bounded wrongly at both ends because their start falls in the gap between two old records and their tail extends into the next one. Boundaries now come from the index, which gives 21,522 programs. The subsection also notes that 26,091 is the number of S_ENDPGM instructions and not a record count.

One correction is folded in from ivall/xcl#34: the 218 re-detections are suffix aliases that start inside the previous record's name, at a byte whose value equals its distance to the name's terminating NUL, and share that record's terminator, header and payload. The earlier wording here placed those starts inside the compressed payload. The de-duplication result is unchanged, since it keeps the earlier start whenever the end offset and the digest match.

No behaviour, tool or test changes: the only edit is prose in one document.

Verification

Commit 62b9256, Windows x64, Python 3.15.0.

$ python -B tests/docs_links_check.py
Self-test passed.
Checked 10 Markdown files and 122 links.

$ python -B tests/bidi_controls_check.py
Self-test passed.
Checked 562 tracked source, script and build/CI files: no bidirectional controls.

Both pass before and after the change. The numbers in the subsection were checked one by one against our measurements of the archive, the cache index and the earlier extractor: 26,721 / 218 / 26,503 / 25,889, the per-stage split 12,101 + 2,689 + 9,282 + 2,236 + 195 = 26,503, the 21,522 entries with their offset-and-span reading, 419 + 58 + 1 = 478, 4,485 cross-boundary entries, and 26,091 S_ENDPGM occurrences.

The reproduction command in the issue (tools/shader_profile_audit.py --llvm <lib>) needs the archive and LLVM 15 and was not rerun for a documentation-only change; no game files, container bytes or shader names are added by this patch.

Evidence and follow-up

  • The counts and keys are those confirmed in #594's Details section, with the suffix-alias correction from ivall/xcl#34 applied.
  • The convention this establishes is what drycheetah84/TomBox#5 needs for its second corpus: the three counts are stated per population, so another corpus can report the same three numbers without implying they are interchangeable.
  • S2 in #594 (a tool that prints all three counts plus the key on a source-built fixture) stays open and is not touched here.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture (none added; documentation only).
  • I updated README/docs when a capability or build requirement changed (docs/experiments.md).
  • I did not include game files, dumps, distribution links or secrets.

Drafted with AI assistance; the commands above were run on the author's Windows x64 host and the numbers were re-checked against the measurements before posting.

**@⁠MoonYueya** on GitHub · 2026-11-22 16:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/625) `MoonYueya:docs-shader-census-tiers` → `main` · +16 −0 · 1 files · 3 commits · merged 2026-11-22 19:14 UTC ## Change Refs #594. Adds one subsection to `docs/experiments.md`, `### Shader census tiers and what each percentage divides by`, placed directly before `### Fixed-profile archive rescan` so the first coverage table is read with the convention in hand. It advances S1 of #594 — a contributor quoting a percentage can now see which population it divides by — and answers the convention question raised for a second corpus in drycheetah84/TomBox#5. The section names the three counts with their own source and key, as requested: | Count | Population | Key | | --- | --- | --- | | 26,503 accepted archive records | named records in the plaintext archive, before the PSO cache | end offset plus the 16-byte DXBC digest at container bytes 4..20 | | 25,889 distinct DXBC header digests | the same 26,503 records, counted by container header | container bytes 4..20 alone | | 21,522 cache index entries | programs in the console PSO cache, a separate population behind the archive | the 8-byte entry itself: a 4-byte offset from a code-area base and a 4-byte allocation span | It states the convention the profile tables already follow: they divide by the 26,503 accepted archive records, and each per-stage row divides by that stage's own count (PS 12,101, CS 2,689, MS 9,282, VS 2,236, GS 195). `tools/shader_profile_audit.py` is named as the counter, with the full-container SHA-256 as its classification cache key. The text also records why the two archive keys stay apart: 26,721 accepted candidates include 218 re-detections, leaving 26,503 records and 25,889 digests. 21,044 is now described as the earlier extractor result, together with the reason it was revised: that scan ended every program at a fixed 40-byte `S_CODE_END` tail and missed 478 index entries (419 carry the standard gate and `S_ENDPGM` — 407 end with a 20-byte tail and 12 carry no `S_CODE_END` fill — 58 begin directly with the program body, one has no terminator), and a further 4,485 entries were bounded wrongly at both ends because their start falls in the gap between two old records and their tail extends into the next one. Boundaries now come from the index, which gives 21,522 programs. The subsection also notes that 26,091 is the number of `S_ENDPGM` instructions and not a record count. One correction is folded in from ivall/xcl#34: the 218 re-detections are suffix aliases that start inside the previous record's **name**, at a byte whose value equals its distance to the name's terminating NUL, and share that record's terminator, header and payload. The earlier wording here placed those starts inside the compressed payload. The de-duplication result is unchanged, since it keeps the earlier start whenever the end offset and the digest match. No behaviour, tool or test changes: the only edit is prose in one document. ### Verification Commit `62b9256`, Windows x64, Python 3.15.0. ```text $ python -B tests/docs_links_check.py Self-test passed. Checked 10 Markdown files and 122 links. $ python -B tests/bidi_controls_check.py Self-test passed. Checked 562 tracked source, script and build/CI files: no bidirectional controls. ``` Both pass before and after the change. The numbers in the subsection were checked one by one against our measurements of the archive, the cache index and the earlier extractor: 26,721 / 218 / 26,503 / 25,889, the per-stage split 12,101 + 2,689 + 9,282 + 2,236 + 195 = 26,503, the 21,522 entries with their offset-and-span reading, 419 + 58 + 1 = 478, 4,485 cross-boundary entries, and 26,091 `S_ENDPGM` occurrences. The reproduction command in the issue (`tools/shader_profile_audit.py --llvm <lib>`) needs the archive and LLVM 15 and was not rerun for a documentation-only change; no game files, container bytes or shader names are added by this patch. ### Evidence and follow-up - The counts and keys are those confirmed in #594's Details section, with the suffix-alias correction from ivall/xcl#34 applied. - The convention this establishes is what drycheetah84/TomBox#5 needs for its second corpus: the three counts are stated per population, so another corpus can report the same three numbers without implying they are interchangeable. - S2 in #594 (a tool that prints all three counts plus the key on a source-built fixture) stays open and is not touched here. ### Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture (none added; documentation only). - [x] I updated README/docs when a capability or build requirement changed (`docs/experiments.md`). - [x] I did not include game files, dumps, distribution links or secrets. Drafted with AI assistance; the commands above were run on the author's Windows x64 host and the numbers were re-checked against the measurements before posting.
`docs/experiments.md` divided by 26,503 accepted archive records, 25,889 distinct DXBC header digests and 21,522 cache index entries without saying which population each belongs to. A new subsection under the pipeline readiness results gives each count its source and key: the archive enumeration for the first two, the code-area index for the third, and the 16-byte DXBC digest at container bytes 4..20 as the archive key. The profile tables keep 26,503 as their denominator and each per-stage row keeps its own count.

21,044 is now described as the earlier extractor result, with the reason it was revised: it ended every program at a fixed 40-byte S_CODE_END tail and missed 478 index entries, and 4,485 more were bounded wrongly at both ends. The note also corrects the 218 re-detections to suffix aliases that start inside the previous record's name, matching ivall/xcl#34.

python -B tests/docs_links_check.py and python -B tests/bidi_controls_check.py both pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:06:46 +00:00
github manually merged commit 8dc6f01c37 into gh-pr/625/base 2026-11-26 22:06:48 +00:00
Author
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-22 18:56 UTC · original

Coordination note: #617 and #625 both add a new subsection to docs/experiments.md at the same place, directly after line 231, before ### Fixed-profile archive rescan. Both explain the shader census populations:

  • #617 adds ### Shader census populations together with tools/shader_census.py and its check.
  • #625 adds ### Shader census tiers and what each percentage divides by and only edits the docs.

The two branches conflict with each other in docs/experiments.md (git merge-tree). #617 also conflicts with main at edc2e54 in CMakeLists.txt, while #625 merges cleanly with main. Since both describe the same three counts for #594, it may help to agree on one section, for example one PR building on the other, so the docs don't end up with two definitions of the same tiers.

AI-assisted (Claude Code).

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-22 18:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/625#issuecomment-7083981709) Coordination note: #617 and #625 both add a new subsection to `docs/experiments.md` at the same place, directly after line 231, before `### Fixed-profile archive rescan`. Both explain the shader census populations: - #617 adds `### Shader census populations` together with `tools/shader_census.py` and its check. - #625 adds `### Shader census tiers and what each percentage divides by` and only edits the docs. The two branches conflict with each other in `docs/experiments.md` (`git merge-tree`). #617 also conflicts with `main` at `edc2e54` in `CMakeLists.txt`, while #625 merges cleanly with `main`. Since both describe the same three counts for #594, it may help to agree on one section, for example one PR building on the other, so the docs don't end up with two definitions of the same tiers. AI-assisted (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
No description provided.