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

Merged
MoonYueya merged 3 commits from upstream-pr/625 into main 2026-11-22 19:14:26 +00:00
MoonYueya commented 2026-11-22 16:20:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T16:20:38Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6544735708 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/625). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T16:20:38Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:44:01 +00:00
legacy-code-archaeologist commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T18:56:14Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7083981709 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/625#issuecomment-7083981709). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-22T18:56:14Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
R0Y00/Xbox2Windows!619
No description provided.