watch tests: forget the views before the addresses go back (38 failing runs in 300 of the watch tests, 0 in 600 after) #963
No reviewers
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/fxceless--victory-fork!963
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-963"
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?
@MamaLeVrai on GitHub · 2026-11-25 13:52 UTC · original
MamaLeVrai:watch-test-forget-first→main· +8 −3 · 1 files · 1 commits · openTests in
watch.rsfail now and then when the tests of the binary run side by side (the default). Onmain(0b0074e), RX 6950 XT (RDNA2), Windows 11 build 26300, Rust 1.98.1, running only thewatch::tests of thevictory_gputest binary (victory_gpu-….exe watch::), 300 runs: 38 failed (13kernel_reads_into_guarded_blocks_after_opening, 12a_write_told_at_one_view_is_reported_at_the_others, 9a_write_through_another_view_is_reported_at_the_guarded_one, 5writes_in_partly_committed_view_blocks_are_reported, 1a_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 awatch::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") andleft: Some([34624605, 34624606]) right: Some([34624606]).The change. Three tests (
kernel_reads_into_guarded_blocks_after_openingand the two placeholder tests) gave their addresses back (UnmapViewOfFile,VirtualFree) and only then told the guards withtitle_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,viewedare 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_gpubinary still ends in a driver crash now and then on this machine, about 1 run in 10 (no test named; the Windows event log showsamdxc64.dllord3d10warp.dllas 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
@cmt8 on GitHub · 2026-11-25 15:58 UTC · original
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_openingfailed 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_askerfailing withbefore.is_empty(). That one is the journal, not the guards.drop_viewstellstitle_memory_remappedbut leaves the views' pages in the journal'swrittenmap, 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):0b0074e00b0074e0+ this PRwritten_pages_..., before.is_empty())0b0074e0+ this PR + dropping the journal's pages indrop_viewsThe 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 on GitHub · 2026-11-25 16:04 UTC · original
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.3973179: 2 of 50 runs failed: writes_in_partly_committed_view_blocks_are_reported 1, unmapped_blocks_are_reported_once_until_mapped 1.2009b95, merged, ee22311): 0 of 50 runs failed.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.
@MamaLeVrai on GitHub · 2026-11-25 23:36 UTC · original
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_askerfail once in 150 runs of another tree here too, so that one is worth its own fix. welisonzika14-jpg: 2 in 50 onmainand 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.