watch: the write-watch test counts only the writes since its first asking (#102) #115
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/115"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ySKELLETONX on 2026-11-25T14:30:03Z.
Fixes #102.
Why
watch::tests::written_pages_are_reported_to_every_askerstarts by asserting that a fresh write-watched allocation has no journaled writes (before.is_empty()).JOURNALis process-wide, though, and keeps each page's last write after its memory is freed. When an earlier test's allocation sat at the addressVirtualAllocnow returns, its writes are still there and the assertion fails. It depends on order and address reuse, which is why #102 saw it once in a full serial run.Deterministic repro, as a temporary test placed before it (not committed):
On
mainthis fails every time atassert!(before.is_empty()).What
Only the test changes. It keeps the stamp of its first asking and checks only the writes since then, which is how the callers read the journal:
texture.rsandshadow.rscompare each entry with their own last asking. Older entries are allowed in the first answer as long as they are older than that asking.I left the journal as it is. A stale entry can only be older than any asking made after the memory came back, so a caller with an earlier asking does not see it as new. A caller that has never asked copies the whole range anyway.
Testing
RX 7600 XT, Windows 11 build 26300, Rust 1.98.1:
main, passes with this change.cargo test -p victory-gpu --lib -- --test-threads=1: 111 passed.cargo test -p victory-gpu --lib, 80 parallel runs: this test never failed. Three other tests did, 4 times in total, and they are unrelated to this change:queue::tests::present_runs_after_a_queues_wait(queue.rs:833,left: 0) twice,query::tests::queries_not_run_keep_their_stand_in_values(query.rs:597) once, andquery::tests::occlusion_queries_around_draws_not_run_stay_visible(query.rs:533) once. I'll look at those separately.Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Adika713 on 2026-11-25T16:04:51Z.
Verified on AMD Radeon RX 6950 XT, Ryzen 5 3600, 32 GB RAM, Windows 11,
Rust 1.98.1 / Cargo 1.98.1. No game data; the title was not run.
Each tree used an isolated
CARGO_TARGET_DIR.Before, at
upstream/main01aadd193d57e71fb4d57810eb2fdd1bc95c950b, fromF:\VIctory-Belobug-AMDwithCARGO_TARGET_DIR=F:\VIctory-Belobug-AMD\_agent_tmp\target-gpu-main-verify:20 runs: 18 failed, 2 passed. Every failure was
watch::tests::written_pages_are_reported_to_every_askerpanicking atwatch.rs:998:9withassertion failed: before.is_empty().After, at PR head
c866e7a, from a detached worktree atF:\VIctory-Belobug-AMD\_agent_tmp\watch-115withCARGO_TARGET_DIR=F:\VIctory-Belobug-AMD\_agent_tmp\target-watch-115:test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 113 filtered out.test result: ok. 111 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out.Overlap: PR #112 head
a1e531balso passes the same two commands (20/20 each),with
112 passed; 0 failed; 4 ignoredin the full lib because it adds its ownregression test. #112 clears the stale
JOURNAL.writtenentries; this PR onlychanges the test's expectations. PR #127 head
c9e45b4toucheswatch.rsandtexture.rsbut does not compile here (error[E0425]: cannot find type 'F' in this scopeathost.rs:3134andhost.rs:3138). I wrote no competing fix.Not tested: the game, or the full workspace suite.
AI-assisted: OpenCode, model Big Pickle. 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.