Tests: two more random failures in victory-gpu (an allocator-placed view, a shared write-watch asking) #462
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!462
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@MamaLeVrai on GitHub · 2026-11-27 03:19 UTC · original
MamaLeVrai:more-flakes→a-publier· +31 −5 · 3 files · 2 commits · openIndependent 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
The submission's one asking (ask_once .. ask_once_end) is one for the process; the runtime makes it under the host's submission lock, so one submission at a time. Tests make it on their own, in parallel: unchanged_ranges_are_known, the refresh tests' submission helper (which had a lock of its own), no_write_is_lost_with_port_7's submission thread and the_rest_of_the_one_asking_has_a_number_of_its_own. Two at once lose a write. ask_rest takes the standing ranges out of the journal, asks the kernel about its own with the journal let go, and puts both back as one standing asking. A test that ended its asking and wrote its memory meanwhile then finds its range held again by an asking from before its write: its ask_ahead_held stops at `kept`, its ask_rest does not ask about a held range, and nothing_new says nothing changed. Seen in a probe of a failing run: the standing ranges were the refresh test's 8 pages (as ask_ahead_held joins them) beside port 7's four, kept, its page 0 noted at asking 5 while copied at 832 (the write at region + 600 never noted). That is "view false: written at its end / on its last page: left true, right false". They now take one test-only lock (watch::one_submission) for each such asking, as the submissions they stand for do. On the RX 6950 XT, release build, 8 threads: - unchanged_ranges_are_known with no_write_is_lost_with_port_7: 5/300 failing runs before, 0/300 after (port 7's own: 0/300 after); - port 7 with the refresh_tests module: port 7 fails 31/60 before ("round N, page P: X is not after X"), 0/60 after; the refresh test 2/60, then 0/60; - the refresh test alone: 0/200 before and after; - the whole lib suite: 0 failures in 100 runs. Test-only. In the runtime every ask_once/ask_once_end is on the thread that holds Host::submitted (host.rs submit), so two never overlap; the take-and-put-back in ask_rest would lose a write only if a second submitter appeared. Co-Authored-By: Claude Opus 5.5 <[email protected]>@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-27 03:20 UTC · original · reviewed
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.
4ed2b5f6c0to68fc5064e1@lvndrpup on GitHub · 2026-11-27 08:53 UTC · original · reviewed
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.