Resolver: a console DLL without a route finds PC functions by name #882

Open
github-bot wants to merge 1 commit from github-bot/gh-882 into main AGit
Owner

@⁠mastrr9 on GitHub · 2026-11-24 07:24 UTC · original
mastrr9:feat/resolver-unrouted-console-dll-fallback → main · +47 −0 · 1 files · 1 commits · open

Adds a by-name Win32 fallback in crates/xcl/src/resolver.rs for unrouted console system DLLs that have no PC counterpart (e.g. the minuserx/kernel32legacy/advapi32legacy/minappmodelx class of imports):

  • Before falling back to a zero-returning stub for an unknown console DLL, resolves by-name imports against base PC system DLLs (kernelbase, kernel32, user32, advapi32, combase), strictly after XCL's own HLE function table so kernelx/HLE overrides always take precedence.
  • Does not search network DLLs (preserving XCL_NETWORK=0), does not alter DLLs that already exist on PC, and keeps ordinals and unknown names as stubs.
  • xcl inspect classifies these imports consistently.
  • Adds unit test resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls.

Tested

  • Hardware/OS: NVIDIA RTX 5080 (driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC debug, DXC Windows SDK 10.0.26100.0, d3d12SDKLayers.dll installed
  • Commit tested: 6b53ce15e420f6d13a546206688e981ee63fac26
  • cargo build --workspace: clean (no new warnings; only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls ok)
  • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64

Regression run
Smoke run by @⁠Toons29 in comment below: #882
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: 71ade01a01f9beb63d518ecdc47d6f7338dcb1b9
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14811 MB

Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; the tester checked the blocks before posting.

Not tested

  • No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known.

AI use

  • Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
  • Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
**@⁠mastrr9** on GitHub · 2026-11-24 07:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/882) `mastrr9:feat/resolver-unrouted-console-dll-fallback` → `main` · +47 −0 · 1 files · 1 commits · open Adds a by-name Win32 fallback in `crates/xcl/src/resolver.rs` for unrouted console system DLLs that have no PC counterpart (e.g. the `minuserx`/`kernel32legacy`/`advapi32legacy`/`minappmodelx` class of imports): - Before falling back to a zero-returning stub for an unknown console DLL, resolves by-name imports against base PC system DLLs (`kernelbase`, `kernel32`, `user32`, `advapi32`, `combase`), strictly **after** XCL's own HLE function table so `kernelx`/HLE overrides always take precedence. - Does not search network DLLs (preserving `XCL_NETWORK=0`), does not alter DLLs that already exist on PC, and keeps ordinals and unknown names as stubs. - `xcl inspect` classifies these imports consistently. - Adds unit test `resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls`. **Tested** - Hardware/OS: NVIDIA RTX 5080 (driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC debug, DXC Windows SDK `10.0.26100.0`, `d3d12SDKLayers.dll` installed - Commit tested: `6b53ce15e420f6d13a546206688e981ee63fac26` - `cargo build --workspace`: clean (no new warnings; only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **714 passed, 0 failed, 41 ignored** (`resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls` ok) - `SKIPPED` GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` **Regression run** Smoke run by @⁠Toons29 in comment below: https://git.gtahub.st/github/xcl-dev--xcl/pulls/882 Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: 71ade01a01f9beb63d518ecdc47d6f7338dcb1b9 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14811 MB ``` Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; the tester checked the blocks before posting. **Not tested** - No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known. **AI use** - Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5). - Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
An import from a DLL with no route, not in the game folder and not on
the PC went to the HLE modules by name and otherwise became a stub
returning 0. That is how every console system DLL XCL did not know yet
behaved: minuserx, kernel32legacy, advapi32legacy and minappmodelx each
turned the title's CreateWindowExW, SetThreadAffinityMask or RegOpenKeyW
into a call that "succeeded" with a null result until it got its route.

Before the stub, a function imported by name from such a DLL is now
looked up in the PC's base system DLLs (kernelbase, kernel32, user32,
advapi32, combase), after XCL's own HLE functions. Ordinals stay stubs
(they are DLL-specific), so does a function missing from a DLL the PC
does have, and the network DLLs are not searched (XCL_NETWORK=0 keeps
its own routes). xcl inspect classifies these imports the same way.

Test: unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls
resolves GetCurrentProcessId (kernelbase, and calls it) and
GetSystemMetrics (user32) from an unknown DLL, checks classify, and that
an ordinal, an unknown name and version.dll's missing function stay
stubs. Type-checked for Windows; not run on Windows.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:35 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 09:34 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head 71ade01 onto main 077ce40, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 707 passed, 10 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). name-based DLL routing tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 09:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/882#issuecomment-7127590992) Linux / AMD RDNA3 datapoint. **Merged state:** head `71ade01` onto main `077ce40`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **707 passed, 10 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). name-based DLL routing tests green. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:05 UTC · original

Regression run of 71ade01a on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 71ade01a01f9beb63d518ecdc47d6f7338dcb1b9
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14811 MB

Against the limits in CONTRIBUTING.md: 100 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/882#issuecomment-7151581158) Regression run of `71ade01a` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 71ade01a01f9beb63d518ecdc47d6f7338dcb1b9 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14811 MB ``` Against the limits in CONTRIBUTING.md: 100 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 09:52 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 09:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/882#issuecomment-7158914752) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 21:18 UTC · original

NVIDIA test report for 71ade01 (head as is, base beaa245), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 705 passed, 0 failed, 41 ignored. The end-to-end title tests pass, and so does the new resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 2, both no wave64 on this card.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

**@⁠upipibi** on GitHub · 2026-11-25 21:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/882#issuecomment-7174890917) NVIDIA test report for `71ade01` (head as is, base `beaa245`), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after `cargo build --workspace`: - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2`: **705 passed, 0 failed, 41 ignored**. The end-to-end title tests pass, and so does the new `resolver::tests::unrouted_console_dll_functions_resolve_by_name_in_base_system_dlls`. - Skipped `hle::xaudio2`, because its tests fail or hang on this machine on `main` too. The PR doesn't touch it. - SKIPPED lines: 2, both `no wave64` on this card. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/882/head:github-bot/gh-882'
git switch 'github-bot/gh-882'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-882'
git switch 'github-bot/gh-882'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-882'
git switch 'github-bot/gh-882'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-882'
git switch 'main'
git merge --squash 'github-bot/gh-882'
git switch 'main'
git merge --ff-only 'github-bot/gh-882'
git switch 'main'
git merge 'github-bot/gh-882'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.