Tests: a failed page move commits nowhere another test can reserve (#1487) #1661
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1671"
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 Diskuss on 2026-11-24T19:06:02Z.
hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_wasfailed once in a parallel run (reported in #1487), withassertion failed: move_away(&mut away, old, at, page, false).is_err().The cause: to get "an address with nothing reserved", the test reserves 64 KiB and releases it again. In a parallel run, another test can reserve that address before
move_awayruns. TheMEM_COMMITthen succeeds,move_awaycopies the page's 64 KiB over the other test's memory, and returnsOk, so the assert fails. The other test's memory is also overwritten, which can make that test fail too.What is in it
crates/xcl/src/hle/kernelx.rs, test module only: the destination is now0xFFFF_8000_0000_0000, a kernel-space address. A commit there always fails, and no thread can reserve it.move_awayitself is unchanged.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on this head: 858 passed, 0 failed, 42 ignored, the same as mainc160d86. 1 SKIPPED printed (heap_window_out_of_memory_falls_back_to_the_switch_form); 2 debug-layer tests skip silently (no Graphics Tools installed). No device removal.--test-threads=16(the default here), 22 runs: 22 × 809 passed, 0 failed.c160d86, the failure is rare on this machine: 1 of 3 earliercargo test --workspaceruns at default threads (#1487). In today's runs: 0 of 20 with the test alone, 0 of 10 full-lib runs at 16 threads, and 0 of 30 full-lib runs at 32 threads. So the zero above shows that the change breaks nothing, but it does not prove the flake is gone. The cause above is from reading the code.Regression run
scripts/smoke.ps1on the retail title, 60 s, release build,XCL_NETWORK=0, AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0. Blocks copied unchanged:mainon4178e888, this PR on its head commit with no uncommitted changes.#[cfg(test)] mod testsonly, so this run only shows that the build is unaffected; it does not reach the changed test.Not tested
scripts/smoke.ps1on our machine (no game files); the regression run above is Toons29's. NVIDIA and Intel (but see the RTX 3060 Ticargo test -p xcl --libresult from DavidM1911 in the comments).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:26:36Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:35:08Z.
Regression run of
85a743fdon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.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.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:24Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:27:43Z.
Triage (#1607) – head
85a743f#2773 (draft, opened later) makes the same fix to
a_page_whose_move_fails_stays_mapped_where_it_was. Both PRs stop reserving and releasing a scratch address that another test thread could reserve before move_away commits there. #2773 uses the first 64 KiB page past lpMaximumApplicationAddress; this PR uses the kernel-space address 0xFFFF_8000_0000_0000. Either way the MEM_COMMIT in move_away fails as the test expects. This PR was first, and its description has the test runs and a regression run.#1520, #1600 and #1628 are other #1487 flakes and do not overlap.
No problems found in the diff. It is still a draft.
Recommendation: keep open.
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 Kalmarv on 2026-12-02T23:42:35Z.
CI evidence for this fix: job 143772436418 (
pr/resource-creation-fallbacks, 2026-12-02), which does not touchkernelx, failed withassertion failed: move_away(&mut away, old, at, page, false).is_err()ina_page_whose_move_fails_stays_mapped_where_it_was. That is the failure this PR describes: another test thread's first-fitVirtualAlloctook the address the test had released, so the commit succeeded. It was the only failure of that kind in a survey of the 60 most recent failedBuild and test (Windows, no GPU)runs.Written with Claude Code (Claude Opus 5.5) from the CI logs.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.