GPU: every region of a tracked range must be the runtime's #2345
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!2345
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2345"
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?
@crashbashash on GitHub · 2026-11-25 11:14 UTC · original
crashbashash:fix/watch-whole-range→main· +73 −19 · 1 files · 2 commits · openSummary
runtime_memorydecides whetherwatch::trackmay guard a range, but it looks only at the range's first page. A range that starts in runtime memory (a write-watched pool, a view or a placeholder) and runs into plain committed memory further in passes, and that memory gets guarded too. A write there from a thread holding the guard lock then never returns, the same deadlock #1849 fixes for free memory. astrosteveo reproduced it with a synthetic test on #1849.Stacked on #1849: the first commit is #1849 unchanged; please review only the second,
f5e46bd.Change
runtime_memory(start, end, views)walks every region of[start, end)withVirtualQuery. Each region must be what one page had to be before: write-watched, or (withviews) a view or placeholder, i.e. neither free nor plain committed private memory. A range with any other region isn't tracked, and is copied whole like any untracked memory.trackcalls it once, when the copy is made, so the walk doesn't run per submission.#2237 (mapped image memory) changes the same check and also looks at the first page only. Whichever of the two merges second needs a one-line conflict fix; with this PR, #2237's image rule would hold for every region of the range.
Testing
watch::tests::committed_memory_further_in_is_not_tracked: a two-block reservation with its second block committed. Tracking the reserved block alone works; tracking both is refused (onmainit's accepted).cargo xwin clippy -p victory-gpu --all-targets [--all-features] --locked -- -D warnings: clean.victory-gputests under Wine (GE-Proton11-14, MSVC build): 80 passed, 1 ignored.Not tested: Windows.
AI-assisted (Claude Code). No game data attached.
@welisonzika14-jpg on GitHub · 2026-11-25 12:25 UTC · original
First run on NVIDIA hardware here, as far as I can see. RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
f5e46bdmerged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR's new test(s) pass on this card:
watch::tests::free_memory_is_not_tracked,watch::tests::committed_memory_further_in_is_not_tracked. The rest is the same asmainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@Marvisak on GitHub · 2026-11-25 15:30 UTC · original · edited 2026-11-25 20:23 UTC
Automated triage for the maintainers.
This pull request still doesn't merge cleanly into
main(conflicts incrates/victory-gpu/src/watch.rs), so it gets no content review.Reply to the author: thanks for the summary.
280b150("change tracking guards only the runtime's memory, region by region") is indeed onmain, and #1849 is open and merges cleanly. Closing this one in favour of #1849 is up to you or the maintainers; nothing else is needed from you here.Generated by Claude Code
@crashbashash on GitHub · 2026-11-25 16:49 UTC · original
280b150onmainnow walks every region of a tracked range, as this PR does, and goes further: instead of refusing the whole range, it tracks the runtime's pages and copies the rest whole at each use. The one thing this PR adds on top of it is leaving free memory out, which is #1849's change, and #1849 is now rebased ontomainas that single condition. So this PR has nothing left of its own. I'm happy to close it, or to fold anything from it into #1849 if you'd rather keep something. Your call.Thanks @DenRakEiw for the review, @catminou4 for the look, and @welisonzika14-jpg for the run on the RTX 5070.
AI-assisted (Claude Code). No game data attached.
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.