GPU/watch+inplace: release/reopen views across MANY_VIEWS transitions and clear g.aliased #763
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!763
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-763"
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 06:44 UTC · original
AscilCH:fix/gpu-watch-many-views-threshold-and-aliased-cleanup→main· +114 −41 · 2 files · 1 commits · openProblem
Three multi-view guard state bugs when physical pages cross the
MANY_VIEWS(64) threshold (crates/victory-gpu/src/{inplace,watch}.rs):MANY_VIEWSupward (64 -> 65 views):title_memory_view()inserted the 65th view intov.pagesbefore callingwatch::views_mapped(), which queriedviews_of_section()and skipped pages withshown.len() > MANY_VIEWS. None of the 64 previously guarded views were opened:v_0remainedcleanandPAGE_READONLY,v_1..v_63remained trappedPAGE_READONLYand ing.aliased, and writes throughv_64were silently missed.MANY_VIEWSdownward (> 64 -> 2..=64 views): Whenviews_gone()dropped a page's view count back into2..=MANY_VIEWS, a remaining view that had been guarded alone aboveMANY_VIEWSstayedcleanandPAGE_READONLYwhile its remaining sibling views stayedPAGE_READWRITEand unguarded.g.aliasedentries inviews_mapped():views_mapped()calledopen_here()without removing opened blocks fromg.aliased.Fix
inplace::title_memory_view(), collect views to open wheneverbeforeis in1..=MANY_VIEWS(catching both normal additions and the exact64 -> 65crossing while keeping> 65filler pages O(1)) and pass coalesced runs towatch::views_mapped().inplace::views_gone(), return coalesced runs of remaining views for any page whose count dropped from> MANY_VIEWSinto2..=MANY_VIEWS, and reopen them inwatch::title_memory_remapped().g.aliasedinwatch::views_mapped()and when reopening downward-transitioned views.Verification
cargo test -p victory-gpu --locked -- watch:: inplace:::20 passed; 0 failed(including new testscrossing_many_views_upward_releases_aliases_and_reports_dirtyandcrossing_many_views_downward_reopens_remaining_views_for_shared_guarding).cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings ininplace.rsandwatch.rs(only pre-existing8dd30abwarnings indraw.rs:2377andindirect.rs:1322).cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
Three multi-view guard state bugs in crates/victory-gpu/src/{inplace,watch}.rs: 1. Crossing MANY_VIEWS upward (64 -> 65 views): `title_memory_view` inserted the 65th view into `v.pages` before calling `watch::views_mapped`, which then queried `views_of_section` and skipped any page with `shown.len() > MANY_VIEWS`. As a result none of the 64 previously guarded views were opened: `v_0` stayed `clean` and `PAGE_READONLY`, `v_1..v_63` remained stuck `PAGE_READONLY` in `g.aliased`, and writes through `v_64` were silently missed. Open all existing views of a page on the exact `MANY_VIEWS -> MANY_VIEWS + 1` transition (while still skipping pages already above `MANY_VIEWS + 1`). 2. Crossing MANY_VIEWS downward (> 64 -> 2..=64 views): when `views_gone` dropped a page's view count back into `2..=MANY_VIEWS`, a remaining view that had been guarded alone while count > 64 stayed `clean` and `PAGE_READONLY` while its remaining sibling views stayed unguarded and `PAGE_READWRITE`. Return those remaining views from `views_gone` and open them in `title_memory_remapped` so the next `guard()` protects all remaining views together. 3. `watch::views_mapped` called `open_here` without removing opened blocks from `g.aliased`, leaving stale alias entries behind. Remove opened blocks from `g.aliased` in `views_mapped` (and when opening views after a downward `MANY_VIEWS` transition).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.