kernelx: GetModuleInformation answers for the images XCL mapped #877

Open
mastrr9 wants to merge 1 commit from upstream-pr/883 into main
mastrr9 commented 2026-11-24 07:24:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T07:24:46Z.


Implements K32GetModuleInformation / GetModuleInformation in crates/xcl/src/hle/kernelx.rs so titles, crash handlers, and stack walkers querying XCL-mapped executables and DLLs get valid MODULEINFO instead of Windows failing on modules it did not load:

  • Answers for XCL-mapped modules of the current process (NULL resolves to the title executable), returns ERROR_INSUFFICIENT_BUFFER if cb is too small, and forwards all other modules/processes to Windows.
  • Exported as both K32GetModuleInformation and GetModuleInformation.
  • Adds unit test hle::kernelx::tests::get_module_information_answers_for_mapped_images.

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: 16cd6c162eca7028ff824e00434512d9e9177271
  • 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 (hle::kernelx::tests::get_module_information_answers_for_mapped_images 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://github.com/xcl-dev/xcl/pull/883#issuecomment-7151587505
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: 806b69f17b7ac9509b23b171f69047e564287fc0
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 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.
<!-- greyfinch-sync:ivall/xcl:issue:5467920470 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T07:24:46Z. --- Implements `K32GetModuleInformation` / `GetModuleInformation` in `crates/xcl/src/hle/kernelx.rs` so titles, crash handlers, and stack walkers querying XCL-mapped executables and DLLs get valid `MODULEINFO` instead of Windows failing on modules it did not load: - Answers for XCL-mapped modules of the current process (`NULL` resolves to the title executable), returns `ERROR_INSUFFICIENT_BUFFER` if `cb` is too small, and forwards all other modules/processes to Windows. - Exported as both `K32GetModuleInformation` and `GetModuleInformation`. - Adds unit test `hle::kernelx::tests::get_module_information_answers_for_mapped_images`. **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: `16cd6c162eca7028ff824e00434512d9e9177271` - `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** (`hle::kernelx::tests::get_module_information_answers_for_mapped_images` 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://github.com/xcl-dev/xcl/pull/883#issuecomment-7151587505 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: 806b69f17b7ac9509b23b171f69047e564287fc0 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 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.
SlopTart commented 2026-11-24 10:04:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:03Z.


Linux / AMD RDNA3 datapoint.

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

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 710 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. GetModuleInformation 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.

<!-- greyfinch-sync:ivall/xcl:comment:7127591583 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/883#issuecomment-7127591583). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T09:34:03Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `fc60938` onto main `077ce40`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **710 passed, 7 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows. GetModuleInformation 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.
Toons29 commented 2026-11-25 03:06:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:05:56Z.


Regression run of 806b69f1 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: 806b69f17b7ac9509b23b171f69047e564287fc0
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

Against the limits in CONTRIBUTING.md: 101 % 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.

<!-- greyfinch-sync:ivall/xcl:comment:7151587505 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7151587505). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:05:56Z. --- Regression run of `806b69f1` 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: 806b69f17b7ac9509b23b171f69047e564287fc0 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` Against the limits in CONTRIBUTING.md: 101 % 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.
DavidM1911 commented 2026-11-25 10:10:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:53:41Z.


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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7158943288 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7158943288). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T09:53:41Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
upipibi commented 2026-11-25 21:05:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T20:49:31Z.


NVIDIA test report for 806b69f (head as is, base 85e3826), 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: 867 passed, 0 failed, 42 ignored. The end-to-end title tests pass.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 4: 2 no wave64 on this card, 1 no heap windows, 1 PSO measurement that needs Developer Mode.

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

<!-- greyfinch-sync:ivall/xcl:comment:7174238131 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7174238131). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T20:49:31Z. --- NVIDIA test report for `806b69f` (head as is, base `85e3826`), 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`: **867 passed, 0 failed, 42 ignored**. The end-to-end title tests pass. - Skipped `hle::xaudio2`, because its tests fail or hang on this machine on `main` too. The PR doesn't touch it. - SKIPPED lines: 4: 2 `no wave64` on this card, 1 no heap windows, 1 PSO measurement that needs Developer Mode. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
github-actions[bot] commented 2026-11-30 08:39:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:56Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273189733 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7273189733). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:39:56Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:24:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:24:12Z.


Triage (#1607) – head 806b69f

No open or merged PR adds GetModuleInformation / K32GetModuleInformation to kernelx; main still has neither export.
The diff answers from modules::find_mapped_by_base / main_module only for this process (pseudo-handle or a real handle to it) and falls back to Windows' psapi otherwise; the unit test covers the mapped image, a real process handle, a short buffer and a Windows-loaded module. 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.

<!-- greyfinch-sync:ivall/xcl:comment:7300698346 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7300698346). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:24:12Z. --- **Triage (#1607)** – head 806b69f No open or merged PR adds `GetModuleInformation` / `K32GetModuleInformation` to kernelx; main still has neither export. The diff answers from `modules::find_mapped_by_base` / `main_module` only for this process (pseudo-handle or a real handle to it) and falls back to Windows' psapi otherwise; the unit test covers the mapped image, a real process handle, a short buffer and a Windows-loaded module. 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.
fromthemoonx commented 2026-12-02 21:55:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T21:55:43Z.


merge-check
base: 5ad98adbc3
head: 806b69f17b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none
review: read the whole diff (1 file, +78). One gap, not a blocker.

  • A title that imports the function from psapi.dll itself does not reach it. I resolved the imports with XCL's resolver in a scratch test (not pushed):
    • K32GetModuleInformation from kernel32.dll, kernelbase.dll, kernelx.dll and api-ms-win-core-psapi-l1-1-0.dll: XCL's function;
    • GetModuleInformation from psapi.dll: still Windows' own, because psapi.dll has no route to kernelx. So it stays as on main. The doc comment on GetModuleInformation reads as if it were covered.
  • The answers match Windows: I registered a DLL that Windows had loaded as if XCL had mapped it, and compared both functions for buffer sizes 0, 8, 16, 23, 24, 25 and 64. Return value, base, size, entry point and error code were the same in all 7.
  • The new test fails when the function no longer answers from the mapped images.
  • No title was run here.
  • This head shows no Build and test (Windows, no GPU) run. It needs one before a merge.
    performance: none, only runs when a title asks.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7359981916 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7359981916). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-02T21:55:43Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd head: 806b69f17b7ac9509b23b171f69047e564287fc0 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none review: read the whole diff (1 file, +78). One gap, not a blocker. - A title that imports the function from `psapi.dll` itself does not reach it. I resolved the imports with XCL's resolver in a scratch test (not pushed): - `K32GetModuleInformation` from `kernel32.dll`, `kernelbase.dll`, `kernelx.dll` and `api-ms-win-core-psapi-l1-1-0.dll`: XCL's function; - `GetModuleInformation` from `psapi.dll`: still Windows' own, because `psapi.dll` has no route to kernelx. So it stays as on main. The doc comment on `GetModuleInformation` reads as if it were covered. - The answers match Windows: I registered a DLL that Windows had loaded as if XCL had mapped it, and compared both functions for buffer sizes 0, 8, 16, 23, 24, 25 and 64. Return value, base, size, entry point and error code were the same in all 7. - The new test fails when the function no longer answers from the mapped images. - No title was run here. - This head shows no `Build and test (Windows, no GPU)` run. It needs one before a merge. performance: none, only runs when a title asks. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/883:upstream-pr/883'
git switch 'upstream-pr/883'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/883'
git switch 'upstream-pr/883'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/883'
git switch 'upstream-pr/883'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/883'
git switch 'main'
git merge --squash 'upstream-pr/883'
git switch 'main'
git merge --ff-only 'upstream-pr/883'
git switch 'main'
git merge 'upstream-pr/883'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!877
No description provided.