GPU: mark retaken aliases without collecting temporary page numbers #3395
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!3395
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3395"
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?
@Desamodeth on GitHub · 2026-11-26 21:58 UTC · original
Desamodeth:perf/stream-retake-aliases→main· +1 −2 · 1 files · 2 commits · openmemory::retake_droppedcallswatch::retakefor ranges withheld until frame end. Each call collected the linked page numbers into a temporary vector while holding the global guard lock.markupdates each tracker's dirty state, soretakecan borrow the alias lists under that lock. It marks the original range first, followed by its aliases in the existing order.Windows x64, Ryzen 7 9800X3D, rustc 1.98.1 release. Results per call on
main@63bcca43and this change:The synthetic fixture used the production
retake,mark, guard mutex, alias map and dirty trackers. Each measured page had a buffer-copy tracker and a texture tracker. The table uses already-dirty copies to isolate temporary storage. Starting from a clean tracker at 64 × 4, both versions retained 5,976 B of dirty-set nodes. Peak live heap growth fell from 8,024 to 5,976 B. The fixture checked the exact marked pages, the untouched texture tracker, and the range end. Timings are medians of 12 batches in alternating order, with allocation counts from a separate binary. Game frame time was not measured.Windows checks:
cargo test -p victory-gpu --lib watch:: -- --test-threads=1and workspace Clippy with--all-targets -- -D warnings, both with default features and all features.cargo xtask policyalso passed.Coordination claim. AI-assisted with Codex Astra 6.2 High.
@Dukestar69 on GitHub · 2026-11-26 22:08 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).g.alias_of.range(first..last).flat_map(|(_, links)| links)directly inretakeavoids a heap allocation on every call sincemarkonly needs&Guards.cargo test -p victory-gpu --lib watch:: -- --test-threads=1: 15 passed, 0 failed.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).
@fuzeofficlal on GitHub · 2026-11-26 22:24 UTC · original · approved these changes
Looks good.
watch::retake(crates/victory-gpu/src/watch.rs:840-847) cleanly avoids the temporaryVec<usize>allocation by iteratingg.alias_of.range(first..last).flat_map(|(_, links)| links.iter())directly while holding the sharedGuardsborrow.mark(watch.rs:851-859) only takes&Guards, does not mutatealias_of, and preserves theGUARDS -> Changed.0lock ordering.Verified by merging
31a5b6bdontoorigin/main(63bcca43):cargo xtask policy(191 files ok) andcargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) pass cleanly.watch::tests::(15/15) passes on both RTX 5090 and WARP (--features diagnostics,VICTORY_D3D12_DEBUG=1).@Jackster on GitHub · 2026-11-26 22:29 UTC · original
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX (gfx1100, 32.0.32029.2010):cargo test -p victory-gpu --lib: 231 passed / 0 failed / 1 ignored — the same counts as unpatched63bcca4here.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.No test is added, so this is behavioural coverage: the watch tests around
title_memory_remapped/retakepass, and the change removes the temporaryVecthat was collected while the guards lock was held — the range is stillfirst..lastand every alias link is still marked. Synthetic only. AI-assisted.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.