tooling: distinguish shader census populations #611

Merged
Joacoorandom merged 2 commits from upstream-pr/617 into main 2026-11-22 21:11:14 +00:00
Joacoorandom commented 2026-11-22 16:02:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Joacoorandom on 2026-11-22T16:02:15Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6544543420 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/617). Originally posted by [Joacoorandom](https://github.com/Joacoorandom) on 2026-11-22T16:02:15Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:43:58 +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:13Z.


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:7083981425 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/617#issuecomment-7083981425). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-22T18:56:13Z. --- 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!611
No description provided.