VSP-03: split large lazy title-memory sections #17
No reviewers
Labels
No labels
accessibility
benchmark
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
task-claim
telemetry
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/monte-alt--vesper!17
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-17"
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?
@FeelsGoodMan2 on GitHub · 2026-11-30 10:00 UTC · original
FeelsGoodMan2:section-split→main· +181 −49 · 1 files · 1 commits · merged 2026-12-01 23:40 UTCSummary
VSP-03(linked Task Claim issue: #4)crates/vesper-hle/src/modules/xmem.rschanges (with two unit tests).Details:
VESPER_SECTION_MBsets the size (default 64;0: one section per allocation, as before).VESPER_INPLACE_HOT_MB) stay whole, because buffers in place need one stretch of one section.main7b7e556. Contiguous runs end where the section changes, so the coalescing needs no change.Why
A CPU and context-switch trace (on the previous
main, 24 s of switch data) has three gaps over 60 ms in the submit thread, almost all spent waiting for one system thread:The title thread is in
copy_page_mappings->map_aliases->map_alias->MapViewOfFile3/UnmapViewOfFile2. The system thread reads as large-page rebuilding, which walks all views of a section under its lock. I named its frames by comparing code with another kernel build whose symbols I have; the last ones match only at about 0.6-0.7 similarity.AI Assistance Disclosure
Benchmark Comparison (Required for perf / GPU / memory changes)
Hardware: i5-13600KF, 32 GB RAM, RX 7800 XT 16 GB (driver 32.0.32029.2010), Windows 11 build 26300.
Profile: the settings of
scripts\launch.cmd, but without hardware RT and with render scale 0.75 to 1440p; started by a script of my own, not through the launcher. Same executable,VESPER_SECTION_MB=0(A, before) against64(B, after), each run from the same copied saves. Same route, driven by hand (not scripted). Four runs in the order B, A, A, B. All columns are the same stretch, 60 to 447 s after the first in-game frame. Frames with more than 1,000 draws. Numbers fromVESPER_FRAME_CSV, GPU busy from the log.Weighted to the same mix of draws per frame (all four runs pooled), frames over 100 ms per 1,000: A 23.3 and 36.3, B 9.9 and 5.9.
What these numbers do not show:
main, so it is not used here.Mandatory Verification Checklist
AGENTS.md, stays inside claimedVSP-XXfiles, and avoids the Maintainer Active Queue (ROADMAP.md)cargo xtask policyandcargo test -p xtask --lockedpass cleanly (315 files ok; 9 passed)cargo clippy --workspace --all-targets --all-features --locked -- -D warningspasses with 0 warningscargo xtask test-fastandcargo test --workspace --locked -- --test-threads=1pass:test-fastpasses; workspace (run with--no-fail-fast) 1259 passed, 5 failed, 47 ignored. The five are invesper-shader, which this PR does not touch, and fail the same way on an untouchedmainhere:first_half_values_render_on_hardware_and_warp,rectangles_are_drawn_whole,the_rectangle_stage_is_a_geometry_shader,normalized_buffer_formats_load_correctly_rounded_quotients,normalized_codes_truncate_back_to_themselvesVESPER_WAIT_RESIDENT=textures, indirect clamping intact) and steady-state visuals are verified cleanpeer-review-gate) before maintainer reviewThe new test
pages_of_a_large_pool_lie_in_many_sections_and_map_across_themfails withVESPER_SECTION_MB=0(16,387 pages in one section) and passes by default.🤖 Generated with Claude Code
@adriaespii on GitHub · 2026-11-30 20:33 UTC · original · approved these changes
Independent 6-point peer review (AGENTS.md Section 6):
uns() splitting, and map_aliases coherency across a cut boundary.
(AI-assisted code audit using Antigravity/Gemini.)
@monte-alt on GitHub · 2026-11-30 20:57 UTC · original
thank you for this. i ran the xmem tests and checked the second machine’s CSVs. frames over 100 ms went from 215 to 63, even with similar draw counts. can you repeat on current main with 64 first this time?
@FeelsGoodMan2 on GitHub · 2026-11-30 21:57 UTC · original
Repeated on
mainwith 64 first:b262c73(v0.9.0) plus this PR's commit, applied without conflicts.mainhas moved on since, by documentation only.Setup as in the PR (i5-13600KF, 32 GB RAM, RX 7800 XT, inbox D3D12, 1440p at render scale 0.75, no hardware RT), same executable, same copied saves, driven by hand. One run each: B (
VESPER_SECTION_MB=64), then A (0). The only other change of settings against the PR's runs isVESPER_SKIP_INTRO=1, in both. Stretch 60 to 447 s after the first in-game frame, frames with more than 1,000 draws.Weighted to the same mix of draws per frame, frames over 100 ms per 1,000: B 30.5, A 85.0. With all frames of the stretch, also those with few draws: 2.63 % and 7.05 %.
With 64 the log shows
mb=6236 sections=98andmb=710 sections=12; with 0 it does not.Claude Code (Claude Opus 5.5) computed the numbers and wrote this text; I played the runs.