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

Open
iTzAlvar wants to merge 1 commit from upstream-pr/151 into main
iTzAlvar commented 2026-11-24 21:54:27 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iTzAlvar on 2026-11-24T21:54:27Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592172017 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/151). Originally posted by [iTzAlvar](https://github.com/iTzAlvar) on 2026-11-24T21:54:27Z. --- ## 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)
copilot-pull-request-reviewer[bot commented 2026-11-24 22:07:26 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T21:54:43Z.

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.

<!-- greyfinch-sync:fxceless/victory-fork:review:6048022285 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/151#pullrequestreview-6048022285). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T21:54:43Z. **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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/151:upstream-pr/151'
git switch 'upstream-pr/151'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/151'
git switch 'upstream-pr/151'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/151'
git switch 'upstream-pr/151'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/151'
git switch 'main'
git merge --squash 'upstream-pr/151'
git switch 'main'
git merge --ff-only 'upstream-pr/151'
git switch 'main'
git merge 'upstream-pr/151'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!151
No description provided.