Tests: a page's failed move goes to an address Windows never hands out #2763
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2773"
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 inf1425 on 2026-11-26T11:38:37Z.
a_page_whose_move_fails_stays_mapped_where_it_wasgets "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 atmove_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_againread7, this test's value, where it had written0xA. 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 thenvidia-devtest failures reported in #42.What is in it
crates/xcl/src/hle/kernelx.rs(inmod tests): the destination isGetSystemInfo'slpMaximumApplicationAddress + 1, rounded up to 64 KiB. Test code only;windows-sysalready has theWin32_System_SystemInformationfeature.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at this PR's head: 1745 passed, 5 failed, 48 ignored. The 5 failures are the ones reported in #42: four are fixed by #2770 and #2771, and the mesh test is in #2632.XCL_HEAP_WINDOWS=1.cargo test -p xcl --lib hle::kernelx -- --test-threads=4, repeated:an_address_keeps_the_page_the_title_mapped_there_last); that is the release race #2772 fixes;Regression run
#[cfg(test)] mod testsand never reachesxcl.exe, butscripts/pr_check.pycounts any file undercrates/xcl/src/as runtime. Smoke blocks fromnvidia-devand from this head will be added once a title is available, unless a maintainer prefers thetest-onlylabel.main:
PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T12:46:39Z.
Review: COMMENTED
Good within this test-only fix. The failed-move fixture now uses an address Windows cannot hand out, while preserving the assertion that the original page remains mapped. This avoids relying on another thread not reclaiming a released reservation.
Tested clean PR head
0c0a7aa4ef1c0ced8436ebfd9fdaf1c4182baf98, targeting currentnvidia-devaf2cecc40886a8682ecf3267f5328c6dc4b66ad7, in its own worktree and build directory. 1 passed, 0 failed, 0 ignored, 0 skipped. Each filter ran in a fresh process:hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_wasBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Execution:<test-exe> <each-exact-name-above> --exact --test-threads=1 --nocapture. Only private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug tests; no GPU calls in these selected fixtures.Not tested: This is one owned-memory Windows fixture, not a concurrent stress run or proof of unrelated page-mapping paths. This supports retaining the PR; it is not whole-branch or merge certification.
AI use: Codex (GPT-6) reviewed source, ran the exact tests and checked the raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T15:42:56Z.
Both Linux/Wine lanes on head
0c0a7aa4(basenvidia-devaf2cecc4, unchanged), with same-day base numbers from the exact base commit on the same machines. Nobody has posted results here yet, and this is the first.Lanes
xvfbBoth:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::, full wine env per lane (WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b",VKD3D_CONFIG=ignore_shared_fence,XCL_DXC_DIRset).af2cecc40c0a7aa4The point I actually came to check is whether the new sentinel address behaves on Wine:
lpMaximumApplicationAddress + 1is a Windows address-space guarantee, and Wine's layout is its own, so the "commit there fails" expectation could break exactly on Wine lanes. It does not.a_page_whose_move_fails_stays_mapped_where_it_wasis green on both wine-11/Proton and stock wine-10, and since the old version's failure mode was a race with other test threads grabbing the released address, I re-ran the test 10 times per lane with--exact --test-threads=8: 20 of 20 runs green across the two machines. The new form is stable on Wine.For contrast, the old form was also passing on our lanes at
--test-threads=2- the thread-steal race needs a lucky interleave, which matches this being a latent flake rather than a visible failure. Nothing here contradicts the change; it just confirms the replacement sentinel is Wine-safe too.Tested: head + base full lib suite both lanes, the changed test 10x per lane at 8 threads, release profile, Wine. Not tested: Windows, native Linux, in-game.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-27T17:33:07Z.
merge-check
base:
d1be810364(nvidia-dev)head:
0c0a7aa4efmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1822 passed, 10 failed, 48 ignored (the harness lines summed; two of the failing tests re-run themselves in a child process and count twice). Failing, 8 distinct, the base's exact set (1822 / 10 / 48): lib
gpu::recomp::link_tests::gpu_linked_memory_accessors,gpu::recomp::link_tests::linked_programs_keep_their_declarations,hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels(#2771's);d3d12_mesh_stream:console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly(#2788's);gpu_compute_e2e:async_compute_pso_registers_real_pso_and_not_standin,split_compute_prefers_the_offline_whole_pipeline;gpu_two_pass_cache_e2e:two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_waspassed here and on the base: its race is intermittent, so one local pass shows nothing either way; in a fork run ofnvidia-devwith #2837, #2771 and #2788 but not this PR it failed (move_away(..).is_err(), run 46031702142), and with this PR added the next run passed (46032822388).review: none. Test-only, one test: the failed move's destination is the first page past
lpMaximumApplicationAddress(0x7FFFFFFF0000 on x64 Windows), which Windows never hands out and where a commit always fails, instead of an address reserved and released again, which a test on another thread could reserve first (and the move then wrote this test's page into that test's reservation, as the PR shows). Read the whole diff.performance: none, test-only.
verdict: safe to merge. With #2837, #2771 and #2788 it makes
nvidia-dev'sBuild and test (Windows, no GPU)pass (fork run of the four: https://github.com/Kalmarv/xcl/actions/runs/46032822388).hardware / tool and model: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, rustc 1.99.0; the build and tests were run in one queue job by a teammate agent (strange: Claude Code, Claude Opus 5.5) with the same commands, and Claude Code (Claude Opus 5.5) read the logs and the diff and wrote this check.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-27T20:24:24Z.
@inf1425 this PR is one of four test-only fixes that together make
nvidia-dev'sBuild and test (Windows, no GPU)pass (#2837, #2771, #2788, #2773; fork run with all four ond1be8103: https://github.com/Kalmarv/xcl/actions/runs/46032822388), and #3041's queue holds everynvidia-devPR until that job is green. It has a merge check above ("safe to merge"). #3041 does not list drafts, so if you consider it done, marking it ready for review would let it be merged; #2837 is now ready.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T21:28:21Z.
merge-check claim
head:
0c0a7aa4efImported from ivall/xcl. Originally posted by throny on 2026-11-27T21:49:03Z.
merge-check
base:
d1be8103(nvidia-dev)head:
0c0a7aa4efmerge: clean (alone, and together with the other three)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1824 passed, 8 failed, 48 ignored, the same failures as the base (the race this removes did not show in the base run here). base (nvidia-dev
d1be8103) alone on this GPU: 1824 passed, 8 failed, 48 ignored; failing there: async_compute_pso_registers_real_pso_and_not_standin, split_compute_prefers_the_offline_whole_pipeline, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, and two texture_upload tests. All four test fixes together (#2837 + #2771 + #2788 + #2773): 1827 passed, 5 failed, 48 ignored; only the first three names remain, and they fail on the base too.review: none. The test's 'address with nothing reserved' is now the first page past the user address space instead of a page just released, which another test's thread could reserve in between. The page-size rounding is right and nothing is written there.
performance: none (test only).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code (Claude Fable 5.2): merge, build, suite and the review of this small diff; nothing run on the GPU beyond the suite.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:55:45Z.
Triage (#1607) – head
0c0a7aa#1671 makes the same change to the same test in
kernelx.rs: the failed move's target is no longer an address reserved and released on the spot, which another test thread could reserve again. #1671 uses a kernel-space address (0xFFFF_8000_0000_0000); this PR uses the first page pastlpMaximumApplicationAddress. Both make the commit fail for every thread. #1671 was opened first, is simpler and still merges cleanly.Recommendation: close (duplicate of #1671).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-02T10:19:12Z.
Closing as a duplicate of #1671: #1607 group D233, checked by Foniass and Decodere, who both read the diffs and suggest keeping #1671. If something here is not in #1671, say so and reopen it, or ask and I will.
AI use: Claude Code (Claude Opus 5.5) ran the closing script.
Pull request closed