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

Closed
github-bot wants to merge 660 commits from github-bot/gh-425 into main AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-28 17:22 UTC · original
Kal0s-design:fix/drop-views-forget-354 → main · +4 −1 · 1 files · 1 commits · closed without merging

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

**@⁠Kal0s-design** on GitHub · 2026-11-28 17:22 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/425) `Kal0s-design:fix/drop-views-forget-354` → `main` · +4 −1 · 1 files · 1 commits · closed without merging 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)
`drop_views` told the watch about each view with `title_memory_remapped`,
which is for a view that has just appeared. Its blocks stayed in `VIEWS`
after `UnmapViewOfFile`, and when a later test's `VirtualAlloc` got the
same address, `ask_rest` skipped that range as view memory
(`refused_as_view`). The journal then did not cover it and
`prepare_raw_copy_note` returned `None`, which is the intermittent
failure of the two raw-copy tests in #354.

Use `title_memory_unmapping`, as the other tests do before a view goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:27:48 +00:00
github-bot closed this pull request 2026-11-28 18:36:20 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-28 18:33 UTC · original

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

**@⁠Kal0s-design** on GitHub · 2026-11-28 18:33 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/425#issuecomment-7243886450) Closing as a duplicate of #393, which has the same fix in `drop_views` and was opened first. I left my numbers there.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 19:11 UTC · original

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

**@⁠TaynanGT** on GitHub · 2026-11-29 19:11 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/425#issuecomment-7261083983) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.