Repository navigation
Conversation
Plan only requested pages outside pending GPU writes. Use a verified reservation extent for dense groups and share a fresh observation within each group. Query journal chunks against the oldest valid shadow bytes. Adapt the clean guarded-memory path from PR Marvisak#393 and the guarded view lookup cache from PR Marvisak#490. Remap and allocation notifications invalidate their proof. Preserve exact byte coverage and journal observations across mixed allocations, including the wholly reserved case examined in Marvisak#515. Co-authored-by: KaiserBloo <kaiserbloo@protonmail.com> Co-authored-by: wrothgaril <211408787+wrothgaril@users.noreply.github.com>
…once per block) Conflicts in watch.rs: the PR's range bookkeeping with main's overflow-safe saturating_add; both new tests kept. World frame time on the RTX 4070: 2,656 -> 2,285 ms (upload copies 520 -> 142 ms). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master, diagnostics build), 240 s world runs, last 8 frame-rate lines, 2 runs per side. Head e6f9159 (+#464) merged onto our tree, which also carries #393/#124 — the watch.rs conflict was resolved into one
No device removed, no panics. victory-gpu tests under Wine: watch 7/7, shadow 4/4. |
Every asking about memory that cannot be write-watched called VirtualQuery on its start to tell whether it is a view (which is then guarded). In the world that query cost 100-230 ms per frame, more than the rest of the guard together: the 174 MB GPU heap and blocks inside it are asked about thousands of times a frame. Remember the blocks found to be in a view where an asking began, under the guards' lock, until title_memory_remapped (which the runtime calls when it maps or unmaps views) drops them. Memory that is not a view is asked about each time, as before (its copies stop asking after the first answer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ported from Marvisak/VIctory#490 (head e6f9159) by wbkepler
…re-copying them every submission Head 41af42e (wbkepler). Conflicts in watch.rs: Guards holds our announced blocks, #1277's view cache and #464's absent blocks; title_memory_remapped forgets all three for the range and keeps our placed-texture eviction. Tests: both sides'. #490 (one view query per block) is left out: #1277, merged before, does the same with the query outside the lock and the unmapping reported after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of upstream JMAN730#490 (the view half; JMAN730#464 is the commit before): the block an asking starts at is remembered as a view until the runtime remaps it, so the system is asked once instead of every submission (100-230 ms per world frame measured there). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
A copy of view memory (physical-page views, which cannot be write-watched) guards each 64 KiB block it took read-only. A block that is not mapped (a placeholder between views of a GPU heap) cannot be made read-only, so it never became clean: every asking reported it written again, and the copy read it through the per-page fallback, whose failing kernel reads cost hundreds of ms per world frame. Note such blocks absent (only after VirtualProtect fails and the block is not committed). An absent block is not reported again until title_memory_remapped, which the runtime calls after mapping or unmapping views, clears it. The copy keeps the zeros it took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every asking about memory that cannot be write-watched called VirtualQuery on its start to tell whether it is a view (which is then guarded). In the world that query cost 100-230 ms per frame, more than the rest of the guard together: the 174 MB GPU heap and blocks inside it are asked about thousands of times a frame. Remember the blocks found to be in a view where an asking began, under the guards' lock, until title_memory_remapped (which the runtime calls when it maps or unmaps views) drops them. Memory that is not a view is asked about each time, as before (its copies stop asking after the first answer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto current main ( AI-assisted (Claude Code); checked on Windows 11 / RTX 5090. |
e6f9159 to
1d46278
Compare
…periodic saves back off Loads and stores take one of 64 mutexes chosen by pipeline name instead of one lock over the whole library. Stores share a RwLock that a save holds exclusively, so loads never wait on a save. A periodic save that finds another running is skipped, and saves back off at 20, 40, 80, then every 160 s and at least 30x the last save's duration. Closes Marvisak#490 Co-authored-by: JMAN730 <JMAN730@users.noreply.github.com>
…ary-mutex-490-111a GPU: parallelize pipeline library loads under striped locks (Marvisak#490)
Stacked on #464. This branch contains #464's commit; only the second commit is new. Review that commit alone, or after #464 merges.
Problem
Memory that can't be write-watched (physical-page views) goes through
watch::guard. Each asking began withVirtualQueryon its start to check that the memory is a view. In the world, the 174 MB GPU heap and blocks inside it are asked about thousands of times a frame. With temporary timers on #464, that one query took 94–235 ms per world frame. By comparison, the rest of the guard took 4–7 ms ofVirtualProtectand 4–10 ms of opening blocks.Change
crates/victory-gpu/src/watch.rsonly:Guardsgains aviewsset: the blocks where an asking began and that the query found to be in a view. A later asking starting in such a block skips the query.title_memory_remappedtakes that lock and drops the blocks in its range fromviews, so a block's entry can't outlive a map or unmap. The runtime calls the hook after mapping a view and before unmapping one.Measured
Diagnostics build, RTX 5090, same save, start screen to world. One run each: #464 alone, then #464 plus this change. These are the
copystatworld windows. The guard time is the temporary timer aroundguard; the other numbers come from the existing counters.Example world lines:
2.5 fps, 400.0 ms/frame (195.0 preparing: copies 129.6 ms ...),5475 watches 118.62 ms1.8 fps, 550.0 ms/frame (268.9 preparing: copies 151.9 ms ...)2.0 fps, 488.8 ms/frame (194.7 preparing: copies 67.3 ms ...), 1572 draws/frame,5475 watches 38.35 ms, 39817.9 MB checkedFrame-to-frame scenes vary a lot. The watch-time drop is the clear signal; preparing improves less visibly within the noise.
I also tried walking a guarded range by runs of blocks instead of looking up every block. It made no measurable difference, so it isn't included: the query was the cost, not the walk.
Tests
watch::tests::views_are_queried_once_until_remapped. A test-only per-thread counter shows that a view is queried once per start block, and again aftertitle_memory_remapped. Private memory is queried, and refused, every time.cargo fmt --check(watch.rs),cargo clippy --workspace --all-targets,cargo clippy -p victory --features diagnostics --all-targets(no new warnings),cargo test --workspace, andcargo xtask policyall pass.🤖 Generated with Claude Code