XMem test: a freed watched reservation is proven released by taking its range, not by finding it free #4419
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4419
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4418"
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?
@boraswim on GitHub · 2026-11-30 20:09 UTC · original
boraswim:fix/write-watch-test-free→main· +985 −849 · 32 files · 14 commits · closed without mergingPart of #2420 (item 2).
What it changes
modules::xmem::tests::large_default_allocations_honour_write_watch_switchfails in 1 to 2 runs in 10 ofcargo test -p victory-hle --libon Windows:After
XMemFreeDefaultthe test checked that the reservation's base wasMEM_FREE. Title memory is reserved throughVirtualAlloc2with an address requirement, so Windows hands out the lowest free range above 4 GiB, and a test on another thread can reserve the freed range before the check runs. A range found in use doesn't prove the free failed.The test now proves the release by reserving the exact range itself (
VirtualAlloc(base, reserved, MEM_RESERVE, PAGE_NOACCESS)). Nothing else can hold the range at that moment, and the test gives it back at once. If the range was taken in between, it allocates and frees again, up to 8 times. A free that doesn't release fails every attempt. Test-only.How it was tested
cargo test -p victory-hle --lib --lockede1251c31XMemFreeDefaultchanged to decommit instead of release, the test fails withthe reservation was not released (0x2000). Reverted.cargo testpassed for the crates it touches: this test, yes. In those runsa_read_by_range_waits_only_for_a_remapping_that_meets_itstill fails, which #2439 fixes.Checked for overlap
xmem.rs(#2133, #2263, #2390) change runtime code, not this test.@boraswim on GitHub · 2026-11-30 20:13 UTC · original · edited 2026-11-30 20:52 UTC
The red
checkis main's clippy (loop_capsin lower.rs,Shadow::ranged,is_multiple_ofin host.rs), the same three errors as main's run one1251c31. #4297 (or #2048) fixes them. This PR only changes one test in xmem.rs.@trustno1-coder on GitHub · 2026-12-01 18:41 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed