textures: map descriptor pages in equal-size raw ranges #271

Merged
Vonsek merged 1 commit from upstream-pr/275 into main 2026-11-21 20:26:35 +00:00
Vonsek commented 2026-11-21 20:06:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T20:06:09Z.


Change

Add --raw-page-map INDEX to the ETPF descriptor inventory. A descriptor gives a virtual 4 KiB page address. The indexed command reports the logical and physical byte offsets of that first page when the enclosing interval has raw codec and equal stored and logical sizes. It visits the counted boundary table and reads the indexed descriptor's page field. The grouped inventory remains the default command. Usage.

Verification

Windows 11 x64, Python 3.12.10, commit 91dcc71 on upstream 496fc28.

python -m venv out/pe-env
.\out\pe-env\Scripts\python.exe -m pip install -r requirements-dev.txt
. ./tools/dev.ps1
$rawMapPython = (Resolve-Path out/pe-env/Scripts/python.exe).Path
cmake --preset dev "-DINTAKE_PYTHON=$rawMapPython"
& $rawMapPython -B tests/resource_ranges_check.py -v
ctest --preset dev --no-tests=error -R '^resource_range_controls$' -V

The prior CLI exited 2 on --raw-page-map 0. The new regression and focused CTest both failed. With this change, the CLI reported logical offset 12,288 and file offset 8,704 for synthetic descriptor zero. All 4,096 bytes at the reported offset matched its independently generated second-page pattern. Starting at the raw interval's beginning instead changed 4,064 of those bytes. All eleven Python tests passed, and the focused CTest passed in 0.37 seconds.

Evidence and follow-up

The original MIT-licensed fixture places two distinct pages in one raw interval between zlib- and BCPack-marked intervals. It exercises a page exactly on a boundary, two descriptors sharing a page, invalid indices, a page at the logical end, and short or padded raw intervals. The boundary table must strictly increase in both address spaces, including after the selected interval. A separate guarded fixture checks an interval split between two boundary-table reads, each limited to 4 KiB. The profile accepts up to 1 MiB of boundary records. Neither CLI mode reads texture payloads. Interpreting texel layout or runtime mip residency requires separate evidence.

AI-assisted contribution.

Checklist

  • This pull request covers one reviewable behavior.
  • I included commands and results for the public fixture checks.
  • I included negative controls for interval selection, codecs, sizes and budgets.
  • I updated the experiment documentation.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533777161 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/275). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T20:06:09Z. --- ## Change Add `--raw-page-map INDEX` to the [ETPF descriptor inventory](https://github.com/R0Y00/Xbox2Windows/pull/266). A descriptor gives a virtual 4 KiB page address. The indexed command reports the logical and physical byte offsets of that first page when the enclosing interval has raw codec and equal stored and logical sizes. It visits the counted boundary table and reads the indexed descriptor's page field. The grouped inventory remains the default command. [Usage](https://github.com/Vonsek/Xbox2Windows/blob/91dcc71/docs/experiments.md#reading-logical-ranges-and-probing-structured-resources). ## Verification Windows 11 x64, Python 3.12.10, commit `91dcc71` on upstream `496fc28`. ```powershell python -m venv out/pe-env .\out\pe-env\Scripts\python.exe -m pip install -r requirements-dev.txt . ./tools/dev.ps1 $rawMapPython = (Resolve-Path out/pe-env/Scripts/python.exe).Path cmake --preset dev "-DINTAKE_PYTHON=$rawMapPython" & $rawMapPython -B tests/resource_ranges_check.py -v ctest --preset dev --no-tests=error -R '^resource_range_controls$' -V ``` The prior CLI exited 2 on `--raw-page-map 0`. The new regression and focused CTest both failed. With this change, the CLI reported logical offset 12,288 and file offset 8,704 for synthetic descriptor zero. All 4,096 bytes at the reported offset matched its independently generated second-page pattern. Starting at the raw interval's beginning instead changed 4,064 of those bytes. All eleven Python tests passed, and the focused CTest passed in 0.37 seconds. ## Evidence and follow-up The original MIT-licensed fixture places two distinct pages in one raw interval between zlib- and BCPack-marked intervals. It exercises a page exactly on a boundary, two descriptors sharing a page, invalid indices, a page at the logical end, and short or padded raw intervals. The boundary table must strictly increase in both address spaces, including after the selected interval. A separate guarded fixture checks an interval split between two boundary-table reads, each limited to 4 KiB. The profile accepts up to 1 MiB of boundary records. Neither CLI mode reads texture payloads. Interpreting texel layout or runtime mip residency requires separate evidence. AI-assisted contribution. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included commands and results for the public fixture checks. - [x] I included negative controls for interval selection, codecs, sizes and budgets. - [x] I updated the experiment documentation. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:42:11 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T20:06:21Z.


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-21T20:08:29.023829Z 91dcc71 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7068507764 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/275#issuecomment-7068507764). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T20:06:21Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"91dcc71053d1baa56e355ee98c3cce42d75df2ac","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-21T20:08:29.023829Z">2026-11-21T20:08:29.023829Z</relative-time> | `91dcc71` | 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>
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!271
No description provided.