GPU/watch: advance ahead_asked in watch::wrote to preserve writes/asked monotonicity #410
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/410"
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 fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T00:25:55Z.
Problem
In
crates/victory-gpu/src/watch.rs, under the defaultVICTORY_ASK_ONCE=1,ask_oncesetsj.ahead_asked = j.asked(e.g.,10) andj.kept = true. WhenStep::Copylater callswatch::wrote(dst, len)during the submission:watch::wroteincrementsj.askedto11and insertsj.written[page] = 11, without updatingj.ahead_asked.watch::writes()andwatch::asked()calls return(now = 10, [(page, write = 11)]), violatingwrites()'s contract (now >= write).Shadow::copy_stalerefreshes the page and records*at = now = 10 < 11, so every subsequent refresh still seeswrite > *at— causing redundant re-copies and spuriousWHY_STALEstalls inShadow::stale_under_writes.Fix
j.ahead_asked = now;inwatch::wrotealongsidej.asked += 1;.watch::wrote_tests::wrote_keeps_ahead_asked_at_or_above_written_timestamps.Verification
cargo test -p victory-gpu --locked watch -- --test-threads=1: 8 passed, 0 failedcargo xtask policy: 169 files okcargo clippy -p victory-gpu --all-targets --locked -- -D warnings: cleancargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: clean(AI-assisted; synthetic unit tests only, 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.