gpu(watch): re-publish placeholder holes missed in guard races #191
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!191
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/191/head"
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?
@Androtim on GitHub · 2026-11-30 03:13 UTC · original
Androtim:feat/iter188-watch-placeholder-race-fix→main· +93 −1 · 1 files · 1 commits · closed without mergingSummary
Guards::toldto track absent blocks explicitly notified bytitle_memory_allocated(cleared on remap, free, kernel write, or reappearance).guard(), check whether remaining uncommittedunsureranges are still placeholders; anyabsentplaceholder blocks not intoldare promoted back intoheldandPUBLISHEDat the next query instead of staying stuck in repeatedVirtualQuerysyscalls after a race between unmapping and protection.watch::many_askers_tests::a_hole_noted_absent_in_a_race_is_known_at_the_next_asking.Verification
cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy(311 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu watch:: -- --test-threads=1(53 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warningscargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings@Androtim on GitHub · 2026-11-30 04:04 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-work· CI (check):passingReviewed
crates/victory-gpu/src/watch.rs(CI is passing, and the new unit testa_hole_noted_absent_in_a_race_is_known_at_the_next_askingcovers the single-threaded promotion/told path).The idea of promoting
absentplaceholder holes back intoGuards::held/PUBLISHEDwhile respectingtitle_memory_allocatedviaGuards::toldmakes sense, but introducing promotion inguard()exposes two concrete race/invariant bugs:title_memory_allocatedmissesabsent && !heldblocks (crates/victory-gpu/src/watch.rs):title_memory_allocatedonly iteratesg.held.range(...)before inserting intog.told. If a block is currently ing.absentbut not ing.held— either because it was missed in aprotectrace, or because a concurrentguard()call has releasedGUARDSwhile runninguncommitted_end/placeholderonunsure—title_memory_allocatedwill not insert it intog.told. The subsequent promotion loop inguard()then checksg.absent.contains(block) && !g.told.contains(block)and promotes the block intog.heldandPUBLISHEDanyway.Iterating
g.absent.range(...)intitle_memory_allocated(inserting intog.told, and removing fromg.held+ clearingPUBLISHEDif present) closes both cases.guard()'scameloop can break theg.held ⊆ g.absentinvariant (crates/victory-gpu/src/watch.rs):Because
guard()now promotesabsentblocks intog.heldand setsPUBLISHED, two concurrentguard()calls can both snapshot the sameblockintounsure. If one promotesblocktog.held+PUBLISHEDand the other later observes it as committed (came) and runsg.absent.remove(block),blockis left dangling ing.heldandPUBLISHED. Sincekernel_writing,title_memory_freed, andtitle_memory_changedall iterateg.absent.range(...)to clean upg.held/PUBLISHED, a danglingheld/PUBLISHEDentry will not be cleaned up by them and will causepublished()to report a committed block as clean/known.Clearing
g.heldandPUBLISHEDin thecameloop (if g.held.remove(block) { PUBLISHED.clear(block); }) preserves the invariant.(Minor note: in
guard(),unsurecurrently runsplaceholder(block)/NtQueryVirtualMemoryeven for blocks already ing.told, only to skip them later; skippingplaceholder()fortoldblocks would avoid unnecessary syscalls.)To change the verdict:
title_memory_allocatedto mark allg.absentblocks in the range ing.told(while removing any present ing.heldand clearingPUBLISHED).guard()'sfor &(block, view) in &cameloop, also removeblockfromg.heldand clearPUBLISHEDif it was present.title_memory_allocatedcalled on anabsent && !heldblock so it is not promoted intog.held/PUBLISHEDon the nextguard()call.Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-12-01 01:39 UTC · original
Closing stale/conflicted backlog PR per #276. Superseded by the active root-architecture replacement pillars with isolated plain --release A/B verification.
Pull request closed