Skip to content

watch tests: forget the views before the addresses go back (38 failing runs in 300 of the watch tests, 0 in 600 after) - #963

Open
MamaLeVrai wants to merge 1 commit into
fxceless:mainfrom
MamaLeVrai:watch-test-forget-first
Open

MamaLeVrai wants to merge 1 commit into
fxceless:mainfrom
MamaLeVrai:watch-test-forget-first

Conversation

@MamaLeVrai

Copy link
Copy Markdown

Tests in watch.rs fail now and then when the tests of the binary run side by side (the default). On main (0b0074e), RX 6950 XT (RDNA2), Windows 11 build 26300, Rust 1.98.1, running only the watch:: tests of the victory_gpu test binary (victory_gpu-….exe watch::), 300 runs: 38 failed (13 kernel_reads_into_guarded_blocks_after_opening, 12 a_write_told_at_one_view_is_reported_at_the_others, 9 a_write_through_another_view_is_reported_at_the_guarded_one, 5 writes_in_partly_committed_view_blocks_are_reported, 1 a_write_is_reported_at_every_checked_view). With --test-threads=1: 0 of 200. In whole-binary runs (with #849 and #878 merged so those two do not hide them) 3 of 200 runs failed on a watch:: test.

The assertions that fail show pages missing or reported again, for example left: [] right: [26709552, 26709553, 26709554], left: Some([29889239, 29889240]) right: Some([]) ("nothing written yet") and left: Some([34624605, 34624606]) right: Some([34624606]).

The change. Three tests (kernel_reads_into_guarded_blocks_after_opening and the two placeholder tests) gave their addresses back (UnmapViewOfFile, VirtualFree) and only then told the guards with title_memory_remapped; the runtime does it the other way round, and the other tests of the module already do (drop_views, View::drop). They now call it first. Only tests change.

What I did not see. I did not catch the interleaving itself. My reading is that a test beside these can map its own view at the address just given back, and the late call then clears the guards it has set there (protected, clean, absent, viewed are by block address). The numbers say the order is the cause: the same 300-run loop went from 38 failing runs to 0 in 600 runs with the change.

Not covered. The whole victory_gpu binary still ends in a driver crash now and then on this machine, about 1 run in 10 (no test named; the Windows event log shows amdxc64.dll or d3d10warp.dll as the faulting module); this PR does not touch that.

harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

…side could lose its guards)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@cmt8

cmt8 commented Nov 25, 2026

Copy link
Copy Markdown

The same reorder, under Wine, confirms it here. We made the identical change to these three tests on our Linux branch (cmt8/VIctory afe67caa), after kernel_reads_into_guarded_blocks_after_opening failed once in 43 runs of the watch tests under Wine. With half of the change, 1 run in 70 still failed. With all of it, 0 runs in 30 failed. #769 is the same change as well.

One more watch flake remains with this PR applied: written_pages_are_reported_to_every_asker failing with before.is_empty(). That one is the journal, not the guards. drop_views tells title_memory_remapped but leaves the views' pages in the journal's written map, so the next test to get that address finds them written. Over 200 runs each of the victory-gpu binary under Wine 11.22 (RX 7900 XTX):

Build Failed runs
0b0074e0 3
0b0074e0 + this PR 2 (both written_pages_..., before.is_empty())
0b0074e0 + this PR + dropping the journal's pages in drop_views 0

The counts are small. The journal change is test-only and is in a separate PR (#1008) so it does not get in the way of this one.

AI-assisted (Claude Code); no game data.

@welisonzika14-jpg

Copy link
Copy Markdown

Machine: RTX 5070, driver 621.24, Windows 11, Rust 1.98.1 (MSVC).
Command: build the victory-gpu tests, then run the test binary watch:: 50 times (default threads), counting runs with a failure.

Small sample (50 runs, one machine); 0/50 does not prove the flake is gone. The failure messages of the two failures were not captured.

Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

KomanderDG88 added a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 25, 2026
…tchdog switches and three test fixes listed

The fork now follows victory-fork through a merge of its 3973179. The table
of what the fork adds gains fxceless#955 (pipeline workers, off by default), the
opt-in title watchdog hook from fxceless#959 (off by default, not used in the
measurement recorded here) and the three test fixes fxceless#963, fxceless#952 and fxceless#978.
English and Spanish.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MamaLeVrai

Copy link
Copy Markdown
Author

Thank you both. cmt8: good that the same reorder holds under Wine, and thanks for splitting the journal part into #1008; I saw written_pages_are_reported_to_every_asker fail once in 150 runs of another tree here too, so that one is worth its own fix. welisonzika14-jpg: 2 in 50 on main and 0 in 50 with the change is in line with the 38 in 300 and 0 in 600 I measured.

AI-assisted (Claude Code); no game data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants