Repository navigation
Conversation
…ions Table::Table stored every entry with table()[dll!name] = fn, so a second table serving a name already registered replaced the first silently, in static-initialization order across translation units. ItsNotRexed#7009 and ItsNotRexed#6981 serve the same 10 xapu.dll/chad.dll exports; built together they link cleanly and the game would get whichever table happened to be later. The later entry is still served (no behaviour change), but the collision is now logged once at startup and listed by conflicting_registrations(). shim_table_conflict covers the rule with two synthetic tables, and shim_tables_unique runs gta6rt with no arguments and fails if its own shim set has any collision (main has none). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devnull34
approved these changes
Nov 23, 2026
devnull34
left a comment
There was a problem hiding this comment.
Verified: builds cleanly and passes both shim_table_conflict and shim_tables_unique tests. Detecting conflicting shim registrations at startup prevents silent link-order dependent function overrides across tables.
|
Independent Windows A/B on
This confirms a second real overlap that the diagnostic catches, alongside the XAPU/CHAD pair in the PR description. Windows 11 build 26300, LLVM-MinGW Clang 23.1.6, CPU-only synthetic calls. No game files. AI-assisted testing (Codex). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: #7231 (comment) (new runtime item, no ID in the tables)
Depends on: none. It reads and writes the map only through
table(), so it composes with #7175 (RT-488), which changestable()'s storage but notTable::Table.What and why
Table::Tableinruntime/shims/registry.cppstored every entry withtable()[dll!name] = fn. A second shim table that serves a name already registered replaced the first silently, and which table runs later is static-initialization order across translation units, which nothing controls.This already happens with two open PRs: #7009 (
xapu.cpp,chad.cpp) and #6981 (xapu_chad.cpp) serve the same 10xapu.dll/chad.dllexports. Built together they compile and link cleanly, and all 10 entries are replaced with no message (measurement). The game would get whichever implementation happened to be constructed later.Now:
[rt] shims: <dll>!<name> is registered by two shim tables with different functions; the later one is served) and listed by the newrt::shims::conflicting_registrations().Tests:
shim_table_conflict(new executable): two synthetic tables in one file. It checks that only the name with a different function is listed, the later table's function is served, a shared function is not listed, and a name in one table is untouched.shim_tables_unique(CTest ongta6rt): runsgta6rtwith no arguments, after every shim table has been constructed, and fails on the collision message. It follows thePASS_REGULAR_EXPRESSION "usage: gta6rt"pattern ofgta6rt_rejects_*.mainhas no collision today, so the test requires zero.Tested
Windows 11 26H2 (26300), MSVC 19.44.35229 (v143) + Ninja, RelWithDebInfo, RTX 3060 (driver 617.14).
7c9e25a84, onmain86d1c862d):shim_table_conflictandshim_tables_uniquepass.gta6rtre-registeringkernel32.dll!ExitProcesswith another function makesshim_tables_uniquefail withkernel32.dll!ExitProcess is registered by two shim tables .... The probe file was removed and is not in this PR.main849d3709bvs this change on it: 257 vs 259 tests, the same two failures on both (d3d12_vulkan_device,d3d12_indirect_dispatch_count, both GPU tests, unrelated), and the same 11 skipped and 1 disabled. No build step failed.xapu_chad.cppadded to runtime: serve chad, xapu, xg_xs and AcpHal console audio/DSP/texture imports (RT-5 follow-up) #7009'sgta6rt, the same logging reports the 10 collisions above.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: runtime only)🤖 Generated with Claude Code