Tests: two more random failures in victory-gpu (an allocator-placed view, a shared write-watch asking) #462
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/462"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-27T03:19:56Z.
Independent of the
watchfix (#450): rebased ontoa-publier4eb6cfd, commits281b850and68fc506(the numbers below were measured on top of the #446 placeholder fix, which #450 carries too). Two more random failures ofcargo test -p victory-gpu --lib, both test-only.1.
descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes(e34c1cc)Cause: the result depends on where the allocator puts the test's 64 KiB
Vec, not on another test. With no registered buffer, the runtime copies the surrounding 4 MiB block of memory (shadow::window_of/loose). The structured view atstart+8has 456-byte elements. When its offset in that block is a multiple of 456,off_elementscorrectly says it is on its elements, uses the 4 MiB copy, and the width comes out as 4194304 instead of 2048. That happens for about 1 page in 57. In 60 runs exactly 3 addresses fell on such a page, and those were exactly the 3 failures. Forcing such an address fails 5 of 5 even with--test-threads=1.Fix: if the block's copy would put the view on its elements, the test moves up one page (4096 is not a multiple of 456). The runtime's choice is right for such an address, so there is nothing to change there.
Before/after: 3 of 60 full-suite runs -> 0 of 100; a forced address fails 5 of 5 -> passes 5 of 5.
2.
host::refresh_tests::unchanged_ranges_are_known(4ed2b5f)Cause: the submission's single write-watch asking (
ask_once...ask_once_end) is one state for the whole process.ask_resttakes the standing ranges out, releases the lock while it asks the kernel, and puts them back together with its own. Run besidewatch::port7_tests::no_write_is_lost_with_port_7, one test's ended asking can come back inside the other's. The nextask_oncethen asks nothing (ask_ahead_heldsees an asking standing), and a write goes unseen:view false: written at its end,left: true, right: false.Fix: a test-only lock,
watch::one_submission(), held for each such asking by the four tests that make one. These are this test, the refresh tests'submission()helper (which had a lock of its own), port 7's submission thread, andthe_rest_of_the_one_asking_has_a_number_of_its_own.Not a live race: every
ask_once/ask_once_endin the runtime is insideHost::submit, under thesubmittedlock (settle_stale,run_deferredand the batch flushes included). Two submissions never overlap.refresh_tests+ port 7, 60 runs: this test / the port 7 testIt also ends port 7's own flake (
round N, page P: X is not after X) when it runs beside the refresh tests.Still seen:
watch::tests::other_memory_at_a_guarded_address_keeps_its_protectionfailed 2 of 100 when onlyrefresh_testsandwatch::ran together, never in whole-suite runs. Not fixed here. Clippy (-p victory-gpu --all-targets) is clean.AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-27T03:20:09Z.
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.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lvndrpup on 2026-11-27T08:53:55Z.
Review: COMMENTED
Tested on an RTX 3060 Ti 8 GB, Ryzen 5 5600X, Windows 11 build 26300, Rust 1.98.1, debug, on
68fc506.Overlap with #382. The second commit (
68fc506) makes the same change as #382: a test-only lock in the same four places (refresh_tests::submission, thelookinunchanged_ranges_are_known, port 7's submission thread, andthe_rest_of_the_one_asking_has_a_number_of_its_own). It is calledsubmission_in_testthere andone_submissionhere. The two PRs conflict inhost.rsandwatch.rs, so only one of them can go in as it is.A caller neither PR covers.
host::card_steps::tests::the_card_copies_what_is_recordedis not ignored and submits throughhost.execute(card_steps.rs:1202).HostQueue::submitthen callswatch::ask_once(host.rs:5840) andask_once_end(host.rs:5898) without the lock. So "Not a live race" holds for the runtime, but this test runs one real submission beside the others.let _one = crate::watch::one_submission();at the top of that test would close it.submitnever takes the lock, so this cannot deadlock. The details are in my comment on #382.Runs of
cargo test -p victory-gpu --lib -- watch:: host::refresh_tests(52 tests), with the two builds alternating:2f18312, the placeholder half only)391d2a9)watch::many_askers_tests::no_mapping_is_lost_between_askerswatch::many_askers_testson its own, 500 runs of each build: 0 failures in both.other_memory_at_a_guarded_address_keeps_its_protectionfailed in none of these runs. I could not get the one failure above again, and its panic text was not kept. I found nothing in #450 that reaches that test either: its placeholder stays reserved for the whole test.Not tested: the descriptor commit (
281b850) and the whole suite.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.