Retry the raw-copy watch test when another test remaps (#354) #443

Closed
github-bot wants to merge 1 commit from github-bot/gh-443 into review/local-integration-20261129 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 13:29 UTC · original
Kal0s-design:fix/raw-copy-test-retries-on-remap → review/local-integration-20261129 · +23 −12 · 1 files · 1 commits · closed without merging

Targets #439's branch. Refs #354.

Even with #393's stale-VIEWS fix in, host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes still fails under parallel load. Four processes each ran host::refresh_tests watch:: --test-threads=8 25 times on cfd5ebd: 9 of 100 runs failed, all at after.expect("the copy preserves the query").

Cause: after a raw copy, Journal::covers keeps the query only while ahead_mapping == changes(), and changes() is global. Other fixtures (title(), the watch tests) remap unrelated title pages at any moment, so a remap anywhere in that window ends the query. That's the runtime being conservative, which is fine. The test just assumed nothing else remaps.

Fix (test only): note changes() before the round. If asked() comes back None and changes() moved, run the round again, up to 100 times. If the mapping didn't move, the old assertions apply unchanged, so a real loss of the query still fails.

Same stress after the change: 0 of 100 for this test. A temporary counter showed 9 runs needing a second try (5 needed 2 attempts, 2 needed 3, one 4, one 5). That matches the 9 failures before, which supports the cause.

One unrelated flake showed up in those 100 runs: watch::many_askers_tests::no_mapping_is_lost_between_askers. Correction: I first wrote that it failed at "the bits answered none". It didn't. It fails at the final assert!(super::published(at, end)), about once in 250 to 300 stressed runs. The cause is in a separate PR (see the comment below).

cargo test -p victory-gpu --lib raw_title_copy passes. Clippy on this branch shows only the errors #442 fixes.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-11-29 13:29 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/443) `Kal0s-design:fix/raw-copy-test-retries-on-remap` → `review/local-integration-20261129` · +23 −12 · 1 files · 1 commits · closed without merging Targets #439's branch. Refs #354. Even with #393's stale-VIEWS fix in, `host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes` still fails under parallel load. Four processes each ran `host::refresh_tests watch:: --test-threads=8` 25 times on cfd5ebd: **9 of 100 runs failed**, all at `after.expect("the copy preserves the query")`. Cause: after a raw copy, `Journal::covers` keeps the query only while `ahead_mapping == changes()`, and `changes()` is global. Other fixtures (`title()`, the watch tests) remap unrelated title pages at any moment, so a remap anywhere in that window ends the query. That's the runtime being conservative, which is fine. The test just assumed nothing else remaps. Fix (test only): note `changes()` before the round. If `asked()` comes back `None` *and* `changes()` moved, run the round again, up to 100 times. If the mapping didn't move, the old assertions apply unchanged, so a real loss of the query still fails. Same stress after the change: **0 of 100** for this test. A temporary counter showed 9 runs needing a second try (5 needed 2 attempts, 2 needed 3, one 4, one 5). That matches the 9 failures before, which supports the cause. One unrelated flake showed up in those 100 runs: `watch::many_askers_tests::no_mapping_is_lost_between_askers`. **Correction:** I first wrote that it failed at "the bits answered none". It didn't. It fails at the final `assert!(super::published(at, end))`, about once in 250 to 300 stressed runs. The cause is in a separate PR (see the comment below). `cargo test -p victory-gpu --lib raw_title_copy` passes. Clippy on this branch shows only the errors #442 fixes. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
raw_title_copy_keeps_write_watch_and_resends_equal_bytes failed in about
9 of 100 runs of the host and watch tests under parallel load (#354),
always at "the copy preserves the query". After a raw copy the journal
keeps its query only while the global `changes()` count is unchanged
(`Journal::covers`), and other fixtures remap unrelated title pages at
any time. A run whose mapping moved says nothing about the copy, so it
is tried again; a run with the mapping still must keep the query, as
before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 13:29:19 +00:00
Author
Owner

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

I integrated this locally as 349e595d7 with your authorship preserved. All three targeted raw_title_copy tests passed on Windows. Thanks for keeping the retry bounded and leaving the unchanged-mapping assertion intact. I have not yet reproduced your 100-run stress matrix on the consolidated tree.

**@⁠TaynanGT** on GitHub · 2026-11-29 14:39 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7257468379) I integrated this locally as 349e595d7 with your authorship preserved. All three targeted raw_title_copy tests passed on Windows. Thanks for keeping the retry bounded and leaving the unchanged-mapping assertion intact. I have not yet reproduced your 100-run stress matrix on the consolidated tree.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 16:45 UTC · original

The askers flake mentioned above has its own PR now: #449. It was the final published assertion, not "the bits answered none". The PR text here is corrected.

**@⁠Kal0s-design** on GitHub · 2026-11-29 16:45 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7259153174) The askers flake mentioned above has its own PR now: #449. It was the final `published` assertion, not "the bits answered none". The PR text here is corrected.
Author
Owner

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

Thanks for the correction and the separate #449. Keeping the final published assertion distinct from the raw-copy retry is important. I'll evaluate that fixture fix separately rather than broaden this PR.

**@⁠TaynanGT** on GitHub · 2026-11-29 19:02 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7260953881) Thanks for the correction and the separate #449. Keeping the final published assertion distinct from the raw-copy retry is important. I'll evaluate that fixture fix separately rather than broaden this PR.
github-bot closed this pull request 2026-11-30 17:08:35 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:06 UTC · original

main has 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 current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7285733397) `main` has 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 current `main` and open a new PR; I'll review it there.

Pull request closed

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