xgameruntime tests: compare slots by the function bound to their name, not by function address #200
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!200
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/200/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Kalmarv on GitHub · 2026-11-23 20:28 UTC · original
Kalmarv:test/slot-fn-identity→main· +29 −8 · 1 files · 1 commits · closed without mergingThe windows-gnu build fails
hle::xgameruntime::api::tests::legacy_console_iids_map_to_their_own_slots, attargets[36] == register_token4 as usize. Dispatch is correct. The test assumes a function has one address, but Rust doesn't guarantee that (std::ptr::fn_addr_eq). The GNU build has two copies ofregister_token4, one per codegen unit, and the vtable slot holds the other copy.Only that test changes (
crates/xcl/src/hle/xgameruntime/api.rs, +29/−8); there are no production, linker or codegen changes.f as usize.hle::xgameruntimetests, base956a4764c3c156)Mutation checks on the GNU build each fail the new test: routing slot 36 to the wrong slot, routing it to a stub, and a fake S_OK that writes no token. MSVC doesn't show the original failure, as expected, since it emits one copy. No release MSVC build was run.
Not touched: four other
as usizeaddress comparisons elsewhere in the test module, which pass on both builds today.AI-assisted (Claude Code). No game data.
🤖 Generated with Claude Code
@Kalmarv on GitHub · 2026-11-23 21:04 UTC · original
Rebased on main
eaa36b6(0bb3c15, no conflicts).cargo test --release -p xcl --lib xgameruntime: 73 passed. Overlaps: none known; the change is test-only (hle/xgameruntime/api.rstests).@ivall on GitHub · 2026-11-23 21:10 UTC · original
Merged into main (
6da33fa) as4c3c1562, the head before your last rebase - the same patch (identical patch-id), so GitHub does not show it as merged; closing it by hand. Checked on an RX 9070 (RDNA4) with the 22 PRs merged together: 582 unit tests passed, 0 failed, the integration and e2e tests passed, and the retail game still reaches its first menu (646 frames in 30 s, no device removal). Thanks!mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175Pull request closed