tooling: distinguish shader census populations #617

Manually merged
github merged 2 commits from gh-pr/617/head into gh-pr/617/base 2026-11-26 22:06:12 +00:00
Owner

@⁠Joacoorandom on GitHub · 2026-11-22 16:02 UTC · original
Joacoorandom:tooling/shader-census-populations → main · +291 −0 · 7 files · 2 commits · merged 2026-11-22 21:11 UTC

Change

Refs #594. Add a separate census command that distinguishes accepted archive record occurrences, distinct DXBC header digests, full-container SHA-256 classification keys and decoded cache-index entries. Each population reports its source and key; missing cache input is null rather than zero.

The current profile audit and its coverage denominator remain unchanged. A fixture deliberately produces four records, two header digests, three complete-container hashes and five cache-index entries. It also checks that the existing audit counts every occurrence while classifying each full-container hash only once.

The optional cache reader handles the PS/9 decoded-index profile described in #594. It requires a caller-established code-area base, checks table/allocation bounds, alignment and overlaps, and reports exact aliases separately. It neither guesses instruction lengths from allocation sizes nor validates the programs inside them.

Verification

Implementation: 42ac4be353. Integration: 58920ec, merging main at 0a9cc04. Resolved CMake registration alongside the new retarget fixture. Retained the merged #625 population convention and placed the command/reproduction details in a separate subsection, avoiding duplicated definitions.

Linux, Python 3.14.4, using the existing development environment:

python -B tests/shader_census_check.py -v
python -B tests/dxcontainer_part_offsets_check.py
python -B tests/shader_probe_check.py
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git diff --cached --check

Seven census test methods and seven DXContainer tests passed. Existing metadata controls accepted two expected cases and rejected seven failure cases. Documentation check passed for 10 Markdown files / 129 links; bidi check passed for 585 tracked source/configuration files; PR diff whitespace check against main passed.

Windows 11 build 26300.9974, MSVC 19.44.35230, Python 3.12.8; configured Debug with INTAKE_PYTHON pointing to that interpreter:

cmake --build out/native --target root_probe compute_root.cso compute_tables.cso triangle_vs.cso --parallel 4
ctest --test-dir out/native --no-tests=error -R "shader_metadata|dxcontainer_part_offsets" --output-on-failure

Build succeeded; 4/4 tests passed, including shader_metadata_probe, with no skips. The full repository suite was not run.

Evidence and follow-up

All new inputs are original MIT-licensed Python-built framing fixtures; they contain no executable DXIL or game data. Negative controls cover malformed headers/tables, zero or out-of-range allocations, partial overlaps, invalid archive framing and CLI errors. Alias accounting, reordered entries, empty input and missing cache input have controls.

README and experiments.md document the command, population keys and limits. AGENTS.md and Linux CI include the new check. The population convention and reported counts now come from #625 on main; this PR adds the command and its reproduction details. No private archive totals were remeasured. Cache decompression, automatic code-base discovery and cross-input build identity checks remain outside this change. No other PR is required.

Checklist

  • This pull request covers one reviewable behavior.
  • I included commands and results for verification.
  • I considered negative controls for the new fixture.
  • I updated README/docs for the new command.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted implementation, test development and documentation.

**@⁠Joacoorandom** on GitHub · 2026-11-22 16:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/617) `Joacoorandom:tooling/shader-census-populations` → `main` · +291 −0 · 7 files · 2 commits · merged 2026-11-22 21:11 UTC ## Change Refs #594. Add a separate census command that distinguishes accepted archive record occurrences, distinct DXBC header digests, full-container SHA-256 classification keys and decoded cache-index entries. Each population reports its source and key; missing cache input is null rather than zero. The current profile audit and its coverage denominator remain unchanged. A fixture deliberately produces four records, two header digests, three complete-container hashes and five cache-index entries. It also checks that the existing audit counts every occurrence while classifying each full-container hash only once. The optional cache reader handles the PS/9 decoded-index profile described in #594. It requires a caller-established code-area base, checks table/allocation bounds, alignment and overlaps, and reports exact aliases separately. It neither guesses instruction lengths from allocation sizes nor validates the programs inside them. ## Verification Implementation: 42ac4be3535de6dd834b101168bba54517d78a8b. Integration: 58920ec, merging main at 0a9cc04. Resolved CMake registration alongside the new retarget fixture. Retained the merged #625 population convention and placed the command/reproduction details in a separate subsection, avoiding duplicated definitions. Linux, Python 3.14.4, using the existing development environment: ```text python -B tests/shader_census_check.py -v python -B tests/dxcontainer_part_offsets_check.py python -B tests/shader_probe_check.py python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git diff --cached --check ``` Seven census test methods and seven DXContainer tests passed. Existing metadata controls accepted two expected cases and rejected seven failure cases. Documentation check passed for 10 Markdown files / 129 links; bidi check passed for 585 tracked source/configuration files; PR diff whitespace check against main passed. Windows 11 build 26300.9974, MSVC 19.44.35230, Python 3.12.8; configured Debug with INTAKE_PYTHON pointing to that interpreter: ```text cmake --build out/native --target root_probe compute_root.cso compute_tables.cso triangle_vs.cso --parallel 4 ctest --test-dir out/native --no-tests=error -R "shader_metadata|dxcontainer_part_offsets" --output-on-failure ``` Build succeeded; 4/4 tests passed, including shader_metadata_probe, with no skips. The full repository suite was not run. ## Evidence and follow-up All new inputs are original MIT-licensed Python-built framing fixtures; they contain no executable DXIL or game data. Negative controls cover malformed headers/tables, zero or out-of-range allocations, partial overlaps, invalid archive framing and CLI errors. Alias accounting, reordered entries, empty input and missing cache input have controls. README and experiments.md document the command, population keys and limits. AGENTS.md and Linux CI include the new check. The population convention and reported counts now come from #625 on main; this PR adds the command and its reproduction details. No private archive totals were remeasured. Cache decompression, automatic code-base discovery and cross-input build identity checks remain outside this change. No other PR is required. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included commands and results for verification. - [x] I considered negative controls for the new fixture. - [x] I updated README/docs for the new command. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted implementation, test development and documentation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:06:10 +00:00
github manually merged commit 58920ec299 into gh-pr/617/base 2026-11-26 22:06:12 +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/617#issuecomment-7083981425) 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.