GPU: collect tracked page runs without temporary trees #3387
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3387"
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:23:12Z.
The fallback in
watch::runtime_pagesinserted each 64 KiB page into a temporaryBTreeSetof eligible or foreign pages, then took their difference. Even a range consisting entirely of ordinary committed memory allocated tree nodes to return an empty vector. This follows borosf's measurement of the cost of building those sets. Original finding · Coordination claim.Walk the
VirtualQueryregions in address order. When a foreign region appears, emit the eligible run before its first page and resume after its last page. A 4 KiB foreign region therefore excludes its entire overlapping 64 KiB page. The final run ends at the last successfully queried region. The Windows queries, classification predicate, write-watched fast path and caller are unchanged.CPU measurements
Median µs per call to
runtime_pages, base63bcca43vs this patch. The range of medians is from two runs in opposite order.Windows x64, Ryzen 7 9800X3D, rustc 1.98.1,
-C opt-level=3. The isolated benchmark called the old and new functions on the same nativeVirtualAllocmapping, alternating order and taking 21 samples per variant after two warm-ups. For the mixed case, reserve 64 MiB, then commit one 4 KiB block at offseti * 65536 + 4096fori = 1, 33, 65, …. Both versions return the same 992 page numbers. Allocation counts came from a separate counting-allocator build. These measurements cover page classification only.Correctness
views.victory-gpuwatch tests passed on Windows. Workspace Clippy passed for all targets with default and all features, with warnings denied.cargo xtask policypassed (191 files).AI-assisted with Codex. No game data or GPU used for local verification.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T21:27:51Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4).cargo test -p victory-gpu --lib watch:: -- --test-threads=1: 16 passed, 0 failed (includingruntime_pages_excludes_a_page_split_by_a_private_region).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-26T21:51:19Z.
Review: APPROVED
Clean replacement that preserves exact equivalence with the previous
BTreeSet::differencelogic while avoiding temporary tree allocations.Checked all boundary cases in
runtime_pages(crates/victory-gpu/src/watch.rs:382-423): split 64 KiB pages containing one or more 4 KiB foreign regions, back-to-back foreign regions (run_start > at / PAGEsafely yields an empty range), unalignedstart/end, and earlyVirtualQuery == 0termination on either the first or a later iteration (scanned_endtracks only queried regions).Verification on
origin/main(63bcca43):cargo xtask policy: ok (191 files ok)cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics): cleancargo test --locked -p victory-gpu --features diagnostics -- watch::tests:: --test-threads=1: 16/16 passed on RTX 5090 and 16/16 passed on WARP (includingruntime_pages_excludes_a_page_split_by_a_private_region)BTreeSet::differenceimplementation against the new run accumulator (including unaligned ranges, mixed 4 KiB sub-page regions, and simulatedVirtualQuery == 0early breaks): 2,000/2,000 matched identically.Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:34:17Z.
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:watch::tests::runtime_pages_excludes_a_page_split_by_a_private_regionby name: 1 passed.cargo test -p victory-gpu --lib: 232 passed / 0 failed / 1 ignored (unpatched63bcca4here: 231).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.Synthetic only. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T06:17:09Z.
Independent CPU-only verification of PR #3387 (
Loader/GPU: keep private-region pages out of the runtime page-run list).CARGO_TARGET_DIR(D:\Victory-Contrib\target-3387-watch),CARGO_BUILD_JOBS=2.daf761cd29bfdee9842625b0f867dcf367b52010, merge base63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-gpu --lib -- watch::tests::runtime_pages_excludes_a_page_split_by_a_private_region --exact --test-threads=1 --quiet->1 passed; 0 failed; 232 filtered.git grep -Ffor the new test name on63bcca4returned no hits (test absent on base).git diff --check 63bcca4 HEADexit 0 (clean).Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-27T07:05:47Z.
Measured in game on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's opening prison yard, warm cache; base is
mainplus the unmerged PRs this setup needs (#3312, #3318, #2472 and others, listed in #3425). This PR merged on top, 600 s runs, medians of the last 30 frame-rate lines, against a control run of the same base taken next to it (frame times drift by up to ~25 ms between runs hours apart).No measurable change here. Its own
runtime_pagestest passes under Wine.AI-assisted (Claude); measured on my machine, no game data shared.
Imported from Marvisak/VIctory. Originally posted by Desamodeth on 2026-11-30T06:34:04Z.
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.