xmem: the range lock's "never waits" test no longer counts the other tests' remappings (fails 20/20 on a 24-thread PC) #3643
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!3643
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3643"
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?
@Trillazill on GitHub · 2026-11-30 02:27 UTC · original
Trillazill:fix/xmem-range-test-flake→main· +22 −5 · 1 files · 1 commits · closed without mergingFixes: no issue filed.
What it changes
modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it(VICTORY_RANGE_LOCK) fails whenever it runs alongside the rest of thevictory-hlesuite on a PC with many cores:The test counts every time its reader of view
xis refused (title_memory_reading_of_now(x, ..)returnsNone) while it remaps viewy2000 times, and expects zero. But the module's other 46 tests run beside it in the same process. Their changes of mapping that take the whole of title memory (map_aliases_by_page, and every change made without the range lock) overlapxtoo, so the count includes waits this test didn't cause.On
41adb551, on a 24-thread Ryzen 9 7900:cargo test -p victory-hle --lib: failed in 20 of 20 runs (5905 to 9339 refusals counted).--test-threads=1: passes.That's probably also why CI's 4-vCPU runner rarely shows it, while a contributor's
cargo test --workspacedoes.The fix keeps the stress loop: it still checks that a reader of the remapped view never meets its gap, and that the other reader never faults. The refusal count goes. After the loop, the test holds exactly what
XMemMapPhysicalPagesofyholds (remapping_and_views(&[(y, 3 * PAGE)])) and asks for both views at once:xmust be had at once ("a read apart from the remapping had to wait"),ymust not ("a read of the view being remapped did not wait").Writers take turns (
RangeLock::writeholdswriter), so while the test holds that change, no other test's change of mapping can be the one in the way. The check is deterministic now, and it checks the same property.Test-only change; nothing outside
#[cfg(test)]is touched.How it was tested
41adb551):cargo test --locked -p victory-hle --libfailed this test in 20 of 20 runs.remapping_and_viewsmade to take the whole of title memory (if true {in place ofif !victory_gpu::title_memory_by_range() {), it fails with "a read apart from the remapping had to wait".cargo clippy -p victory-hle --all-targets: nothing new inxmem.rs. The threevictory-hlefindings on main (gameinput.rs×2,lifecycle.rs) are #3530's.cargo testpassed for the crates it touches: yes (victory-hle).Checked for overlap
victory-hle, with no overlap.🤖 Generated with Claude Code
@Trillazill on GitHub · 2026-11-30 02:45 UTC · original
Closing in favour of #3621, which fixes the same test and was opened first. It also keeps the range lock this test turns on (
set_range_lock(true), process-wide) away from the module's other tests, which this PR doesn't. For #3621's reviewers: on a 24-thread Ryzen 9 7900, main (41adb551) failed this test in 20 of 20 runs ofcargo test -p victory-hle --lib, and passed alone and with--test-threads=1, which matches #3621's diagnosis.Pull request closed