Skip to content

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

Open
nicoco23 wants to merge 4 commits into
ProjectLeonida:mainfrom
nicoco23:policy-dll-spellings
Open

nicoco23 wants to merge 4 commits into
ProjectLeonida:mainfrom
nicoco23:policy-dll-spellings

Conversation

@nicoco23

Copy link
Copy Markdown
Contributor

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

…fies (TEST-POLICY-DLL-SPELLINGS)

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 <noreply@anthropic.com>

@espaciointoficial-sys espaciointoficial-sys left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

…w of ProjectLeonida#1206)

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 <noreply@anthropic.com>
@nicoco23

Copy link
Copy Markdown
Contributor Author

Thanks. Fixed the long line: the paragraph is rewrapped at 120 columns in ef55ee5, 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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
…o policy-dll-spellings

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnGkjYHUWx92TkwvwCnAMe
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
@nicoco23

Copy link
Copy Markdown
Contributor Author

#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

Copy link
Copy Markdown
Contributor Author

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

@OreoFR OreoFR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants