Skip to content

Tests: a page's failed move goes to an address Windows never hands out - #2773

Draft
inf1425 wants to merge 1 commit into
xcl-dev:nvidia-devfrom
inf1425:tests/kernelx-move-fails-unreservable-address
Draft

inf1425 wants to merge 1 commit into
xcl-dev:nvidia-devfrom
inf1425:tests/kernelx-move-fails-unreservable-address

Conversation

@inf1425

@inf1425 inf1425 commented Nov 26, 2026

Copy link
Copy Markdown

a_page_whose_move_fails_stays_mapped_where_it_was gets "an address with nothing reserved" for its move by reserving a page and releasing it again. With tests running on other threads, Windows can give that address to one of them before the move. The commit then succeeds and the test fails at move_away(..).is_err(). Worse, the move writes this test's page into the other test's reservation. In one parallel run, a_page_leaving_plain_memory_has_the_tiles_over_it_linked_again read 7, this test's value, where it had written 0xA. The destination is now the first page past the user address space. Committing there always fails, and Windows never gives that address to anyone. Found while checking the nvidia-dev test failures reported in #42.

What is in it

  • crates/xcl/src/hle/kernelx.rs (in mod tests): the destination is GetSystemInfo's lpMaximumApplicationAddress + 1, rounded up to 64 KiB. Test code only; windows-sys already has the Win32_System_SystemInformation feature.

Tested

Regression run

  • The change is inside #[cfg(test)] mod tests and never reaches xcl.exe, but scripts/pr_check.py counts any file under crates/xcl/src/ as runtime. Smoke blocks from nvidia-dev and from this head will be added once a title is available, unless a maintainer prefers the test-only label.

main:

PR:

Not tested

  • AMD, other NVIDIA cards, Linux/Wine, a release build, any retail title.

AI use

  • Claude Code (Claude Opus 5.5) found the race and confirmed it from the other test's output, wrote the change and ran the tests. I read every line of the diff.

a_page_whose_move_fails_stays_mapped_where_it_was made its destination
"an address with nothing reserved" by reserving a page and releasing it
again. With tests on other threads, Windows can hand that address to one
of them before the move: the commit then succeeds, the test fails at
`move_away(..).is_err()`, and the move writes the page's bytes into the
other test's reservation (a_page_leaving_plain_memory_has_the_tiles_over_it_linked_again
then read 7, this test's value, where it had written 0xA - seen in a
parallel run of hle::kernelx).

The destination is now the first page past the user address space
(GetSystemInfo's lpMaximumApplicationAddress + 1, rounded up to 64 KiB):
committing there always fails, and no other test can be given it. Test
code only.

Assisted-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant