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

Merged
leonida/mandy
Mike7581 merged 4 commits from docs/runtime-readme-shims into main 2026-11-28 03:48:19 +00:00

Pull request successfully merged and closed

Mike7581 commented 2026-11-25 03:09:31 +00:00

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)
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

[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.
**[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 reviewed 2026-11-25 08:35:46 +00:00
Andretuta left a comment
No description provided.
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

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.

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

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).

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

@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).

@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 approved these changes 2026-11-27 05:05:24 +00:00
Andretuta left a comment

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.

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 description provided.