Tests: wait for the late page list instead of sleeping #2738
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2738
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2738"
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?
@Therecalloftheonion on GitHub · 2026-11-25 19:23 UTC · original
Therecalloftheonion:pr/dstorage-late-list→main· +21 −1 · 1 files · 1 commits · openWhat
The late page-list test no longer sleeps 2 ms and hopes the copy has not started.
The copy reports the destination whose page list it found empty and started waiting for; the test fills the list only then. This deterministically covers the retry path instead of racing it.
Why
a_page_list_filled_after_its_request_startsfailed intermittently under parallel test load: a 2 ms sleep can arrive after the 8 ms retry window. With the counter the fill happens while the copy is waiting.Testing
cargo test -p victory-hle --lib: passed repeatedly (5 consecutive runs)cargo test -p victory-hle --lib modules::dstorage: passed repeatedly@kotekompotek on GitHub · 2026-11-25 20:06 UTC · original
Makes the flaky test deterministic: the filler spins on LATE_DESTINATION (set exactly when the copy first finds the empty page list) instead of racing a fixed 2 ms sleep against the 8 ms retry window. 5 s bound with an assert means a broken wait fails loudly rather than timing out silently.
@fuzeofficlal on GitHub · 2026-11-25 20:14 UTC · original
Reviewed and verified
9caeb474(merged cleanly ontomain13f91ca) on Windows 11 (rustc 1.98.1MSVC).LATE_DESTINATIONAtomicUsizerendezvous (SeqCst) and a 5 s timeout eliminates the timing flake without deadlock risk (minor nit: resettingLATE_DESTINATIONto0at the end of the test would keep it spotless if future tests ever share it).cargo test -p victory-hle --lib --locked(3 consecutive full parallel runs): 3/3 passed (146 passed, 0 failed+crash_child1/1each run).cargo test -p victory-hle --lib --locked -- modules::dstorage::tests::(3 consecutive runs): 3/3 passed (16/16each run).cargo clippy -p victory-hle --all-targets --locked -- -D warnings: 0 warnings;cargo xtask policy: 184 files ok.@Marvisak on GitHub · 2026-11-25 23:23 UTC · original
Automated triage for the maintainers.
This makes
a_page_list_filled_after_its_request_starts(crates/victory-hle/src/modules/dstorage.rs) deterministic:into_destinationrecords the destination whose page list it found empty in a#[cfg(test)]LATE_DESTINATION, and the test's filler thread writes the page number only once that happens, instead of a fixed 2 ms sleep that can land before the copy starts (so the retry path is never exercised) or after the 8 ms retry window. I checked that the recordedrequest.destinationis the same leaked list address the test waits on, that the hook compiles out of non-test builds, and that the 5 s bound fails loudly rather than hanging. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 12:50 UTC · original
NVIDIA full-suite run, to go with the reports above by fuzeofficlal, since none of them names a GPU run. Tested exact head
9caeb47(on its baseda82e44).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.#[test]functions in the diff.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@Dukestar69 on GitHub · 2026-11-26 18:09 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64:
#[cfg(test)] LATE_DESTINATIONremoves the flaky 2 ms sleep race ina_page_list_filled_after_its_request_startsand guarantees the late-list retry path is exercised.cargo test -p victory-hle --lib modules::dstorage:: -- --test-threads=1: 16 passed, 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.