GPU: mark retaken aliases without collecting temporary page numbers #3395
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by Desamodeth on 2026-11-26T21:58:01Z.
memory::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.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T22:08:03Z.
Review: APPROVED
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).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T22:24:22Z.
Review: APPROVED
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).Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:29:00Z.
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.Imported from Marvisak/VIctory. Originally posted by Desamodeth on 2026-11-30T06:34:10Z.
Handoff note: I'm stepping away from this project. This PR is clean on
main(63bcca43) with green CI and 2 approvals — maintainers or other contributors are welcome to merge or take it over.AI-assisted with 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.