Repository navigation
Conversation
|
Independent Windows 11 check at head
|
devnull34
left a comment
There was a problem hiding this comment.
Hardware & Environment
- Host: Windows 11 Build 26300 x64
- Toolchain: MSVC 19.44 (Visual Studio 2022), CMake 4.4
Verification Summary
Targets compiled with MSVC 19.44 and executed natively:
-
**\xg_xs_test.exe**:
- Passed with 16 checks, 0 failures.
- Verified that \xg_xs.dll\ is owned by the shim registry.
- Verified that \XGSuggestSwizzleMode\ returns \E_NOTIMPL\ while preserving caller input buffers.
- Verified that \XGCreateTextureComputer\ rejects null output pointers with \E_POINTER, returns \E_NOTIMPL\ while handing out a safe dummy computer object for callers that don't check return codes.
- Verified that texture computer vtable slots (slots 2, 8, 10, 31) trace one-shot diagnostics and return \E_NOTIMPL\ safely without corrupting caller memory.
-
CTest:
- \xg_xs: Passed (0.01s).
-
Hygiene & Compliance:
- Clean-room compliant: pure synthetic unit tests; zero game assets or proprietary code.
- \git diff origin/main..HEAD --check: Clean (0 whitespace/formatting defects).
LGTM!
shayderrr
left a comment
There was a problem hiding this comment.
Summary
Adds runtime/shims/xg_xs.cpp: XGSuggestSwizzleMode and XGCreateTextureComputer return E_NOTIMPL with once-only caller logging. The latter deliberately still stores a static 32-slot vtable computer in *out because two measured executable call sites use it without checking the HRESULT; slots 0/1 are no-op AddRef/Release, all others log and return E_NOTIMPL without writing outputs. runtime/CMakeLists.txt registers the shim, an xg_xs_test target and a CTest. runtime/test/xg_xs_test.cpp covers registration, mode-field preservation, null-out and slots 1/2/8/10/31. Docs add the xg_xs note and add xg_xs.dll to owns_dll.
Why merge
Closes two of the 30 unimplemented imports from #6715 with behavior derived from static call-site reading, preventing null-pointer calls while staying honest about missing console texture layout. Synthetic Windows tests pass.
Verdict: Approve
SummaryAdds Why mergeCloses two of the 30 unimplemented imports from #6715 with behavior derived from static call-site reading, preventing null-pointer calls while staying honest about missing console texture layout. Synthetic Windows tests pass. Verdict: Approve |
|
Tested This adds the full suite on a newer MSVC to @soldsawn's 19.44 run of
|
a9278c9 to
cc26796
Compare
|
Rebased onto main AI-assisted (Claude Code). |
|
Tested
|
…_NOTIMPL) for the boot test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on the retail boot: pass. Own 1.0.2.1 copy, Windows 11, RTX 4090 / 617.42,
So the design choice to store a computer in |
|
Tested |
|
Thanks for the Wine run. I am leaving slot 2 as it is, for this reason:
AI-assisted (Claude Code). |
|
Tested Built |
…shapes - XGCreateTextureComputer: fix signature from 4 args (desc, device, riid, out) to the measured 2 args (desc, out**). The out pointer arrives in RDX, not R9 — the old 4-arg version wrote through a stale register as textureComputer, which the two callers that ignore the HRESULT would use as a null/wild vtable call. Now returns a static computer with a proper vtable (AddRef/Release for slot 0/1, E_NOTIMPL for all other slots with a one-time log). - XGSuggestSwizzleMode: fix signature from 2 args (desc, mode*) to the measured 3 args (desc, flags, mode*). The mode* arrives in R8, not RDX, so *mode = 0 was previously writing to a wrong register. Now returns E_NOTIMPL and writes nothing (the caller already zeroed the field). - AcpHalCreate: replace the non-dereferenceable id<<4 handle with a static object with a proper vtable (IAcpHal COM-like interface). Any method call through it logs once per slot and returns E_NOTIMPL instead of faulting. Both fixes match the measured call shapes documented in the overlapping PRs ItsNotRexed#6891 and ItsNotRexed#6981 and verified by reviewers. AI-assisted: yes
|
Tested |
|
Tested
Not checked: the real game executable or any game files. AI-assisted: yes (Claude Code ran the build and tests; I read the results). |
…it merges with main's xmem notes
|
New head
Not run against the retail executable. AI-assisted (Claude Code). |
xg_xs: serve XGCreateTextureComputer and XGSuggestSwizzleMode as traced E_NOTIMPL
Item: RT-489, the
xg_xs.dllshim (2 of the 30 unimplemented imports listed in #6715). Claim:#6750 (comment)
What the imports are for
xg_xs.dllis the console's texture layout library. The game executable imports two functions from it. Todayboth resolve to the unimplemented thunk, which returns 0 (S_OK) and writes nothing. Callers then call through an
out pointer that was never written.
What the call sites show (static read of the executable, shapes and counts only)
XGSuggestSwizzleMode(desc*, 0, uint32_t* mode): 2 call sites, both in the game's helper that fills a texturedescription.
modepoints to a 32-bit field of that description. The helper sets the field to 0 first, andwrites
0x100 | modeitself when it already knows the mode. The HRESULT is only passed back up. No callerbranches on it.
XGCreateTextureComputer(desc*, computer** out): 4 call sites. Two test the HRESULT and take their failure pathwhen it is negative. Two ignore it and call through
*outat once.to a large stack structure (2 sites), slot 8 with six arguments in a loop over subresources (1 site) and slot 10
with seven arguments (1 site). No site reads the return value of slots 2, 8 or 10. No site calls slot 0.
What the shim does now
The runtime has no model of the console resource layout.
runtime/src/gfx10_tiling.hcovers two swizzle modes ofone 2D level, without mips or the structure slot 2 fills. So the shim computes no layout:
XGSuggestSwizzleModereturnsE_NOTIMPLand writes nothing. The field keeps the 0 the caller put there.XGCreateTextureComputerreturnsE_POINTERfor a nullout. Otherwise it returnsE_NOTIMPLand still storesone static object in
*out. The two checking callers fail cleanly. The two that don't check get an object theycan call, instead of a null pointer. COM says
*outis null on failure. This breaks that on purpose, for thesecallers.
once and returns
E_NOTIMPL. It writes nothing through its arguments.SHIM_TABLE, soowns_dll("xg_xs.dll")is true. Added to thegta6rtsources.docs/runtime_imports.mddescribes it and adds it to the owned-module list.Hypothesis, not measured: that slots 0 and 1 are AddRef and Release; what slots 2, 8 and 10 mean; and that no
caller reaches a slot above 31. At one site the object is stored in another object and may be called later from
code this read did not follow.
Effect: a texture whose layout the game asks for is not laid out (slot 8 does not copy). This shim is meant to get
past boot without a crash, not to make textures right.
Tests
xg_xs_test(synthetic, no game data): 16 checks, 16 pass. It resolves both exports throughrt::shims::findand checks ownership, the return values, that the mode field is untouched, that the computer isstored, and that slots 2, 8, 10 and 31 return
E_NOTIMPLwithout writing their buffers. It also checks thatextra Releases are harmless.
cteston xg_xs, xmem, unimplemented_policy, loader, pe_loader, loader_tls, process_cmdline, file_system:8 of 8 pass.
gta6rtbuilds and links with the new file.python -I tests/test_docs_repo_paths.py: OK.python -I scripts/check_no_game_data.py: exit 0.Not tested: not run against the retail executable. The full ctest suite was not run.
Tested on Windows 11, MSVC 19.44 (AMD Radeon RX 9070 XT, driver 32.0.32029.2010; the tests use no GPU).
AI-assisted (Claude Code).