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

Open
github-bot wants to merge 4 commits from github-bot/gh-1517 into main AGit
Owner

@⁠Mike7581 on GitHub · 2026-11-25 03:09 UTC · original
Mike7581:docs/runtime-readme-shims → main · +13 −7 · 1 files · 4 commits · open

Claimed in the coordination issue as: DOC-RUNTIME-README-SHIMS (#14)

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)
**@⁠Mike7581** on GitHub · 2026-11-25 03:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517) `Mike7581:docs/runtime-readme-shims` → `main` · +13 −7 · 1 files · 4 commits · open Claimed in the coordination issue as: DOC-RUNTIME-README-SHIMS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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)
The compat-modules section still said those four console DLLs have no shim here, and the DirectStorage entry
said BCPack, swizzle and physical-page requests are not done. shims/acphal.cpp, chad.cpp, xapu.cpp and
dstorage.cpp exist, and docs/directstorage.md describes the BCPack decoder, macro-unshuffle and xmem
physical-page resolution. The 867d922 measurement is kept and marked as taken before those shims.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up for #1517: the runtime target links shims/xapu_chad.cpp for both xapu.dll and chad.dll (shims/xapu.cpp and shims/chad.cpp only build for their ABI tests), and LEONIDA_DSTORAGE_EXTENDED=0 makes BCPack, swizzle and physical-page requests return E_NOTIMPL (shims/dstorage.cpp validate_request).
EnqueueRequest returns void; validate_request runs on the queue worker (execute_request and prepare_in_background), so BC2 and, with LEONIDA_DSTORAGE_EXTENDED=0, BCPack, swizzle and page-list requests fail there rather than returning the error.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:55:05 +00:00
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:33 UTC · original · edited 2026-11-25 03:45 UTC

[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.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7152032036) · edited 2026-11-25 03:45 UTC **[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.
Author
Owner

@⁠Andretuta on GitHub · 2026-11-25 08:35 UTC · original · requested changes

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.

**@⁠Andretuta** on GitHub · 2026-11-25 08:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#pullrequestreview-6054228353) · **requested changes** 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.
Author
Owner

@⁠Mike7581 on GitHub · 2026-11-25 17:38 UTC · original

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.

**@⁠Mike7581** on GitHub · 2026-11-25 17:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7169789570) 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.
Author
Owner

@⁠nicoco23 on GitHub · 2026-11-26 16:28 UTC · original

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

**@⁠nicoco23** on GitHub · 2026-11-26 16:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7197698756) 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).
Since #1144 merged (via #2350), xapu_chad.cpp serves only chad.dll and xapu.dll comes from xapu_queue.cpp, which runtime/CMakeLists.txt links into gta6rt and build_runtime.ps1's cl.exe fallback compiles. Wording from nicoco23's review.
Author
Owner

@⁠Mike7581 on GitHub · 2026-11-26 19:24 UTC · original

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

**@⁠Mike7581** on GitHub · 2026-11-26 19:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#issuecomment-7201554717) @⁠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).
Author
Owner

@⁠Andretuta on GitHub · 2026-11-27 05:05 UTC · original · approved these changes

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.

**@⁠Andretuta** on GitHub · 2026-11-27 05:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1517#pullrequestreview-6083717276) · **approved these changes** 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`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1517/head:github-bot/gh-1517'
git switch 'github-bot/gh-1517'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1517'
git switch 'github-bot/gh-1517'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1517'
git switch 'github-bot/gh-1517'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1517'
git switch 'main'
git merge --squash 'github-bot/gh-1517'
git switch 'main'
git merge --ff-only 'github-bot/gh-1517'
git switch 'main'
git merge 'github-bot/gh-1517'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.