Opt-in: end root-view windows where the title's mapped memory ends (no task claim) #45
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!45
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-45"
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-12-02 19:00 UTC · original
FeelsGoodMan2:window-tails→main· +0 −0 · 0 files · 115 commits · closed without mergingSummary
crates/vesper-gpu/src/shadow.rs, whichROADMAP.mdlists in the Maintainer Active Queue. I am opening it anyway so the measurements and the patch are visible; close it if it is in the way, or tell me which task ID to file it under and I will rework it to fit.VESPER_TAIL_MAPPED=1(acts only together withVESPER_WINDOW_TAILS=1): a window of title memory made for an ask without a length (a root view) ends with the stretch of mapped views that holds the ask, on a 1 MiB grid, instead of at the end of its 4 MiB cell. When the title maps past such a window, the asks get a longer one. Every root-view bind (root_view,root_uav,root_srv_table) checks that its window holds the ask's mapped stretch and looks again if it does not.v0.9.3and made smaller. The branch is merged withmainatv0.9.3. The second setting this PR used to carry (VESPER_DEAD_WINDOWS, a sweep that let go of windows over memory the title released) is removed:mainlets go of windows over unmapped title memory itself now (evict_unmapped, theunmappedflag,mapped_idle_evictable), so the sweep would only duplicate it.descriptor.rsanddescriptor/host.rsare no longer touched. The diff againstmainis 4 files, +747/-6.main, on purpose, and I can take it out. With the cut on, a short window that the title's mapping outgrew is let go once no list, heap pass or descriptor slot holds it (outgrown_let_go).mainnever lets go of a mapped window a shader wrote (mapped_idle_evictable), so without this such a window would stay for good after it was replaced by a longer one. In the runs below it let go of 25 to 33 windows (36 to 47 MB) a run, so its effect is small; say so if you would rather not have it.Why
On
v0.9.3the copies of windows outside buffers are still the largest piece of host copies while driving on a 32 GB PC: 5.1 to 5.4 GB after about 3 minutes in the world in the two runs with the setting off. Root-view windows reach to the end of their cell, past what the title has mapped. This looks related to #3.AI Assistance Disclosure
Benchmark Comparison
Hardware: RX 7800 XT 16 GB, 32 GB RAM. Build: diagnostics build (
--profile diag --features diagnostics) of this branch merged withv0.9.3, not the release build. Profile: native 1440p, HW RT (2560x1440, render scale 1.0, hardware BVH on), the settings of the last launch script with the values thev0.9.3README lists for its presets laid over them,VESPER_MESH_LAUNCH=0as on RX 7000 cards; this is not the launcher's own preset file. Before = setting off, after = setting on, same binary, same save, route driven by hand, cache warmed, one run each, back to back without restarting the PC.nonlocalofshared_mem_breakdown)At equal numbers of draws the median frame time is the same in both runs (35.6 / 44.3 / 50.2 / 58.5 / 80.2 ms off against 36.3 / 44.8 / 50.0 / 56.4 / 79.6 ms on, for frames with under 6,000, 6,000 to 8,000, 8,000 to 10,000, 10,000 to 12,000 and over 12,000 draws), so I read the small differences in the table as the route, not as a gain.
Memory at the end of each run (the runs are not equally long):
nonlocal(MB)The "earlier run" with the setting off is listed for memory only: it was the first run after the cache was made and loaded its pipelines during play (p50 17.4 FPS), so its frame times do not compare.
With the setting on, the diagnostics line at the end of the run read: 1,517 windows cut, 2,251 MB left out; 2,455 times outgrown by what the title mapped, 25 outgrown windows let go (38 MB); windows too short for their stretch: 0 at first lookup, 0 after looking again, 0 in a list's slot cache.
Three more runs with the setting on, same binary, profile, save and route, made after a restart of the PC (so not back to back with the runs above): 218, 239 and 246 s in the world, p50 19.3 / 20.7 / 20.5 FPS, p95 98.6 / 89.5 / 90.9 ms, p99 121.7 / 117.5 / 112.0 ms, 4.67 / 2.99 / 2.96 % of frames over 100 ms. Their diagnostics lines: 2,061 / 1,935 / 1,959 windows cut, 2,901 / 2,786 / 2,823 MB left out, 33 / 28 / 25 outgrown windows let go.
Because the runs differ in length, here is memory at the same time since entering the world, as the range over the runs (2 with the setting off, 4 with it on; at 215 s 1 off and 3 on):
So at the same time in the world the runs with the setting on hold, on average, 1.1 to 1.5 GB less in windows, 1.0 to 1.4 GB less shared GPU memory and 0.9 to 1.4 GB less private memory, with frame times unchanged. Memory keeps growing with time in the world in both cases: the longer runs with the setting on end with a private peak of 30.9 to 31.1 GB. Free physical memory did not go up and the working set is larger with the setting on (at 170 s: 21.8 to 24.2 GB on against 18.2 to 20.0 GB off). I have not found out why; the PC is at its limit in every run, so the system may be leaving in memory what it would otherwise trim from the process, but I did not measure that.
What went wrong on the way, and what is not verified
main's own tails mode has the same property; the cut makes outgrowing more frequent (2,455 to 3,503 times a run). I saw nothing wrong in the picture, by eye.v0.9.3on a new cache spent its first two minutes at about 2 FPS; the following runs did not. I took that as first-run loading and did not look further.Mandatory Verification Checklist
AGENTS.md, stays inside claimedVSP-XXfiles, and avoids the Maintainer Active Queue (ROADMAP.md) — no: no claim, andshadow.rsis in the Maintainer Active Queue (see Summary)cargo xtask policyandcargo test -p xtask --lockedpass cleanly (asset policy: 334 files ok; xtask: 9 passed)cargo clippy --workspace --all-targets --all-features --locked -- -D warningspasses with 0 warnings — no, and not because of this PR: on my PCcargo clippy -p vesper-gpu --all-targets --locked -- -D warningsfails on plainmainatv0.9.3with 7 lints inhost.rs,descriptor/host.rs,host/gpu_timings.rsandpool.rs, and fails with the same 7 on this branch; none is in a file this PR touches. The CI Clippy job on this PR reports those 7 and line 830 ofcrates/vesper-loader/src/pc_prompts.rs; the same job fails onmainatv0.9.3too, where its log showspc_prompts.rsline 830.cargo xtask test-fastandcargo test --workspace --locked -- --test-threads=1pass —cargo xtask test-fastpasses; the whole-workspace run I did not do, and thevesper-gputests do not get through in one process on my PC, with or without this PR:cargo test -p vesper-gpu --locked --lib -- --test-threads=1ends with an access violation (0xc0000005) intexback::tests::texture_readback_reuses_the_buffer_only_after_the_list_resets, on plainmainatv0.9.3(513 tests pass before it) and on this branch (522 pass before it; the 9 more are this PR's tests). That test passes when run alone, and with it skipped the run ends the same way a few tests later, intexture::ahead::tests::a_placed_texture_is_filled_ahead_of_the_lists. Run one module per process, everyvesper-gputest passes on this branch: 622 passed, 35 ignored, 0 failed (670 / 35 / 0 with--features diagnostics); plainv0.9.3run the same way: 613 / 35 / 0. In CI the test jobs stop atwarm_bad_fingerprint_override_again_and_helpinapps/vesper, as they do onmainatv0.9.3, before they reach this crate.VESPER_WAIT_RESIDENT=textures, indirect clamping intact) and steady-state visuals are verified clean (by eye, in the runs above)🤖 Generated with Claude Code
Pull request closed