GPU: a remapped mapping does not mark the mappings that still show it #2549
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!2549
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2549"
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?
@Calvix2k on GitHub · 2026-11-25 15:38 UTC · original
Calvix2k:codex/gpu-remapped-aliases-unchanged→main· +42 −4 · 1 files · 1 commits · openFixes #2414.
The failure
title_memory_remappedmarked[at, at + len)changed throughchanged, which follows the alias links (watch.rs:changed→changed_hereper page, then every page linked to them). A mapping that still shows the same physical pages was therefore marked changed with nothing saved, although it shows what it did. If such a copy was armed for a marked write in a running submission,copy_back_markedfoundsaved.is_none() && changed(page)and kept the title's bytes — the shaders' writes to those pages were dropped. A title write to them afterwards does not fault either, so nothing is saved then.What the change does
Only the pages the runtime remapped are marked (
changed_here), which is what the function's own description says: "what it shows is new". The links are still dropped — those pages no longer show what they did, so a later write there must be seen at the new address only.Verification
remapping_one_mapping_leaves_the_other_unchanged: a tracked page taken and armed, a second mapping linked to it (title_memory_aliased), then the second remapped. Without the change it fails ("the other mapping still shows what it did"); with it the tracked page keeps its state.cargo test -p victory-gpu --features diagnostics --libon Windows 10 19045 / RX 7800 XT: 146 passed, 2 ignored, plus the known placed-view failure on a runtime withoutID3D12Device10(#1999, identical onmain); clippy-D warningsclean.The other half of this family —
guard_aliasesignoringprotect's result when the alias is busy (#2454) — is not touched here: it needs the busy/open-write state at the call sites, which is a different change.@Marvisak on GitHub · 2026-11-25 18:36 UTC · original
Automated triage for the maintainers.
Merge candidate.
watch::title_memory_remapped(crates/victory-gpu/src/watch.rs) now marks only the remapped pages as changed (changed_here) instead of also marking every alias (changed). The callers arexmem.rs(map and unmap of a view of physical pages) andlist.rs(Upload::drop). In each case only the virtual mapping changes; other mappings of the same physical page still show the same bytes. Marking them changed with nothing saved could drop a marked copy-back (#2414). The alias links are still removed. The new test covers the case from the issue. CI: passing.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 00:50 UTC · original
Heads-up from testing head
50c43553755fmerged onto currentmain(63bcca43c6a0):crates/victory-gpu/src/watch.rswith zero text conflicts, so GitHub reports the PR as mergeable, butvictory-gpufails to compile onmain(63bcca43):error[E0425]: cannot find function 'changed_here' in this scope(crates/victory-gpu/src/watch.rs:819:5)384b0c0b(#2239) refactoredwatch.rs(lines 714-742) into separatemark_changedandopen_guardedpasses and removedchanged_here.title_memory_remapped— marking and unprotecting only the remapped VA range[first, last)without propagating acrossalias_ofto sibling mappings that still show the same physical pages (while clearing bidirectionalalias_oflinks) — is sound.mainand replacingchanged_here(&mut g, first, last, false)atwatch.rs:819withmark_changed(&mut g, first, last, false); open_guarded(&mut g, first, last);(or restoring a local helper) should make it build and pass cleanly.50c4355375to0060ec9c33@fyernald on GitHub · 2026-11-25 16:41 UTC · original · approved these changes
Tested on an RTX 3080 (617.42), Windows 10 (19045),
main67e8ae1.cargo test -p victory-gpu --lib --locked -- --test-threads=1: 193 passed, 3 failed (the 3 also fail onmainhere).remapping_one_mapping_leaves_the_other_unchangedpasses.The change matches what
title_memory_remappedsays it does: only the remapped pages show something new, and the links are still dropped.One small thing in the test:
free(a)andfree(b)run whiletrackedis still alive, aftertracked.taken(..)guardeda. So pageastays in the globalprotectedandholderssets untiltrackeddrops at the end of the function. A parallel test that gets the same address fromVirtualAllocin that window sees its page as already guarded, and its writes go unseen. Every other test inwatch.rsdoesdrop(t); free(p); doing the same here (drop(tracked)before the frees) closes that window. It's not needed for correctness, but this crate has had enough parallel-run flakes.@Calvix2k on GitHub · 2026-11-26 18:52 UTC · original
Thanks — reproduced on a 7800 XT / Windows 10 rebase as well: upstream folded
changed_hereintochanged,mark_changedandopen_guarded, so the call intitle_memory_remappedno longer resolved.The branch now carries a local
changed_herebuilt frommark_changed+open_guarded(the alias-free half ofchanged, which is what a remap needs), rebased on current main.cargo check -p victory-gpu --all-targetspasses here, and GitHub reports it mergeable again. Head0060ec9.@Dukestar69 on GitHub · 2026-11-26 19:11 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).changed_hereintitle_memory_remappedmarks and opens only the remapped VA range, leaving other virtual mappings that still reference the same physical pages (and their armed trackers) undisturbed.cargo test -p victory-gpu --lib watch:: -- --test-threads=1: 16 passed, 0 failed (includingremapping_one_mapping_leaves_the_other_unchanged).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.