Repository navigation
Conversation
|
Tested a6692f4 on NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (26200), MSVC 2022 RelWithDebInfo: dry run passes, one test regresses, and Retail
Smaller note: the Code read otherwise: no process, network or registry calls; the shims allocate with AI-assisted (Claude Code). |
devnull34
left a comment
There was a problem hiding this comment.
Verified on Windows 11 (MSVC RelWithDebInfo):
- Built
gta6rt.execleanly with the new shims (chad.cpp,xapu.cpp,xg_xs.cpp,acphal.cpp). - Validated
library_loader::host_module_namestack buffer fix and HRESULT classification inregistry.cpp. run_tiny_gdk_loadCTest passed 100% (0.09s).gta6rt.exe --dry-runagainst synthetic guest executable ran cleanly with 0 unimplemented imports.- Python tests
test_gdk_runtime_calls.pyandtest_exe_checklist.pypassed all 30 tests in 0.536s. - Whitespace clean (
git diff HEAD~1..HEAD --check).
|
Tested a6692f4 on Windows 11 Pro 10.0.26100, MSVC 19.51 (VS 18), using my own copy of the same executable (SHA-256
So the shim set works as claimed. Note this PR overlaps #6885, #6981 and #6891 (AcpHal / xapu+chad / xg_xs); a single merge here would cover all four DLLs. Only counts, argument constants and exception classes are reported; no code, strings or bytes from the executable. AI-assisted (opencode). |
|
Built and ran this on Linux (clang-cl 23.1.5 + xwin Win11 SDK 10.0.26100, wine-11.22) applied alone to |
…on, test expectation, revert library_loader - Replace empty SHAPE context structs (1 byte each) with GDK-documented field layouts so sizeof() returns the real per-context stride: SHAPE_XMA_CONTEXT 64 B, SHAPE_SRC_CONTEXT 32 B, SHAPE_PCM_CONTEXT 32 B, SHAPE_FILTVOL_CONTEXT 32 B, SHAPE_DMA_CONTEXT 16 B, SHAPE_EQCOMP_CONTEXT 352 B. Prevents heap overflow when the title writes through the real stride (e.g. memset xmaContextArray with 64-byte stride into a 1-byte-element allocation). - Remove the src == pcm + xma validation in AcpHalAllocateShapeContexts. The title calls with numSrcContexts=0, numXmaContexts=350, numPcmContexts=0 (XMA allocated independently), which failed the check and returned E_INVALIDARG. Accept any combination. - Remove stray 'S_OK;' dead statement in XGSuggestSwizzleMode. - Update unimplemented_policy_test: replace the 'unmeasured acphal import is other' expectation with proper checks for the newly classified imports across chad, xapu, xg_xs, and acphal DLLs. - Revert library_loader.cpp to the original cached-map implementation. The stack-buffer change is unrelated to the audio/DSP shims and belongs in its own PR. AI-assisted: yes
|
Thanks for the thorough review, @dadsmallbuk1. All three issues are fixed:
Also removed a stray dead Tested (same conditions as before): cross-built with clang-cl + xwin on Linux. The dry-run still shows 9 unimplemented imports (down from 30), and |
|
One independent build-integration finding remains at On the previous head |
|
Tested
AI-assisted (Claude Code). |
|
@Spacecer2, thanks for the careful read. The two arity blockers and the AcpHalCreate handle issue are fixed in commit e86d997: 1.
2.
3.
|
|
Retested at e86d997 (same machine: RTX 5090, driver 617.42, Windows 11 26200, MSVC 2022 RelWithDebInfo): pass.
Thanks for the quick turnaround. AI-assisted (Claude Code). |
|
Tested 390ade8 on Windows 11 26H2 (26300), MSVC 19.44.35229 (v143) + Ninja, RelWithDebInfo: Overlap with #6981 is silent if both merge. This PR's Measured locally: I added #6981's Suggestion, independent of which of the two lands: make AI-assisted (Claude Code). |
|
@wasonidas, good catch. Fixed in commit 651395d: added the four new shim sources (chad.cpp, xapu.cpp, xg_xs.cpp, acphal.cpp) to the standalone cl.exe source list in scripts/build_runtime.ps1, and reverted the unrelated .gitignore change. The fallback list now matches the CMake target. |
|
Test files added in commit fddca8e:
All four are registered in CMakeLists as build targets and CTest entries ( |
|
Tested this PR's four shims (acphal, chad, xapu, xg_xs at e86d997) inside a local stack of #7132 + #6919 on the retail 1.0.2.1 package, Windows 11, MSVC 14.50. Dry-run: 0 unimplemented imports, 5 modules mapped.
AI-assisted. No game data (no addresses, RVAs, strings or dumps beyond 'pointer into ASCII data'). |
|
Tested Build failure
Remaining targets (built individually via
|
|
Re-tested at |
|
@gabrielcruzg3, thanks for catching those build/test failures. All three fixed in commit 654d499:
This was the same class of bug as the xg_xs arity issue identified by Spacecer2 — the GDK doc signatures don't match the actual call site register layout. The same pass checked for similar issues and fixed (5→4 args) and (3→2 args) arities. |
Integrates the non-merge commits of upstream PR ItsNotRexed#4348 (f87d05f, c77338e, ac1843d), resolving build lists and import-policy tests alongside PR ItsNotRexed#7009. Adds the existing 258-check DirectStorage regression target to the fork's integration build. AI-assisted integration. Local fallback-build tests: 8 passed; GDK inspection tests: 23 passed; no-game-data and diff checks passed. Compression and GPU destinations remain unsupported as documented upstream.
|
Fixed the flag routing: Change: flags=1 → cached heap, flags=2 → non-cached heap. The previous anything-non-zero-is-non-cached mapping would route a flags=1 larger-than-noncached request to the wrong heap and fail the boot. Test now covers the real boot flow with the title's actual sizes:
acphal_test: 44/44, 0 failures |
…IMPL Measured on the retail boot once ApuAlloc gives memory: the audio init calls AcpHalCreate, then object slot 0 with (0x1000, 0x1000) and slot 2 with (command, dword, dword, pointer, dword), checks both, and a failure is its fatal assert. The local object took slots 0/1 for AddRef/Release and answered E_NOTIMPL from slot 2 on. The slots now follow the title's call shapes, read the same way by ItsNotRexed#6885 (its whole AcpHal rewrite was not merged: this tree already has ItsNotRexed#7009's shim): 0 connect and 1 disconnect succeed, 2 accepts and drops each command (no audio processor on a PC, logged once), 3 and 4 answer 0 (no message), 5 is the release at shutdown. Names are hypotheses. acphal_test: the slots in those shapes (36 checks, 0 failures). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Real-exe measurement on this head: the audio bring-up reaches these two calls and the current answers end the boot. Both are from the retail executable (1.0.2.1), merged here with the rest of the boot stack; no game data is quoted, only call shapes and results. 1. 2. With those two changes the same build goes from a crash at 8.5 s (after 53k D3D12 calls) to a running frame loop with no audio exception. I have not posted a patch because the files are yours in this PR; happy to send one, or test a new head. AI-assisted (tested on Windows 11, RTX 5070 Ti, driver 621.1.0.0). |
|
Independent Windows 11 check of the audio shims at f5fdc15e with Clang 23.1.5 and libc++. The native acphal and xapu ABI tests passed 44 and 18 checks. chad.cpp failed to compile at both std::nothrow uses because was missing. With the one-line include, the chad ABI test passed all 12 checks. The standalone build used a fail-fast definition of an MSVC intrinsic for the unrelated unimplemented-import path. The three test processes exited normally. Synthetic inputs only. AI-assisted. Include fix. |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
|
Tested Full runtime One question: the description mentions a AI-assisted (Claude Code). |
|
Tested 5b8288d (merged into a local tree: |
|
Follow-up to my last comment: with the updated head the audio init goes through, and the crash that followed was Environment: CachyOS, Wine 11.22, Intel i9-14900KF, RTX 5070 Ti / NVIDIA 620.73.04, clang-cl 23.1.5 + xwin SDK, own 1.0.2.1 copy, no int3 skipping. Counts and shapes only. AI-assisted (Claude Code). |
LaugeM
left a comment
There was a problem hiding this comment.
Read at f5fdc157 against main 5d74c2723. The AcpHal fixes from the earlier rounds hold (flags 1 and 2, 32-bit APU addresses, slot 2 S_OK), and this is the only audio PR that adds all four files to the cl.exe fallback list in scripts/build_runtime.ps1. But four problems are still open at this head, and #6885 (AcpHal) and #6981 (xapu, chad) don't have them. I would merge those two and close this one, or cut it down to what they don't have.
-
XDspActivatewrites neither output (runtime/shims/chad.cpp:172-175). kennymaakay raised this above and it is still unanswered. The title passes two fields of its own object as outputs and later reads+4and+0xcthrough the status one with no null check (#6981's description, confirmed by Razuri0 there). This version takes fouruint64_tand returnsS_OKwithout writing through them, so the title reads through null. #6981 hands back zeroed memory. Confirmed (code read). -
AcpHalReleaseShapeContextsdereferences an argument the title doesn't pass (acphal.cpp:299-312). It frees six pointers read throughctxand then clears 120 bytes there. The only call site passes a handle read from the first global (docs/audio_hal_exe_calls.md,AcpHalReleaseShapeContextsrow), which is not the shape struct, so this frees whatever those bytes hold. It runs on the shutdown path. Confirmed (code read against the doc). -
AcpHalAllocateShapeContextswrites 0x78 bytes into the caller's struct (acphal.cpp:253-286, struct at:210-231): six pointers plus six zeroedAPU_ADDRESSfields. What is measured is six counts and the pointer at+0x38, so the struct may end at+0x40, and then this writes 56 bytes past it. #6885 got the same report for one pointer at+0x40and fixed it by writing only the pointers for non-zero counts. Whether the title's struct really ends at+0x40is not measured, so plausible. -
The XApu result queue is always empty (
xapu.cpp:93,:131). The title marks a stream opened only on a type 1 result and frees its id only on a type 2 result (#6981, and SweatierKey's read there). With this shim no stream ever opens, and after 256 opens the id pool is empty. #6981 echoes types 1 and 2. Plausible (static reads by others).
Smaller: xapu.cpp:80 uses a throwing new, so std::bad_alloc can unwind into the title's frames (#6981 fixed the same thing). The description still lists xg_xs.cpp and a library_loader.cpp fix that are no longer in the diff.
Overlap: SHIM_TABLE(chad) and SHIM_TABLE(xapu) register the same names as #6981, #8848 and #9168. Table::Table (runtime/shims/registry.cpp:478-480) keeps the last one constructed, so if two of these merge, link order picks the implementation with no warning (pvfreis measured this above; #7502 would log it).
AI-assisted review (Opus 5.5). Read the diff against main; not built.
ASSET-587 (was RT-AGENTS-AUDIO-SHIMS). Claimed in #6750.
What and why
The retail
game_scarlett_master.exeimports 30 functions from seven Xbox-only DLLs, of which 21 are from four DLLs with no shim in the repository:chad.dll,xapu.dll,xg_xs.dllandAcpHal.dll. The other six (xmem.dll, d3d12_xs.dll, XCRDAPI.dll) already have open PRs (#6803, #5253, #5381, #6792, #4348).This adds shims for all 21, removing them from the unimplemented list. The dry-run report now shows 9 unimplemented imports (down from 30).
Changes
Four new shim files and three unchanged ones that ship with the runtime tests:
runtime/shims/chad.cppruntime/shims/xapu.cppruntime/shims/xg_xs.cppruntime/shims/acphal.cppEach shim:
E_NOTIMPLfor XGCreateTextureComputer (no tiling hardware on PC)Supporting changes:
runtime/shims/registry.cpp: HRESULT classification for all four DLL familiesruntime/CMakeLists.txt: source file registrationruntime/shims/library_loader.cpp: fixed null-map crash inhost_module_namewhen called from CRT init (the static std::map allocated withnewcrashed when the CRT heap was not initialised yet)Tested
gta6rt --dry-run game_scarlett_master.exe: 30 → 9 unimplemented imports, all 21 new imports show asshimgta6rt --init game_scarlett_master.exe: exit 0, all DllMain and TLS callbacks passgta6rt --run game_scarlett_master.exe: boots past the audio/ACP initialization, stops atd3d12_xs.dll!D3D12ConfigureVirtualMemoryX(PR d3d12_xs: D3D12ConfigureVirtualMemoryX shim (first unimplemented call of the title) #6792)AI-assisted: yes