Forget view bits when the watch tests drop their views #425

Closed
Kal0s-design wants to merge 660 commits from upstream-pr/425 into main
Kal0s-design commented 2026-11-28 17:22:35 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-28T17:22:35Z.


Fixes the remaining intermittent failures in #354 (a_raw_copy_in_watched_memory_keeps_the_other_asked_ranges and raw_title_copy_keeps_write_watch_and_resends_equal_bytes).

Cause

drop_views in the watch tests tells the watch about each view with title_memory_remapped before unmapping it. That call is for a view that has just appeared, so the view's blocks stay in VIEWS. Once UnmapViewOfFile frees the address, a later test's VirtualAlloc can get it back. ask_rest then skips that range as view memory (refused_as_view), the journal doesn't cover it, and prepare_raw_copy_note returns None ("watched destination" / "the copy preserves the query").

I found it by printing why prepare_raw_copy_note refused in the failing runs: every time it was kept=true, same mapping number, covers=false, with the destination's block set in VIEWS. Recording which test thread set that bit pointed at a_write_is_reported_at_every_checked_view, one of the 14 users of two_views/drop_views.

Change

drop_views now calls title_memory_unmapping, which forgets the view bits, as the other tests do before a view goes ("the address may be another test's the moment it is free").

Tested

Native Windows, NVIDIA card, cargo test -p victory-gpu --lib built once and the test binary run 40 times in a row, parallel:

Runs raw_title_copy_keeps_write_watch_and_resends_equal_bytes a_raw_copy_in_watched_memory_keeps_the_other_asked_ranges
main (fe7c6e5) 40 6 3
this branch 40 0 0

cargo clippy -p victory-gpu --all-targets --locked -- -D warnings is clean.

This doesn't touch #387 (the fresh title buffer holding 0xEE). I saw that one once in about 70 runs; the zeroing probe from that thread was clean on Windows here (0 of 200, also with the released buffer used by a GPU copy first), so it's something else.

AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5542751902 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/425). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-28T17:22:35Z. --- Fixes the remaining intermittent failures in #354 (`a_raw_copy_in_watched_memory_keeps_the_other_asked_ranges` and `raw_title_copy_keeps_write_watch_and_resends_equal_bytes`). ### Cause `drop_views` in the watch tests tells the watch about each view with `title_memory_remapped` before unmapping it. That call is for a view that has just appeared, so the view's blocks stay in `VIEWS`. Once `UnmapViewOfFile` frees the address, a later test's `VirtualAlloc` can get it back. `ask_rest` then skips that range as view memory (`refused_as_view`), the journal doesn't cover it, and `prepare_raw_copy_note` returns `None` ("watched destination" / "the copy preserves the query"). I found it by printing why `prepare_raw_copy_note` refused in the failing runs: every time it was `kept=true`, same mapping number, `covers=false`, with the destination's block set in `VIEWS`. Recording which test thread set that bit pointed at `a_write_is_reported_at_every_checked_view`, one of the 14 users of `two_views`/`drop_views`. ### Change `drop_views` now calls `title_memory_unmapping`, which forgets the view bits, as the other tests do before a view goes ("the address may be another test's the moment it is free"). ### Tested Native Windows, NVIDIA card, `cargo test -p victory-gpu --lib` built once and the test binary run 40 times in a row, parallel: | | Runs | `raw_title_copy_keeps_write_watch_and_resends_equal_bytes` | `a_raw_copy_in_watched_memory_keeps_the_other_asked_ranges` | | --- | ---: | ---: | ---: | | `main` (`fe7c6e5`) | 40 | 6 | 3 | | this branch | 40 | 0 | 0 | `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` is clean. This doesn't touch #387 (the fresh title buffer holding 0xEE). I saw that one once in about 70 runs; the zeroing probe from that thread was clean on Windows here (0 of 200, also with the released buffer used by a GPU copy first), so it's something else. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kal0s-design commented 2026-11-28 18:33:54 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-28T18:33:54Z.


Closing as a duplicate of #393, which has the same fix in drop_views and was opened first. I left my numbers there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7243886450 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/425#issuecomment-7243886450). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-28T18:33:54Z. --- Closing as a duplicate of #393, which has the same fix in `drop_views` and was opened first. I left my numbers there.
TaynanGT commented 2026-11-29 19:11:40 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:11:40Z.


Thanks for consolidating this with #393 and preserving the test results there. Keeping one implementation of the drop_views fix avoids duplicate changes.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7261083983 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/425#issuecomment-7261083983). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:11:40Z. --- Thanks for consolidating this with #393 and preserving the test results there. Keeping one implementation of the drop_views fix avoids duplicate changes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!425
No description provided.