GPU/watch: advance ahead_asked in watch::wrote to preserve writes/asked monotonicity #410
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!410
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@AscilCH on GitHub · 2026-11-25 00:25 UTC · original
AscilCH:fix/gpu-watch-wrote-ahead-asked→main· +46 −0 · 1 files · 1 commits · openProblem
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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.