script: require matching root schema and instance sizes #186

Manually merged
github merged 1 commit from gh-pr/186/head into gh-pr/186/base 2026-11-26 21:32:59 +00:00
Owner

@⁠Vonsek on GitHub · 2026-11-21 18:10 UTC · original
Vonsek:codex/script-tree-validation → main · +22 −3 · 2 files · 1 commits · merged 2026-11-21 18:13 UTC

Change

Require the root schema's declared size to match the 80-byte instance before interpreting its five arrays. The probe still counts the section record, but a size mismatch excludes it from tree counts and state lookup. The replay's anchor selector uses the same check.

Verification

Windows 11 build 26200.9974, Visual Studio Build Tools 2022 17.14.45 (MSVC 19.44.35230), Python 3.12.10, CMake 3.31.6.

  • python -B tests/script_state_check.py with the new fixture on base ccfa703: the probe counted two trees instead of one, and replay selection raised Anchor appears in multiple records.
  • cmake --preset dev and cmake --build --preset dev --target script_path_host configured and built the host from a clean output directory.
  • ctest --preset dev --no-tests=error -R '^script_(state_literals|path_links|dispatch_pairs)$' -V: 2/3 on base with the new fixture, 3/3 at 6080055, with zero skips.
  • out/pe-env/Scripts/python.exe -B tests/script_state_check.py: 13 tests passed at 6080055.
  • out/pe-env/Scripts/python.exe -B tests/script_path_check.py out/build/dev/script_path_host.dll: 4 tests passed at 6080055.
  • out/pe-env/Scripts/python.exe -B tests/script_dispatch_check.py out/build/dev/script_path_host.dll: 5 tests passed at 6080055.
  • git diff --check: passed.

Evidence and follow-up

The MIT-licensed test constructs two paged records with the same synthetic state label. The first has an 80-byte root block and declares a 64-byte root schema. The second declares the correct size. Both readers must select the second record, whose camera priority is 17.

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.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted with Codex.

**@⁠Vonsek** on GitHub · 2026-11-21 18:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/186) `Vonsek:codex/script-tree-validation` → `main` · +22 −3 · 2 files · 1 commits · merged 2026-11-21 18:13 UTC ## Change Require the root schema's declared size to match the 80-byte instance before interpreting its five arrays. The probe still counts the section record, but a size mismatch excludes it from tree counts and state lookup. The replay's anchor selector uses the same check. ## Verification Windows 11 build 26200.9974, Visual Studio Build Tools 2022 17.14.45 (MSVC 19.44.35230), Python 3.12.10, CMake 3.31.6. - `python -B tests/script_state_check.py` with the new fixture on base `ccfa703`: the probe counted two trees instead of one, and replay selection raised `Anchor appears in multiple records`. - `cmake --preset dev` and `cmake --build --preset dev --target script_path_host` configured and built the host from a clean output directory. - `ctest --preset dev --no-tests=error -R '^script_(state_literals|path_links|dispatch_pairs)$' -V`: 2/3 on base with the new fixture, 3/3 at `6080055`, with zero skips. - `out/pe-env/Scripts/python.exe -B tests/script_state_check.py`: 13 tests passed at `6080055`. - `out/pe-env/Scripts/python.exe -B tests/script_path_check.py out/build/dev/script_path_host.dll`: 4 tests passed at `6080055`. - `out/pe-env/Scripts/python.exe -B tests/script_dispatch_check.py out/build/dev/script_path_host.dll`: 5 tests passed at `6080055`. - `git diff --check`: passed. ## Evidence and follow-up The MIT-licensed test constructs two paged records with the same synthetic state label. The first has an 80-byte root block and declares a 64-byte root schema. The second declares the correct size. Both readers must select the second record, whose camera priority is 17. ## 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. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted with Codex.
A contradictory root declaration can add a false state match to a probe report and make an otherwise unique replay anchor ambiguous.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:32:57 +00:00
github manually merged commit 6080055873 into gh-pr/186/base 2026-11-26 21:32:59 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-21 18:10 UTC · original · edited 2026-11-21 18:12 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T18:12:05.726427Z 6080055 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-21 18:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/186#issuecomment-7067058672) · edited 2026-11-21 18:12 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"60800558736d74224f9f7ee5ee7009088e8e0f30","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T18:12:05.726427Z">2026-11-21T18:12:05.726427Z</relative-time> | `6080055` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
This discussion has been locked. Commenting is limited to contributors.
No description provided.