Watch tests: forget views a test unmaps, so a later allocation there is asked #393
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!393
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-393"
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?
@urielbeaupre on GitHub · 2026-11-28 03:13 UTC · original
urielbeaupre:fix/watch-test-views→main· +60017 −5429 · 206 files · 660 commits · closed without mergingwatch::tests::a_raw_copy_in_watched_memory_keeps_the_other_asked_rangesfails at random. Unchanged main,cargo test -p victory-gpu --lib(default thread count), fails in 5 of 30 runs, always with the same panic:Cause
The cause is state an earlier test leaves behind, not two tests racing.
drop_views) unmapped the views without callingtitle_memory_unmapping, the call that runsforget_views. So the block'sVIEWSbit stayed set.ask_ahead_heldandask_restskip ranges whererefused_as_viewis true. The new allocation is therefore never asked, andprepare_raw_copy_notereturnsNone.At a failure, a diagnostic build showed
refused_as_view(p) = truewith theVIEWSbit set forp's block. In both captured failures, the bit had been set bya_block_just_written_rests(throughguard()). That test holdsone_asking_test. The bit simply outlives it, so a lock can't fix this, and it only shows when the allocator reuses the address.Fix
This is test-only.
drop_viewsnow tells of the unmapping as the runtime does (title_memory_unmapping) before it unmaps, so what was known of the address as a view goes with it.Verification
cargo test -p victory-gpu --libfe7c6e5cargo clippy -p victory-gpu --features diagnostics --testsis clean.Not covered: other helpers may leave stale guard state in other ways. For example,
host.rs'stitle(len, true)never unmaps its views. None of that showed up in these runs. Found while checking a flake reported on #392.🤖 Generated with Claude Code
@Kal0s-design on GitHub · 2026-11-28 18:33 UTC · original
Independent confirmation from native Windows (NVIDIA card): I chased the same failures today without having seen this PR and landed on the same cause. Tracing why
prepare_raw_copy_noterefused showedcovers=falsewith the destination's block set inVIEWS, and recording who set that bit pointed ata_write_is_reported_at_every_checked_viewviadrop_views.With the same change in
drop_views, the test binary run 40 times in a row, parallel:raw_title_copy_keeps_write_watch_and_resends_equal_bytesa_raw_copy_in_watched_memory_keeps_the_other_asked_rangesmain(fe7c6e5)I opened #425 before noticing this one; closing it in favour of this PR.
AI-assisted: yes
@TaynanGT on GitHub · 2026-11-29 11:37 UTC · original
Thanks for independently finding the same stale VIEWS entry. The 6/40 and 3/40 failures on main versus zero in 40 with the fix are useful. Please keep a deterministic stale-view control alongside the parallel runs so we can distinguish a real fix from a scheduling change.
@TaynanGT on GitHub · 2026-11-30 17:09 UTC · original
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed