GPU/watch: give a remapped view's pages their write access back #1447
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1447"
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 CwWwWwW on 2026-11-27T08:51:48Z.
Problem
title_memory_remappedforgets the 64 KiB blocks a guard made read-only when the runtime says the pages were mapped again, but it removed them fromprotected/cleanand clearedPUBLISHEDwithout restoringPAGE_READWRITE. A refresh (texback / texture pass / draw) that guards the pages in the window betweenMapViewOfFile3and the runtime's post-map word leaves a view the title owns read-only with no guard to open it: the title's next plain store faults, the vectored handler finds no guard and the page not writable, and the access violation ends the process. The same window can leave host copies stale. The unmap side is unaffected (the protection dies with the mapping).look_at_holesalready documents and avoids this window by taking the mapping lock; the refresh path has no such lock.Fix
Open the blocks through
open_herebefore forgetting them: it removes them fromprotected/clean, clearsPUBLISHEDand restoresPAGE_READWRITE, so the guard's forgetting is complete in one step. One file changed (crates/victory-gpu/src/watch.rs, +27/-7).Regression test
watch::tests::a_guard_forgotten_by_the_remap_gives_its_page_backmaps a pagefile section view, guards it, sends the remap word and checksVirtualQuery:PAGE_READWRITEexpected. On the old code it fails withPAGE_READONLY(left: 2,right: 4).Verification
cargo test -p victory-gpu --lib --locked -- --test-threads=1: 243 passed, 0 failed, 7 ignoredcargo clippy -p victory-gpu --all-targets --locked -- -D warnings: cleancargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: cleangit diff --check: clean; one file changedFound by this mission's GPU shadow/memory audit in an earlier round; independently implemented for this tree, no external code used. Rebased onto main
9a9091d(the branchfix/remap-restore-protectionis the earlier base).The PR's Clippy check fails on main already: at
9a9091dcargo clippy --workspace --all-targetsfails invictory-shader(wave64_after_loop.rs precedence; valu_tests.rs simplifiable/negated partial-ord comparisons); open PR #1440 fixes exactly those lints. This diff touches onlyvictory-gpu/src/watch.rs, whose clippy is clean here (default and --all-features).Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T16:21:33Z.
Superseded on the VIctory-NVIDIA tree that replaced main: watch::title_memory_remapped now reopens the guard and gives the pages their write access back (crates/victory-gpu/src/watch.rs), with the regression test a_block_guarded_before_we_were_told_of_its_view_can_be_written. Closing.
Pull request closed