runtime: pin the DLL spellings the unimplemented-import policy classifies (TEST-POLICY-DLL-SPELLINGS) #1206

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

@⁠nicoco23 on GitHub · 2026-11-24 20:16 UTC · original
nicoco23:policy-dll-spellings → main · +20 −6 · 3 files · 4 commits · open

Claimed in the coordination issue as: TEST-POLICY-DLL-SPELLINGS

#47 showed that the return class depends on the exact DLL spelling: the retail executable imports DStorageGetFactory from XCRDAPI.dll, which classify() did not know. That is fixed in main, but unimplemented_policy_test only checked dstorage_xs.dll, so dropping the xcrdapi.dll or dstorage.dll spelling broke nothing.

  • test: XCRDAPI.dll (retail casing) and dstorage.dll classify as HResult, and another xcrdapi.dll import stays Other.
  • xapu.dll and chad.dll were not in classify(), so under LEONIDA_UNIMPLEMENTED=fail an import of theirs without a shim returned 0 instead of E_NOTIMPL. classify() now names the nine functions whose shims return an HRESULT; XApuGetResultCount returns uint32_t and stays Other. The test checks all ten.
  • audio_hal_exe_calls.md no longer says none of the audio calls is on the list.

Tested: unimplemented_policy_test built and run through ctest on Windows (MSVC), passing. No game files, no GPU.

AI-assisted: yes (Claude Code).

**@⁠nicoco23** on GitHub · 2026-11-24 20:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206) `nicoco23:policy-dll-spellings` → `main` · +20 −6 · 3 files · 4 commits · open Claimed in the coordination issue as: TEST-POLICY-DLL-SPELLINGS #47 showed that the return class depends on the exact DLL spelling: the retail executable imports DStorageGetFactory from XCRDAPI.dll, which classify() did not know. That is fixed in main, but unimplemented_policy_test only checked dstorage_xs.dll, so dropping the xcrdapi.dll or dstorage.dll spelling broke nothing. - test: XCRDAPI.dll (retail casing) and dstorage.dll classify as HResult, and another xcrdapi.dll import stays Other. - xapu.dll and chad.dll were not in classify(), so under LEONIDA_UNIMPLEMENTED=fail an import of theirs without a shim returned 0 instead of E_NOTIMPL. classify() now names the nine functions whose shims return an HRESULT; XApuGetResultCount returns uint32_t and stays Other. The test checks all ten. - audio_hal_exe_calls.md no longer says none of the audio calls is on the list. Tested: unimplemented_policy_test built and run through ctest on Windows (MSVC), passing. No game files, no GPU. AI-assisted: yes (Claude Code).
classify() matches DStorageGetFactory under dstorage.dll, dstorage_xs.dll
and xcrdapi.dll, but unimplemented_policy_test only checked dstorage_xs.dll:
removing the spelling the retail executable uses (XCRDAPI.dll) broke no
test. The test now checks XCRDAPI.dll (retail case, so the lookup stays
case-insensitive), dstorage.dll, and that another xcrdapi.dll name stays
Other.

xapu.dll and chad.dll were not in classify(), so under
LEONIDA_UNIMPLEMENTED=fail an import of theirs without a shim returned 0
instead of E_NOTIMPL. classify() now names the nine functions whose shims
in xapu_chad.cpp return an HRESULT; XApuGetResultCount returns uint32_t
and stays Other. The test checks all ten, and audio_hal_exe_calls.md no
longer says none of the audio calls is on the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the line breaks of the "What the executable already does about a
failure" paragraph change; the words are the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
main classifies the xapu.dll, chad.dll and acphal.dll HRESULT returns through is_audio_hal_hresult in
runtime/shims/registry.cpp, which covers the names this branch listed one by one (and XDspConnect, which main's test
checks), so registry.cpp keeps main's code. unimplemented_policy_test.cpp keeps both sides' checks: main's xcrdapi.dll
probes and this branch's spellings (XCRDAPI.dll, dstorage.dll) and per-function xapu.dll and chad.dll checks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GnGkjYHUWx92TkwvwCnAMe
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:42:53 +00:00
Author
Owner

@⁠espaciointoficial-sys on GitHub · 2026-11-24 21:22 UTC · original · reviewed

Read through the diff (not built or run here). The ten names match the shims' return types in runtime/shims/xapu_chad.cpp on main (nine HRESULT, XApuGetResultCount returns uint32_t), and the new lines cover the retail XCRDAPI.dll casing and the PC dstorage.dll name. Looks good to me. Nits: the edited paragraph in docs/audio_hal_exe_calls.md is one ~200-character line while the file wraps at 120, and if #1144 merges first the registry comment should say xapu.cpp. AI-assisted review (Claude Code).

**@⁠espaciointoficial-sys** on GitHub · 2026-11-24 21:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206#pullrequestreview-6047624568) · **reviewed** Read through the diff (not built or run here). The ten names match the shims' return types in `runtime/shims/xapu_chad.cpp` on `main` (nine `HRESULT`, `XApuGetResultCount` returns `uint32_t`), and the new lines cover the retail `XCRDAPI.dll` casing and the PC `dstorage.dll` name. Looks good to me. Nits: the edited paragraph in `docs/audio_hal_exe_calls.md` is one ~200-character line while the file wraps at 120, and if #1144 merges first the registry comment should say `xapu.cpp`. AI-assisted review (Claude Code).
Author
Owner

@⁠nicoco23 on GitHub · 2026-11-24 21:36 UTC · original

Thanks. Fixed the long line: the paragraph is rewrapped at 120 columns in ef55ee582, same words. I will update the registry comment to name xapu.cpp as soon as #1144 merges, so it is not wrong in the meantime.

**@⁠nicoco23** on GitHub · 2026-11-24 21:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206#issuecomment-7145155182) Thanks. Fixed the long line: the paragraph is rewrapped at 120 columns in ef55ee582, same words. I will update the registry comment to name xapu.cpp as soon as #1144 merges, so it is not wrong in the meantime.
Author
Owner

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

#1144 is merged; its queue reached main as xapu_queue.cpp. The registry comment now names the files gta6rt actually links: xapu_queue.cpp for xapu.dll and xapu_chad.cpp for chad.dll (xapu.cpp and chad.cpp on main are the older shims that only xapu_test and chad_test build). The return types the test pins are unchanged.

**@⁠nicoco23** on GitHub · 2026-11-26 16:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206#issuecomment-7197583869) #1144 is merged; its queue reached main as `xapu_queue.cpp`. The registry comment now names the files gta6rt actually links: `xapu_queue.cpp` for xapu.dll and `xapu_chad.cpp` for chad.dll (`xapu.cpp` and `chad.cpp` on main are the older shims that only xapu_test and chad_test build). The return types the test pins are unchanged.
Author
Owner

@⁠nicoco23 on GitHub · 2026-11-26 19:40 UTC · original

Ready for merge from my side: the review note is addressed (registry comment names xapu_queue.cpp and xapu_chad.cpp), no conflict with main. It would also free a slot for TOOLS-DSTORAGE-HISTORY-JOBS (see #1608).

**@⁠nicoco23** on GitHub · 2026-11-26 19:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206#issuecomment-7201846170) Ready for merge from my side: the review note is addressed (registry comment names xapu_queue.cpp and xapu_chad.cpp), no conflict with main. It would also free a slot for TOOLS-DSTORAGE-HISTORY-JOBS (see #1608).
Author
Owner

@⁠OreoFR on GitHub · 2026-11-26 23:48 UTC · original · reviewed

Read through on main d1dff7949 (static review, no build).

  • The new checks match main's classification: is_audio_hal_hresult in runtime/shims/registry.cpp already classes the xapu.dll and chad.dll functions as HRESULT, with XApuGetResultCount as the exception. classify_import lowercases the DLL name, so XCRDAPI.dll resolves the same way.
  • The doc sentence "all four are on that list now" holds: AcpHalCreate, AcpHalAllocateShapeContexts and ApuCreateHeap are in the acphal.dll branch, and XApuDequeueResult is in the xapu.dll one.
  • Nit: the comment added in registry.cpp repeats its last sentence without a space: ... XApuGetResultCount returns uint32_t.XApuGetResultCount returns uint32_t.

Looks good to me apart from that. AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠OreoFR** on GitHub · 2026-11-26 23:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1206#pullrequestreview-6081664539) · **reviewed** Read through on `main` `d1dff7949` (static review, no build). - The new checks match `main`'s classification: `is_audio_hal_hresult` in `runtime/shims/registry.cpp` already classes the `xapu.dll` and `chad.dll` functions as `HRESULT`, with `XApuGetResultCount` as the exception. `classify_import` lowercases the DLL name, so `XCRDAPI.dll` resolves the same way. - The doc sentence "all four are on that list now" holds: `AcpHalCreate`, `AcpHalAllocateShapeContexts` and `ApuCreateHeap` are in the `acphal.dll` branch, and `XApuDequeueResult` is in the `xapu.dll` one. - Nit: the comment added in `registry.cpp` repeats its last sentence without a space: `... XApuGetResultCount returns uint32_t.XApuGetResultCount returns uint32_t.` Looks good to me apart from that. AI-assisted (Claude Code, Claude Opus 5.5).
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/1206/head:github-bot/gh-1206'
git switch 'github-bot/gh-1206'

Merge

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