inplace test: decommit the pages again for up to two seconds (the test failed about 8 runs in 100) #877
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/878"
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 fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T11:34:32Z.
inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offsetfails now and then in the wholevictory-gputest binary onmain(f85101b), and never alone. On this machine (Windows 11, RX 6950 XT, Rust 1.98.1): 10 failures in 120 runs of the binary (the test alone: 0 in 100 runs).eazyvessaw the same test fail 4 in 100 runs on an RX 9070 XT in #849.Which assertion. I printed the Windows error in the failing runs. The failing line is
inplace.rs:1239,assert_ne!(mem::VirtualFree(base.add(2 * K64).cast(), K64, mem::MEM_DECOMMIT), 0), and the error isERROR_INVALID_PARAMETER(87). That line runs right afterdrop(placed).Why, as far as I can tell. I did not read the host's code; this is inferred from the behaviour: the placed buffer is a view of the test's own memory made through the device, and dropping it hands the pages back to the runtime, which lets go of them a moment later. While other tests of the binary keep the (WARP) device busy, the decommit can come before that, and it fails.
The change. The test repeats the decommit every 10 ms for up to 2 seconds and asserts it in the end, with the Windows error in the message. Only the test changes.
Checks. 250 runs of the whole
victory-gputest binary with this change: the test failed 0 times (before: 10 in 120). I did not run the other crates' tests again; nothing outside this test changes. The binary still fails for the reasons #849 fixes (the indirect budget test) and for the rare crash in #850; those are not in this PR.AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code
Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T11:34:47Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from fxceless/victory-fork. Originally posted by HailLucifer666 on 2026-11-25T15:20:28Z.
Independent confirmation of your diagnosis, from a different angle, and one negative result that may save someone an hour.
I hit the same failure today on my own machine (Windows 10, software adapter) while checking a branch under four concurrent test processes rather than one binary's threads:
Same assertion, same silence:
left: 0 right: 0.The negative result. The obvious fix is to submit one empty command list after
drop(placed)and wait for its fence, on the theory that the runtime frees the heap when the queue finishes. It does not: 4 failures in 32, against 3 in 29 without. The release is not tied to our submissions, so waiting for a fence buys nothing. Only waiting on theVirtualFreeoutcome worked.The mechanism, for whoever reads this next.
drop(placed)drops the last reference; D3D12 releases the heap asynchronously, and until it does the pages stay closed to everyone —VirtualFreethere answers error 87, which is exactly whatinplace.rs's module header says a title sees while a heap from its address stands. So this is the header's rule observed from the other side, not a test artefact.One suggestion for the message, since
left: 0 right: 0is what made this expensive to read:capturing
std::io::Error::last_os_error()on each attempt. It turns the failure into a sentence that names the cause.Your two seconds and my one second are the same fix — I am not opening a competing PR; I've dropped my branch. Yours is the one to take. The only thing I'd add is the error text.
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.