GPU: keep untracked pages writable in Tracked::taken #3013
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3013
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3013"
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?
@fuzeofficlal on GitHub · 2026-11-26 03:25 UTC · original
fuzeofficlal:fix/gpu-watch-taken-skip-untracked→main· +141 −3 · 1 files · 1 commits · openSummary
pagesincrates/victory-gpu/src/watch.rs::Tracked::takenagainstg.holdersforself.changedbefore callingaliases,guard_aliases, andprotect, returning early if none of the pages belong to this tracker.Shadowbuffer or 4 MiB loose window spans bothMEM_WRITE_WATCHruntime pages and adjacent untracked/foreign committed pages: previouslyShadow::copy_back,copy_back_page, andcopy_back_markedcalledt.taken(...), which passed untracked pages toVirtualProtect(..., PAGE_READONLY)and inserted them intog.protectedwithout ag.holdersentry (leaving them permanently read-only even afterTracked::drop, and risking a VEH + heap-lock deadlock if a process-heap page is touched).watch::tests::taken_skips_untracked_and_foreign_pagescovering both directTracked::takenon a mixed foreign/pool window and end-to-endShadow::copy_back+Shadow::copy_back_pageover adjacent pool and plain committed pages.Verification
watch::tests::taken_skips_untracked_and_foreign_pagesfails onmain(PAGE_READONLYinstead ofPAGE_READWRITE) and passes with the fix.cargo test --locked -p victory-gpu watch::tests::: 16/16 passed on RTX 5090 (shadow::tests::9/9 passed).VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --all-features: 247 passed, 0 failed, 1 ignored.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warnings.cargo xtask policy: 191 files ok.@pickles976 on GitHub · 2026-11-26 03:29 UTC · original
Exact PR head
0f2fb8c55b1a7c9814c5eeada6ee3de0cebf3d87, Windows-target Wine 11.0/vkd3d-proton 3.2.0 on a 16 GiB host with physical NVIDIA RTX 4060 Laptop GPU (8 GiB) (dxgi.hideNvidiaGpu = False):watch::tests::taken_skips_untracked_and_foreign_pages1/1 passed, 0 ignored. Build log confirmsCompiling victory-gpufrom the clean PR checkout, and DXVK enumerated the laptop NVIDIA adapter. The regression exercises direct mixed owned/foreign pages andShadow::copy_back/copy_back_page; it leaves foreign/plain pagesPAGE_READWRITEwhile guarding only the tracked page. Local log:.compat-runtime/logs/verify-pr3013-wine-mixed-pages.log(not attached).This is a useful Wine page-protection/liveness check, not a GPU command-dispatch or guarded title test; device enumeration does not mean this fixture rendered on the GPU. It does not resolve the separate 16 GiB world-load RAM floor, so no gameplay/FPS claim.
@Marvisak on GitHub · 2026-11-26 06:17 UTC · original
Automated triage for the maintainers.
In
main,Tracked::taken(victory-gpu/src/watch.rs) protects every page its caller passes in. Two callers can pass pages that this tracker never registered ing.holders:Shadow::copy_backpasses every synced page in range.copy_back_pagepasses the page it wrote.Such pages include foreign or plain committed memory inside a buffer or window. They get made
PAGE_READONLYand added tog.protected, andTracked::dropnever unprotects them, because it only walks the tracker's own pages. The PR filters the pages down to those this tracker holds before the alias andprotectsteps. It keeps the existing lock order (guards first, thenchanged) and returns early when no pages are left. The new test covers directtakencalls and bothShadowcopy-back paths over a mix of write-watched and plain pages.This looks like a real fix for a latent leak of read-only protection onto memory the tracker doesn't own.
CI:
checkpassing.Generated by Claude Code
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.