GPU/watch+inplace: release/reopen views across MANY_VIEWS transitions and clear g.aliased #763
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T06:44:53Z.
Problem
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.)
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.