runtime/README: AcpHal, chad, xapu and XCRDAPI have shims; DStorage decodes BCPack (DOC-RUNTIME-README-SHIMS) #1517

Merged
Mike7581 merged 4 commits from upstream-pr/1517 into main 2026-11-28 03:48:19 +00:00
Mike7581 commented 2026-11-25 03:09:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mike7581 on 2026-11-25T03:09:31Z.


Claimed in the coordination issue as: DOC-RUNTIME-README-SHIMS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151462168)

What and why

runtime/README.md had two stale statements:

  • The LEONIDA_COMPAT_DIR section said the AcpHal, chad, xapu and XCRDAPI console DLLs "have no shim here". shims/acphal.cpp, shims/chad.cpp, shims/xapu.cpp and shims/dstorage.cpp (which serves xcrdapi.dll) exist now. The paragraph keeps the xbox-emulator crates as an example of drop-in DLLs, names the four shims, says a DLL in the folder replaces its module's shim, and marks the 867d922 measurement as taken before those shims.
  • The DirectStorage entry said "BCPack, swizzle and physical-page requests are not done yet". docs/directstorage.md and shims/dstorage.cpp describe the BCPack decoder in src/bcpack.cpp (BC1/3/4/5/6H/7; BC2 is E_NOTIMPL), the optional macro-unshuffle and physical page numbers resolved through xmem. The entry now says that.

Docs only; no code changes.

Tested

python -I scripts/check_no_game_data.py runtime/README.md. Checked every statement against the current main sources and docs/directstorage.md.

GPUs tested: n/a

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5484415212 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1517). Originally posted by [Mike7581](https://github.com/Mike7581) on 2026-11-25T03:09:31Z. --- Claimed in the coordination issue as: DOC-RUNTIME-README-SHIMS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151462168) ### What and why `runtime/README.md` had two stale statements: - The `LEONIDA_COMPAT_DIR` section said the `AcpHal`, `chad`, `xapu` and `XCRDAPI` console DLLs "have no shim here". `shims/acphal.cpp`, `shims/chad.cpp`, `shims/xapu.cpp` and `shims/dstorage.cpp` (which serves `xcrdapi.dll`) exist now. The paragraph keeps the xbox-emulator crates as an example of drop-in DLLs, names the four shims, says a DLL in the folder replaces its module's shim, and marks the `867d922` measurement as taken before those shims. - The DirectStorage entry said "BCPack, swizzle and physical-page requests are not done yet". `docs/directstorage.md` and `shims/dstorage.cpp` describe the BCPack decoder in `src/bcpack.cpp` (BC1/3/4/5/6H/7; BC2 is `E_NOTIMPL`), the optional macro-unshuffle and physical page numbers resolved through `xmem`. The entry now says that. Docs only; no code changes. ### Tested `python -I scripts/check_no_game_data.py runtime/README.md`. Checked every statement against the current `main` sources and `docs/directstorage.md`. GPUs tested: n/a AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a)
ytsodacan commented 2026-11-25 03:33:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:33:54Z.


[KEEP]

  • Docs-only change to runtime/README.md (two paragraphs): names the now-existing acphal/chad/xapu/dstorage shims and updates the DirectStorage BCPack/swizzle/physical-page text; no duplicate PR found (#163 touches a different section).
  • No CI checks have reported on the branch (gh pr checks: none), so the no-game-data check and any doc-reading tests have not run.
  • Claims about src/bcpack.cpp (BC2 returns E_NOTIMPL) and docs/directstorage.md were not re-verified here; a maintainer should confirm them against main before merging.
  • No conflicts; fine to merge once checks run green.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152032036 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7152032036). Originally posted by [ytsodacan](https://github.com/ytsodacan) on 2026-11-25T03:33:54Z. --- **[KEEP]** - Docs-only change to `runtime/README.md` (two paragraphs): names the now-existing `acphal`/`chad`/`xapu`/`dstorage` shims and updates the DirectStorage BCPack/swizzle/physical-page text; no duplicate PR found (#163 touches a different section). - No CI checks have reported on the branch (`gh pr checks`: none), so the `no-game-data` check and any doc-reading tests have not run. - Claims about `src/bcpack.cpp` (BC2 returns `E_NOTIMPL`) and `docs/directstorage.md` were not re-verified here; a maintainer should confirm them against main before merging. - No conflicts; fine to merge once checks run green.
Andretuta commented 2026-11-25 08:35:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-25T08:35:46Z.

Review: CHANGES_REQUESTED


Thanks for the docs update. I checked every claim against current main (3f81d46). The BCPack, BC2 E_NOTIMPL, swizzle and xmem page-list statements match the code, and the PR merges cleanly. One path is wrong, and one switch is worth a sentence. Line numbers refer to the PR head 99c9874.

The new paragraph points to shims/chad.cpp and shims/xapu.cpp. The runtime executable target links shims/xapu_chad.cpp for both DLLs, and that file registers a xapu.dll table and a chad.dll table. runtime/CMakeLists.txt on main says so itself, in the comment above xapu_test: the earlier shims/xapu.cpp and shims/chad.cpp are no longer linked into the runtime, which serves both DLLs from xapu_chad.cpp. Those two files are only built for xapu_test and chad_test.

Suggested wording:

All four modules now have a shim here as well (`shims/acphal.cpp`, `shims/xapu_chad.cpp` for both `xapu.dll`
and `chad.dll`, and `shims/dstorage.cpp` for `xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above.

Nit: runtime/README.md:280, mention the switch that turns the new paths off

runtime/shims/dstorage.cpp:996 returns E_NOTIMPL for BCPack, swizzle and physical-page requests when LEONIDA_DSTORAGE_EXTENDED=0. Suggested sentence after the feature description:

These paths are on by default; `LEONIDA_DSTORAGE_EXTENDED=0` makes requests that use BCPack, swizzle or physical
page lists return `E_NOTIMPL`.

What was checked

  • Shim registrations on main:

    • acphal.cpp (AcpHal)
    • xapu_chad.cpp (both xapu.dll and chad.dll; it is the source the runtime target links)
    • dstorage.cpp (xcrdapi.dll!DStorageGetFactory)
  • src/bcpack.cpp handles BC1/3/4/5/6H/7 and BC2 is refused at dstorage.cpp:997. The macro-unshuffle and the xmem page-list path are in dstorage.cpp.

  • git merge-tree with main: clean. Python tests run:

    • test_bcpack
    • test_amd_swizzle*
    • test_acphal_abi
    • test_docs_env_vars

    All pass.

Review done with AI assistance (Claude Code and GPT-6.2 Sol, cross-checked against each other). Every finding above was checked against the code.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6054228353 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1517#pullrequestreview-6054228353). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-25T08:35:46Z. **Review:** CHANGES_REQUESTED --- Thanks for the docs update. I checked every claim against current `main` (`3f81d46`). The BCPack, BC2 `E_NOTIMPL`, swizzle and `xmem` page-list statements match the code, and the PR merges cleanly. One path is wrong, and one switch is worth a sentence. Line numbers refer to the PR head `99c9874`. ### Should-fix: `runtime/README.md:119` names shim files the runtime no longer links The new paragraph points to `shims/chad.cpp` and `shims/xapu.cpp`. The runtime executable target links `shims/xapu_chad.cpp` for both DLLs, and that file registers a `xapu.dll` table and a `chad.dll` table. `runtime/CMakeLists.txt` on `main` says so itself, in the comment above `xapu_test`: the earlier `shims/xapu.cpp` and `shims/chad.cpp` are no longer linked into the runtime, which serves both DLLs from `xapu_chad.cpp`. Those two files are only built for `xapu_test` and `chad_test`. Suggested wording: ```md All four modules now have a shim here as well (`shims/acphal.cpp`, `shims/xapu_chad.cpp` for both `xapu.dll` and `chad.dll`, and `shims/dstorage.cpp` for `xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. ``` ### Nit: `runtime/README.md:280`, mention the switch that turns the new paths off `runtime/shims/dstorage.cpp:996` returns `E_NOTIMPL` for BCPack, swizzle and physical-page requests when `LEONIDA_DSTORAGE_EXTENDED=0`. Suggested sentence after the feature description: ```md These paths are on by default; `LEONIDA_DSTORAGE_EXTENDED=0` makes requests that use BCPack, swizzle or physical page lists return `E_NOTIMPL`. ``` ### What was checked - Shim registrations on `main`: - `acphal.cpp` (AcpHal) - `xapu_chad.cpp` (both `xapu.dll` and `chad.dll`; it is the source the runtime target links) - `dstorage.cpp` (`xcrdapi.dll!DStorageGetFactory`) - `src/bcpack.cpp` handles BC1/3/4/5/6H/7 and BC2 is refused at `dstorage.cpp:997`. The macro-unshuffle and the `xmem` page-list path are in `dstorage.cpp`. - `git merge-tree` with `main`: clean. Python tests run: - `test_bcpack` - `test_amd_swizzle*` - `test_acphal_abi` - `test_docs_env_vars` All pass. Review done with AI assistance (Claude Code and GPT-6.2 Sol, cross-checked against each other). Every finding above was checked against the code.
Mike7581 commented 2026-11-25 17:38:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mike7581 on 2026-11-25T17:38:22Z.


Thanks for checking every claim against main. Both points are fixed:

  • 4ad6d3f: the shim list names shims/xapu_chad.cpp for both xapu.dll and chad.dll, matching what the runtime target links; added your sentence on LEONIDA_DSTORAGE_EXTENDED=0.
  • 1f8ccc6: since EnqueueRequest returns void and validate_request runs on the queue worker, the text now says BC2 requests (and, with LEONIDA_DSTORAGE_EXTENDED=0, BCPack/swizzle/page-list requests) fail with E_NOTIMPL when processed, rather than "return" it.

check_no_game_data.py and tests/test_docs_env_vars.py pass.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169789570 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7169789570). Originally posted by [Mike7581](https://github.com/Mike7581) on 2026-11-25T17:38:22Z. --- Thanks for checking every claim against `main`. Both points are fixed: - 4ad6d3f: the shim list names `shims/xapu_chad.cpp` for both `xapu.dll` and `chad.dll`, matching what the runtime target links; added your sentence on `LEONIDA_DSTORAGE_EXTENDED=0`. - 1f8ccc6: since `EnqueueRequest` returns `void` and `validate_request` runs on the queue worker, the text now says BC2 requests (and, with `LEONIDA_DSTORAGE_EXTENDED=0`, BCPack/swizzle/page-list requests) *fail with* `E_NOTIMPL` when processed, rather than "return" it. `check_no_game_data.py` and `tests/test_docs_env_vars.py` pass.
nicoco23 commented 2026-11-26 16:28:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by nicoco23 on 2026-11-26T16:28:46Z.


Read through the diff (not built here). One line is out of date since #1144 merged (via #2350): shims/xapu_chad.cpp now serves only chad.dll, and xapu.dll comes from shims/xapu_queue.cpp — that is what runtime/CMakeLists.txt links into gta6rt and what the cl.exe fallback list in scripts/build_runtime.ps1 compiles. Suggest "(shims/acphal.cpp, shims/xapu_queue.cpp for xapu.dll, shims/xapu_chad.cpp for chad.dll, and shims/dstorage.cpp for xcrdapi.dll)". The rest matches main as far as I can see. AI-assisted review (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7197698756 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7197698756). Originally posted by [nicoco23](https://github.com/nicoco23) on 2026-11-26T16:28:46Z. --- Read through the diff (not built here). One line is out of date since #1144 merged (via #2350): `shims/xapu_chad.cpp` now serves only chad.dll, and xapu.dll comes from `shims/xapu_queue.cpp` — that is what `runtime/CMakeLists.txt` links into gta6rt and what the cl.exe fallback list in `scripts/build_runtime.ps1` compiles. Suggest "(`shims/acphal.cpp`, `shims/xapu_queue.cpp` for `xapu.dll`, `shims/xapu_chad.cpp` for `chad.dll`, and `shims/dstorage.cpp` for `xcrdapi.dll`)". The rest matches main as far as I can see. AI-assisted review (Claude Code).
Mike7581 commented 2026-11-26 19:24:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mike7581 on 2026-11-26T19:24:43Z.


@nicoco23 Thanks, you're right: since #2350, xapu.dll comes from shims/xapu_queue.cpp and xapu_chad.cpp serves only chad.dll. Fixed in c8fabf8 with your wording (and the rest of the paragraph rewrapped).

Written with AI assistance (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7201554717 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7201554717). Originally posted by [Mike7581](https://github.com/Mike7581) on 2026-11-26T19:24:43Z. --- @nicoco23 Thanks, you're right: since #2350, `xapu.dll` comes from `shims/xapu_queue.cpp` and `xapu_chad.cpp` serves only `chad.dll`. Fixed in c8fabf8 with your wording (and the rest of the paragraph rewrapped). Written with AI assistance (Claude Code, Claude Opus 5.5).
Andretuta commented 2026-11-27 05:05:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T05:05:24Z.

Review: APPROVED


Re-checked at c8fabf8 merged cleanly onto current main (d1dff7949).

All earlier review items and the post-#2350 split are addressed accurately:

  • runtime/README.md now lists shims/acphal.cpp, shims/xapu_queue.cpp for xapu.dll, shims/xapu_chad.cpp for chad.dll, and shims/dstorage.cpp for xcrdapi.dll — matching both runtime/CMakeLists.txt and scripts/build_runtime.ps1.
  • The DirectStorage paragraph matches runtime/shims/dstorage.cpp (src/bcpack.cpp BC1/3/4/5/6H/7, BC2 failing with E_NOTIMPL, optional macro-unshuffle and xmem physical page lists on by default, and LEONIDA_DSTORAGE_EXTENDED=0 failing those requests with E_NOTIMPL on queue processing).

Verified locally: git merge-tree against d1dff7949 clean, scripts/check_no_game_data.py exit 0, and test_docs_links.py, test_docs_repo_paths.py, test_docs_table_ids.py, test_docs_env_vars.py, test_docs_cli_flags.py, test_docs_encoding.py, and test_text_write_line_endings.py all pass.

AI-assisted review (Antigravity); every claim checked against main.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6083717276 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1517#pullrequestreview-6083717276). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-27T05:05:24Z. **Review:** APPROVED --- Re-checked at `c8fabf8` merged cleanly onto current `main` (`d1dff7949`). All earlier review items and the post-#2350 split are addressed accurately: - `runtime/README.md` now lists `shims/acphal.cpp`, `shims/xapu_queue.cpp` for `xapu.dll`, `shims/xapu_chad.cpp` for `chad.dll`, and `shims/dstorage.cpp` for `xcrdapi.dll` — matching both `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1`. - The DirectStorage paragraph matches `runtime/shims/dstorage.cpp` (`src/bcpack.cpp` BC1/3/4/5/6H/7, BC2 failing with `E_NOTIMPL`, optional macro-unshuffle and `xmem` physical page lists on by default, and `LEONIDA_DSTORAGE_EXTENDED=0` failing those requests with `E_NOTIMPL` on queue processing). Verified locally: `git merge-tree` against `d1dff7949` clean, `scripts/check_no_game_data.py` exit 0, and `test_docs_links.py`, `test_docs_repo_paths.py`, `test_docs_table_ids.py`, `test_docs_env_vars.py`, `test_docs_cli_flags.py`, `test_docs_encoding.py`, and `test_text_write_line_endings.py` all pass. AI-assisted review (Antigravity); every claim checked against `main`.
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!1517
No description provided.