In-place test: ask again for the decommit while the shared WARP device lets the heap go #151

Open
github-bot wants to merge 1 commit from github-bot/gh-151 into main AGit
Owner

@⁠iTzAlvar on GitHub · 2026-11-24 21:54 UTC · original
iTzAlvar:fix/inplace-test-decommit-retry → main · +10 −2 · 1 files · 1 commits · open

Problem

inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset fails about one run in six of cargo test -p victory-gpu --lib:

panicked at crates\victory-gpu\src\inplace.rs:1145:13:
assertion `left != right` failed
  left: 0
 right: 0

VirtualFree(MEM_DECOMMIT) of the pages under a heap already dropped returns 0 with error 87 (ERROR_INVALID_PARAMETER). Run alone, the test always passes.

Cause

The WARP device is one per process, shared with the other WARP tests running at the same time. While the device is busy, the runtime lets the heap opened with OpenExistingHeapFromAddress1 go a moment later, and until then Windows holds the pages and refuses the decommit. Dropping the test's own queue and list first does not help, so it is not the test's own work that holds them.

Fix

The test asks again every millisecond for up to five seconds before failing. Where it used to fail, one retry (about 2 ms) was enough. The code under test is unchanged.

Testing

  • 30 runs of cargo test -p victory-gpu --lib, all passing (before: about 1 in 6 failed).
  • cargo clippy -p victory-gpu --tests: no warnings.

Note: if the runtime one day hooks the title's own VirtualFree with VICTORY_INPLACE=2 (see title_memory_freeing), the same delay could show up there.

🤖 Generated with Claude Code

**@⁠iTzAlvar** on GitHub · 2026-11-24 21:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/151) `iTzAlvar:fix/inplace-test-decommit-retry` → `main` · +10 −2 · 1 files · 1 commits · open ## Problem `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset` fails about one run in six of `cargo test -p victory-gpu --lib`: ``` panicked at crates\victory-gpu\src\inplace.rs:1145:13: assertion `left != right` failed left: 0 right: 0 ``` `VirtualFree(MEM_DECOMMIT)` of the pages under a heap already dropped returns 0 with error 87 (`ERROR_INVALID_PARAMETER`). Run alone, the test always passes. ## Cause The WARP device is one per process, shared with the other WARP tests running at the same time. While the device is busy, the runtime lets the heap opened with `OpenExistingHeapFromAddress1` go a moment later, and until then Windows holds the pages and refuses the decommit. Dropping the test's own queue and list first does not help, so it is not the test's own work that holds them. ## Fix The test asks again every millisecond for up to five seconds before failing. Where it used to fail, one retry (about 2 ms) was enough. The code under test is unchanged. ## Testing - 30 runs of `cargo test -p victory-gpu --lib`, all passing (before: about 1 in 6 failed). - `cargo clippy -p victory-gpu --tests`: no warnings. Note: if the runtime one day hooks the title's own `VirtualFree` with `VICTORY_INPLACE=2` (see `title_memory_freeing`), the same delay could show up there. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset failed about one
run in six of the victory-gpu suite: VirtualFree(MEM_DECOMMIT) of the pages
under a heap already dropped returned error 87. The WARP device is one per
process, shared with the other tests running at the same time; while it is
busy the runtime lets the opened heap go a moment later, and until then
Windows holds the pages. The test now asks again every millisecond for up to
five seconds; where it failed, one retry (about 2 ms) was enough.

Checked with 30 runs of the victory-gpu suite, all passing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:00 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/151/head:github-bot/gh-151'
git switch 'github-bot/gh-151'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-151'
git switch 'github-bot/gh-151'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-151'
git switch 'github-bot/gh-151'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-151'
git switch 'main'
git merge --squash 'github-bot/gh-151'
git switch 'main'
git merge --ff-only 'github-bot/gh-151'
git switch 'main'
git merge 'github-bot/gh-151'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.