Guarded-view watch tests fail when a pin from an earlier test outlives its view #174
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#174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@adrianmjim on GitHub · 2026-11-25 18:57 UTC · original
On
01aadd1, threewatch::testsfail now and then in fullvictory-gpu --libruns with default test threads:a_view_mapped_beside_a_guarded_one_makes_it_check_again(watch.rs:931/932)a_write_through_another_view_is_reported_at_the_guarded_one(watch.rs:883/884, e.g. "nothing written yet" withleft: Some([page]))a_write_is_reported_at_every_checked_view(watch.rs:897/899, e.g.left: Some([b+1, b]),right: Some([b, b+1]))RX 7900 XT, Windows 11 build 26300, Rust 1.98.1, lib test binary run directly: 25 of 96 runs had at least one of them. The rate was about the same on the #112, #115, #132 and #154 trees. They did not fail with
watch::alone (25 runs) or with--test-threads=1.Cause, as far as I can tell:
kernel_reads_into_guarded_blocks_after_openingcallswriting(view + 100, 13), which pins that block forPIN(2 s).title_memory_remapped. That clearsprotected,clean,holesandaliased, but notpins.guard()takes the slow path. That path finds the blockpinned, so the block is reported written at every check and never made read-only.[b+1, b].With a probe in that branch, all 14 failures I captured had taken it for a block of the test's own new view. In the 3 where I logged who set the pin, it came from
kernel_reads_into_guarded_blocks_after_opening.#60 hits the same leak in its new test
a_pinned_block_is_left_writable_by_a_check_from_a_guarded_one. It drops its own pins after unmapping, "so that a view another test maps here is not left writable by it", but the older test above does not do this. #60 also makesguard()'s fast path honor pins, so after it a leaked pin would affect more checks. #67 changes how ended pins are dropped, but no open PR drops pins when memory is remapped.As a local experiment, I made
title_memory_remappeddrop pins wholly inside the range:Interleaved with main, the failures went from 20/56 runs to 0/56. A test-only alternative is to clear the pins at the end of
kernel_reads_into_guarded_blocks_after_opening, the way #60's test does. I have not checked whether dropping pins on remap matters in a title run, where an asynchronous read could in principle still land after the remap.Not tested: the title.
github-bot referenced this issue2026-11-26 03:37:15 +00:00
@adrianmjim on GitHub · 2026-11-27 09:25 UTC · original
Closing: this was about the time-based write-watch pins on
main(#175 fixed them there).a-publierhas no such pins: kernel writes are scoped withkernel_writing, and every path that guards a block checksleft_alone. So the cause described here doesn't exist on that line. Thewatch::test flakes seen ona-publierare handled in #450.