Perf/memory guard batching #1884
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!1884
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1884"
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?
@VlREX on GitHub · 2026-11-25 00:04 UTC · original
VlREX:perf/memory-guard-batching→main· +150 −2 · 2 files · 5 commits · openOptimize GPU memory guard batching by sorting and deduplicating alias pages and replacing repeated active-writer scans with a sorted sweep. Synthetic stress model: 4,063,488 linear comparisons reduced to 8,688 sweep checks, excluding sorting. Two independent reference implementations verified 421,875 cases with zero disagreements. Six Rust regression tests included. Native Windows/Rust validation and FPS benchmarking pending. AI-assisted (ChatGPT).
@Marvisak on GitHub · 2026-11-25 08:17 UTC · original · edited 2026-11-25 20:23 UTC
Automated triage for the maintainers.
Needs work. The verdict is unchanged.
Since the last review (
a175fff→c14ab1d):docs/memory-guard-batching.mdis gone.page_batch.rsis wrapped.check) now runs on this head and passes.The code itself is unchanged:
page_batch::eligiblesorts and dedups the pages beforeprotectincrates/victory-gpu/src/watch.rsand sweeps sorted writer ranges. It still reads as correct to me.The benefit is still not shown. @CocoBeans64's native run (RX 6800 XT,
13f91ca) found no regressions and no crashes, but it measured the PR together with #2358. Over two runs per side, frame time and fps did not change beyond the ~6 % noise between identical baseline runs. So no gain is visible at frame level.What would change the verdict: the guard counters this code affects, before and after, from one session of this PR alone. The
diagnosticscopystat line already prints them: "protecting … ms" in the watch-time section and "guards: … ms in the handler, … protect calls for … pages". If those show a real cut in protect time or calls, the module earns its place. If they don't, it adds 120 lines for nothing measurable. The PR title is also still the branch name ("Perf/memory guard batching"); please make it descriptive.CI: passing.
Generated by Claude Code
@CocoBeans64 on GitHub · 2026-11-25 19:29 UTC · original
Native Windows run as asked, on Windows 10 22H2 (19045), RX 6800 XT (driver 32.0.21045.5002), Ryzen 7 7800X3D. The PR is merged with #2358 on
13f91ca, plus an Agility SDK runtime (#84), diag build.cargo test -p victory-gpu: 201 passed, 1 failed. The failure,a_texture_written_in_one_format_reads_in_another_through_a_placed_view, fails the same way on13f91cawithout the PR (#1999).Benchmark: the same saved game in the prologue, menus by hand, then a scripted camera loop. The figures cover the 300 s after the world shows. Two runs per side:
13f91caTwo identical baseline runs differ by about 6 % in mean frame time.
No regression and no crash; no fps change beyond that noise.
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.