feat(vk): time a capture's GPU wait for its late pages apart in the log #1243
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1243
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/capture-wait-log"
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?
What changed
take_capturewaits for the GPU (vk_timeline_wait(c->late_value)) before it copies the pages that a submission still on the GPU writes back. That wait was counted in "retires and stamps". So the 600-take log line could not tell the replay thread waiting for the GPU from its own bookkeeping.The wait and the
pools_muacquisition are now timed apart, and the line reads:"Retires and stamps" now starts once
pools_muis held. Nothing else changes: no new switch, no behaviour change.Why
This is the cost behind part of #995 (low FPS with low GPU use). The fewer pools have a VRAM mirror, the more often a submit waits for the GPU here, about six captures a frame. Until now it only showed as an unexplained "retires and stamps". With this line a player's
hookshot_log.txttells at once whether a small mirror budget is what holds the frame rate. That coversRX_VK_MIRROR_MBset low, the VRAM/8 default of 6 GB cards, and the 4GB preset's 256 MB. Measurements are in this #995 comment.How it was tested
RTX 3070 8 GB, Windows 11, main at
09e4eb5plus this commit. Scripted Hyrule Field run: load the save, run the same 45 s route.RX_VK_MIRROR_MBtests/test_capture_wait_log.py(new) checks that the wait is timed on its own, that "retires and stamps" starts after the lock, and that the line names and resets both. It fails on main and passes here. The other tests readingvk_memory.cppstill pass:bind_memo,capture_copy_runs,mem_trim,parallel_rb_refresh,pool_span,report_words,submitted_page,vertex_bind,wb_diff_split,wb_pages(tests/run_all.py, llvm-mingw).No game data included.
🤖 Generated with Claude Code
The two red "Python source checks" jobs fail on
tests/test_output_resolution.py, not on this change. That test fails the same way on main (09e4eb5and5d1fe99, run locally): it still expectshos_rt_pool_size(305 MB) == 305 MB, while #1202 gave the render-target pool a 512 MiB minimum. #1254 updates the test.tests/test_capture_wait_log.pyand the othervk_memory.cpptests pass on both runners.Looks good. I checked the timing split in take_capture: tk1 is still taken after the lock, so measuring retires and stamps from tk_locked is right, and the wait and lock are now separate counters that reset together with the late-take count. The new test is picked up by run_all.py's tests/test_*.py glob and passes on both runners.
The two red Python source checks are only tests/test_output_resolution.py, which is the known failure on main (not this PR).