CORPUS-WATCH: add counts-only corpus regression watch tool and tests #817

Merged
fitzypopper merged 1 commit from upstream-pr/817 into main 2026-11-25 21:06:46 +00:00
fitzypopper commented 2026-11-24 14:10:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fitzypopper on 2026-11-24T14:10:55Z.


Claimed in the coordination issue as: CORPUS-WATCH — counts-only corpus regression watch tool (claim comment).

What

Adds scripts/corpus_watch.py: a repeatable, counts-only corpus regression watch. It runs make_game.py --stages check,shaders against the user's own copy, then records carved / translated / spirv-val-validated counts per stage against the checked-out commit, using the same counting rule as progress_dashboard.py. Each run appends one JSONL record and logs a before/after delta so a drop in validated count is visible as a regression.

Why: the standing corpus watch on main was one of the unclaimed tasks in the original tracker. This makes it cheap to run by anyone with a supported copy, and keeps the published artifacts to counts only.

No game data

Results contain only commit SHA, counts, exit code and timestamp — no shader names, carved file names or paths into the package. Diagnostic logs may contain paths and are marked local-only in the tool's docstring and CLI help. Verified with python3 -I scripts/check_no_game_data.py scripts/corpus_watch.py tests/test_corpus_watch.py.

Conventions

  • Standard library only, runs under python3 -I.
  • All text writes use newline="\n".
  • Report paths are checked with tools/report_paths.same_report_path so an output cannot name the work folder or another output.
  • New tests cover both dxbc index shapes, legacy layout, error entries, missing indexes and path collisions.

Tests

  • python3 -I tests/test_corpus_watch.py — 4 tests pass.
  • python3 -I tests/test_text_write_line_endings.py — 3 tests pass.
  • python3 -m compileall -q scripts/corpus_watch.py tests/test_corpus_watch.py — OK.
  • python3 -I scripts/check_no_game_data.py — clean.

Manual run on a validated Xbox Series 1.0.2.1 copy at upstream pre-shutdown commit 867d922f: carved 26,503 / spirv 26,503 / validated 26,503, per-stage counts matching the project's published numbers.

AI-assisted: yes. The tool was prepared with AI assistance and verified locally as above.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5473772605 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/817). Originally posted by [fitzypopper](https://github.com/fitzypopper) on 2026-11-24T14:10:55Z. --- Claimed in the coordination issue as: `CORPUS-WATCH — counts-only corpus regression watch tool` ([claim comment](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133930458)). ## What Adds `scripts/corpus_watch.py`: a repeatable, counts-only corpus regression watch. It runs `make_game.py --stages check,shaders` against the user's own copy, then records carved / translated / spirv-val-validated counts per stage against the checked-out commit, using the same counting rule as `progress_dashboard.py`. Each run appends one JSONL record and logs a before/after delta so a drop in validated count is visible as a regression. Why: the standing corpus watch on `main` was one of the unclaimed tasks in the original tracker. This makes it cheap to run by anyone with a supported copy, and keeps the published artifacts to counts only. ## No game data Results contain only commit SHA, counts, exit code and timestamp — no shader names, carved file names or paths into the package. Diagnostic logs may contain paths and are marked local-only in the tool's docstring and CLI help. Verified with `python3 -I scripts/check_no_game_data.py scripts/corpus_watch.py tests/test_corpus_watch.py`. ## Conventions - Standard library only, runs under `python3 -I`. - All text writes use `newline="\n"`. - Report paths are checked with `tools/report_paths.same_report_path` so an output cannot name the work folder or another output. - New tests cover both dxbc index shapes, legacy layout, error entries, missing indexes and path collisions. ## Tests - `python3 -I tests/test_corpus_watch.py` — 4 tests pass. - `python3 -I tests/test_text_write_line_endings.py` — 3 tests pass. - `python3 -m compileall -q scripts/corpus_watch.py tests/test_corpus_watch.py` — OK. - `python3 -I scripts/check_no_game_data.py` — clean. Manual run on a validated Xbox Series 1.0.2.1 copy at upstream pre-shutdown commit `867d922f`: carved 26,503 / spirv 26,503 / validated 26,503, per-stage counts matching the project's published numbers. AI-assisted: yes. The tool was prepared with AI assistance and verified locally as above.
abnalstlll-byte commented 2026-11-24 14:18:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:18:49Z.

Review: APPROVED


Clean-Room Peer Review for PR #817 (CORPUS-WATCH: add counts-only corpus regression watch tool and tests)

Verified script and test suite against project engineering standards:

  • Clean-Room Strictness: Outputs JSONL records containing numerical counts only (carved, spirv_entries, alidated, per_stage), completely eliminating sensitive game data, shader names, or proprietary paths.
  • Path Collision Safeguards: Employs same_report_path across --work, --report, --results, and --log paths to guard against overwriting work folders or input data.
  • Standard Library Compliance: Runs under isolated Python (python -I) with pure stdlib dependencies (rgparse, json, os, shutil, subprocess, sys, ime).
  • Explicit Line-Ending Invariants: All write operations explicitly define encoding='utf-8', newline='\n'.
  • Unit Test Coverage: Clean-room synthetic mocks in ests/test_corpus_watch.py verify counts aggregation, legacy layout compatibility, and output path collision detection.

LGTM! Verified and approved.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6040865515 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/817#pullrequestreview-6040865515). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T14:18:49Z. **Review:** APPROVED --- ### Clean-Room Peer Review for PR #817 (CORPUS-WATCH: add counts-only corpus regression watch tool and tests) Verified script and test suite against project engineering standards: - **Clean-Room Strictness**: Outputs JSONL records containing numerical counts only (carved, spirv_entries, alidated, per_stage), completely eliminating sensitive game data, shader names, or proprietary paths. - **Path Collision Safeguards**: Employs same_report_path across --work, --report, --results, and --log paths to guard against overwriting work folders or input data. - **Standard Library Compliance**: Runs under isolated Python (python -I) with pure stdlib dependencies (rgparse, json, os, shutil, subprocess, sys, ime). - **Explicit Line-Ending Invariants**: All write operations explicitly define encoding='utf-8', newline='\n'. - **Unit Test Coverage**: Clean-room synthetic mocks in ests/test_corpus_watch.py verify counts aggregation, legacy layout compatibility, and output path collision detection. LGTM! Verified and approved.
abnalstlll-byte commented 2026-11-24 14:29:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:29:41Z.

Review: APPROVED


Clean-room verified (zero game data, counts only). Safe corpus regression watch tool (scripts/corpus_watch.py) recording only carved/validated counts with output collision guards via same_report_path. Clean unit tests.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6041075897 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/817#pullrequestreview-6041075897). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T14:29:41Z. **Review:** APPROVED --- Clean-room verified (zero game data, counts only). Safe corpus regression watch tool (scripts/corpus_watch.py) recording only carved/validated counts with output collision guards via same_report_path. Clean unit tests.
aslan2142 commented 2026-11-25 21:06:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T21:06:50Z.


Merged, thanks! The new test fails on main and passes with this.

  • Checked on main f2fb55702 + 5ba7f3548: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_corpus_watch pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7174629029 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/817#issuecomment-7174629029). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T21:06:50Z. --- Merged, thanks! The new test fails on `main` and passes with this. - **Checked on `main` `f2fb55702` + `5ba7f3548`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_corpus_watch` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 2 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
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
ProjectLeonida/mandy!817
No description provided.