perf(vk): fit mid-size captures to tight spare budgets #1605
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1605
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/tight-budget-capture-sizes"
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?
Type perf · Risk medium
Change
Under a spare-buffer budget of 32 MiB or less, the capture allocator rounds requests between 16 and 32 MiB up to the next 4 MiB. With the stock policy, a 17 MiB request can consume the whole spare budget. The existing minimum-size override, ownership and retirement logic still apply.
Measurements
A headless trace under a simulated 6 GiB policy recorded 1,022 fresh capture buffers totaling 26.66 GiB of cumulative allocations over the 15-second Market turn. A replay of the stock policy reproduced the observed allocation counts and bytes in each measured leg. For the same request and retirement sequence, the new classes yielded 911 allocations totaling 13.45 GiB. This models cumulative traffic and keeps the recorded order fixed.
The first lightly instrumented pair used private copies of the same warmed caches, the stock host, identical route markers and the local exclusive timing queue. Each run reported zero outside builds.
The route ran on an RTX 3090 with 24 GiB physical VRAM, CachyOS Linux and NVIDIA 620.70.06. The renderer allowance was 5,233 MiB. Market had four frames above 100 ms in each run. The reverse pair ran the candidate first. Both runs again reported zero outside builds.
Average FPS and p99 improved in both orders. The worst Market frame regressed in both pairs. The 677 ms interval occurred during the Market turn. These simulated-budget measurements on one driver leave the cause of that hitch and physical low-VRAM behavior open.
Testing and risks
The game-free fixture failed the size assertion on stock and passed under GCC and Clang with the change. Renderer build and headless route passed. A retained smaller spare may serve fewer subsequent larger requests on another workload or driver. The review identified this case. The full Linux suite returned 720 passed, 41 failed and 19 skipped. All 41 failures reproduced on the source-matched control.
Tested in game: CachyOS Linux, RTX 3090, 620.70.06, Ryzen 9 7900X. Both arms ran the fixed Market and Field route using a simulated 6 GiB VRAM budget. One clean pair complete. Reverse order outstanding.
Possibly related, for context:
Added the reverse-order Market and Field results and the full Linux test report. With a simulated 6 GiB budget both pairs gained average FPS and improved p99, but both had a worse maximum Market frame. The repeat peaked at 677 ms in the Market turn. The full suite had 41 failures, all reproduced on the control. Physical low-VRAM coverage is still open.
A separate instrumented pass counted foreground capture allocations under the simulated 6 GiB policy. During the 15-second Market turn, baseline allocated 26.66 GiB over 671 presents (40.69 MiB per present). The new classes allocated 11.82 GiB over 762 presents (15.88 MiB per present). These are gross cumulative allocations. The worst frame in the instrumented candidate lasted 965.48 ms. Six fresh allocations overlapped 908.48 ms of that frame, asked the driver for 832 MiB, and carried 564.5 MiB of requested payload. All six requests individually exceeded the 32 MiB spare budget. A separate follow-up is testing exact sizing for these buffers. This capture identifies a mechanism for a repeatable Market hitch. The 677 ms frame from the lightweight repeat has no allocation trace.
WIP: perf(vk): fit mid-size captures to tight spare budgetsto perf(vk): fit mid-size captures to tight spare budgets