XGameRuntime: separate XUser COM lookup ID namespaces #2957
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2957"
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?
Imported from ivall/xcl. Originally posted by kotekompotek on 2026-11-27T04:58:05Z.
Independent providers' XUser COM lookups no longer share one ID namespace: slot 10 (
XUserFindUserByLocalId) resolves local IDs and slot 12 (XUserFindUserById) resolves XUIDs, matching the direct implementations, instead of both falling through the sharedfind_user. Fixes #2914.This revives the withdrawn #2922 by @CryingLaughing — closed unmerged with zero review comments. The cherry-pick is byte-identical (
git diffagainst the original head is empty, patch-id identical, authorship preserved); no rebase edits. All verification below is fresh on this machine.What is in it
xgameruntime/api.rs: slots 10/12 now use the direct implementations' separate namespaces (local ID vsconfig().user_idXUID) in the COM implementation list; the sharedfind_userremains only for the offlineXUserAddByIdWithUiAsyncpath (unchanged, outside the issue's scope).xuser_lookup_slots_keep_id_namespaces_separatequeries the real COM object through slots 10/12 with matching and swapped IDs.Tested
cargo test -p xcl --lib -- --test-threads=4: 1316 passed, 3 failed, 27 ignored — the 3 failures are the documented unmodified-main baseline (two pipeline_cap_tests need SM 6.6; gpu_retire_queue driver HRESULT on this GPU).cargo clippy -p xcl --all-targets(1.100): zero warnings in the changed lines. Pre-existing crate noise unchanged.Regression run
Synthetic XCL test title (boot/sign-in regression check; it does not call the fixed slots — the unit test is the real coverage).
main:
this PR:
Note: upstream main advanced to
fa671a2fduring validation; the branch is based on8b957bec(the state everything was validated against) and merges cleanly pergit merge-tree— no overlap with the 3 new D3D12/UMA commits.Not tested
Retail titles (none available on this machine); the synthetic title does not call
XUserFindUserByLocalId/XUserFindUserById.AI use
Implementation by the original author; revival, verification and write-up AI-assisted (Devin / SWE-2.1).
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-27T05:27:30Z.
Verified PR #2957 (
5c883c11) independently on Windows 11 with an SM 6.6 NVIDIA GPU (giving a clean 0-failure full workspace baseline beyond the GTX 1050 run) and reviewed the diff. Everything passed cleanly with no issues found.Diff Review
crates/xcl/src/hle/xgameruntime/api.rs&mod.rs:gdk_table.rs:14,16:XUserFindUserByLocalIdis slot10andXUserFindUserByIdis slot12onXUSER.fns!directly tomod.rs::XUserFindUserByLocalId(matchesLOCAL_IDonly) andmod.rs::XUserFindUserById(matchesconfig().user_idonly) cleanly separates the namespaces, preservesE_INVALIDARGon nulloutandE_NOT_FOUNDon mismatch, and properly incrementsUSER.refson hit.find_userremains used byadd_by_id_async(XUserAddByIdWithUiAsync,api.rs:994), so no dead-code or offline add-by-ID regressions.xuser_lookup_slots_keep_id_namespaces_separateverifies distinct IDs, tests both matching and swapped lookups through the real COM vtable slots10and12, and closes returned handles cleanly.Environment
26300.9818)32.0.16.2140)rustc 1.100.0(stable-x86_64-pc-windows-msvc), VS 2022 Build Tools17.14.45, Windows SDK10.0.26100.0(DXC1.9.2602.17)Test Results (
5c883c11)cargo test --locked -p xcl --lib -- xgameruntime --nocapture1.29s, includingxuser_lookup_slots_keep_id_namespaces_separate)cargo build --workspace --locked && cargo test --workspace --locked --no-fail-fast -- --test-threads=4(XCL_ADAPTER=NVIDIA)xcl --lib: 1,319 passed, 0 failed, 27 ignored in31.57s; 29 capability/SDKSKIPPEDlines on wave32 without Graphics Tools/Developer Mode)Not Tested
#[ignore]tests in the workspace suite.(AI disclosure: diff review, test commands, and summary formatting were assisted by Antigravity / Gemini 4; all builds and tests were executed locally on the hardware listed above.)
Imported from ivall/xcl. Originally posted by DrDarkDK on 2026-11-27T10:54:56Z.
Tested clean
5c883c1149df5b45cccd78790b56fd3e6ee1faadon Windows 11 build 26300.9974, RTX 4070 Ti (driver 621.01), Ryzen 9 7900X, 31.15 GiB RAM, Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug.cargo +stable test --offline --locked -p xcl --lib xuser_lookup_slots_keep_id_namespaces_separate -- --test-threads=1 --nocapturereturned 1 passed, 0 failed. Both COM slots accepted the matching IDs and rejected the swapped IDs.cargo +stable build --offline --locked --workspacepassed.cargo +stable test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturewith a fresh writableXCL_DXIL_CACHEreturned 1447 passed, 0 failed, 47 ignored. The run printed 25SKIPPEDlines: 21 wave64 cases, 3 unsupported per-lane cases, and 1 heap-window case.console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(DXIL not compiled yet). I reproduced it in isolation on both the head and its parent8b957bec. The focused cache test and the full workspace suite passed on the head with a fresh cache.Not tested Retail gameplay or game-backed fixtures. No
XCL_SAMPLE_*variables were set.AI use Codex (GPT-6) ran the tests, checked the baseline failure, and drafted this report.
AI-assisted with Codex.
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T19:20:38Z.
merge-check claim
head:
5c883c1149Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T19:40:32Z.
merge-check
base:
ff0c364b3dhead:
5c883c1149merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, run in the same batch: 2888 passed, 1 failed, 51 ignored, 28 SKIPPED lines; its one failure,
hle::d3d12x::pso_async::used_tests::emission_resolves_the_retained_recipe_after_title_address_reuse, passed in this merged run and in the six others of the batch, so it is intermittent on the base and not this PR's. The new testxuser_lookup_slots_keep_id_namespaces_separatepassed.review: no blocking finding; two files, every hunk read. Slots 10 and 12 of the XUser table now go to
XUserFindUserByLocalIdandXUserFindUserByIdthemselves, where both went tofind_user, which accepts either kind of id;find_userstays for the offline add-by-id path (api.rs, still called there, no dead-code warning in the build: 37 warnings, as on the base). The test calls both slots through the thunk with both ids and expectsE_NOT_FOUNDfor the id of the other namespace. Behaviour change to be aware of: a title that passed an Xbox user id to the local-id lookup (or the reverse) used to get the user and now getsE_NOT_FOUND. README updated. Not done: a retail title run.performance: none: two table entries.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:41:23Z.
merge-check claim
head:
5c883c1149Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:46:04Z.
merge-check
base:
ff0c364b3dhead:
5c883c1149merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 0 failed, 51 ignored (25 SKIPPED: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none; new test hle::xgameruntime::api::tests::xuser_lookup_slots_keep_id_namespaces_separate passed
review: none. Read the full diff (+40/-4 across README.md and crates/xcl/src/hle/xgameruntime/api.rs). Wires XUserFindUserByLocalId and XUserFindUserById directly into xuser()'s COM vtable (slots 10 and 12) instead of routing both through find_user; verified find_user is still called by the offline add-by-ID path (line 1028), so no dead code is introduced. The new unit test queries the XUSER COM object, confirms slots 10 and 12 find the user for their own IDs (LOCAL_ID / XUID) and return E_NOT_FOUND with a null handle for the other namespace's ID (would fail before the fix), and closes returned handles cleanly. Minimal scope; no duplicates found in open/merged PRs (#2922 is closed) or #1607.
performance: none (removes one extra fallback call on XUserFindUserById; infrequent API call)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro build 26300, Rust 1.100.0 / T3 Code (Antigravity), Gemini 4 Neon (Medium)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:13:44Z.
Triage (#1607) – head
5c883c1No open or merged PR makes the same change.
Slots
XUserFindUserByLocalIdandXUserFindUserByIdnow go to their own functions (local ID and XUID only), instead of both going tofind_user, which accepts either.find_userstays forXUserAddByIdWithUiAsync. The test checks that each slot refuses the other namespace's ID. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.