test(vk): the recorder own/idle checks with slot identities and the real wait (review 1195 of #162) #342
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!342
Loading…
Reference in a new issue
No description provided.
Delete branch "klimovich008/Longshot:test/recorder-own-idle-review"
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?
Why
mooki's review of #162 (review 1195) asked for tests that would catch a slot's own reset hitting the wrong pool, and for the
recorder's new idle wait to be tested through the real operating-system wait and an orderly shutdown. #162 was merged before those
tests were pushed, so they come here. Tests only: no renderer or host code changes.
What changed
tests:
tests/recorder_own_idle_test.cpp,own_slotscases. Two recording slots, each with its own command pool, commandbuffer, descriptor pool, extra pool and a set from each pool. Slot 1's binds are held in the recorder while slot 0 comes round,
its GPU work completing 20 ms late. The fake driver knows which object each held packet names and records a fault for a reset,
begin or destruction of an object still in use, or a slot reused before its GPU work completed.
own_slots_wrong(slot 1's poolreset) and
own_slots_early(slot 0 reused early) show it catches each.tests:
real_cases (Windows) throughvk_replay.cpp's ownWaitOnAddressadapter, cut from the source:wait that returned began before the publish and blocked 15 ms or more; otherwise it is retried, up to 20 times;
ERROR_TIMEOUT);Each ends with
vkDestroyDevice's teardown (the recorder stopped and joined), its watchdogs joined, and a normal return.tests:
tests/test_recorder_own_idle.pycopies every headervk_work.handvk_recorder.hinclude fromgpu/vk, so #60's and#288's
gpu_wait_stats.hcomes along whichever lands first. Its source check reads the code without comments. It also pinsrecording_wait(r)beforerec::slot_begin(), and the slot's own handles in theOwnSlotblocks(
draw_begin_recording(r.slot, ...),slot_begin(rec_end_pos[r.slot])).tests: three new broken variants must fail: the wait's timeout made infinite, the adapter's wake doing nothing, and the
adapter's wait comparing against the ring counter as it is now. A broken real-wait build counts as caught when any of three runs
fails it, since
WaitOnAddressmay return early. The source check has new controls too:recording_waitcommented out ineither comment style, and another slot's descriptor pools.
Flags and settings
None.
Measurements
A test-only change, measured by its checks.
main:
cf605c85(2026-11-14)this PR: test/recorder-own-idle-review @
53fe0b5eHardware: RX 9070 XT, Ryzen 7 5700X3D, Windows 11 (no GPU used: the fixture fakes Vulkan, and the real_ cases use the OS wait)
Scene: none (game-free)
Method:
python -I -B tests/test_recorder_own_idle.py --cxx clang++ --headers <Vulkan-Headers>with llvm-mingw, three times in arow on each commit, and the suite (
tests/run_all.py)How to reproduce: the command above on Windows (the
real_cases skip, saying so, elsewhere)cf605c8553fe0b5eTesting
Tested: the test on Windows, llvm-mingw clang, three times in a row on every commit, and on this head with
test_recorder_sync,test_draw_stream_visibility,test_fsr_uniform_ownership,test_fsr_image_retirementandtest_recording_admission(all pass).tests/run_all.pyon this head: 519 passed, 5 failed, 35 skipped; the five (test_module_ids,test_pad_layout,test_framegen_resources,test_tested_configurations,test_oot_state_tap) fail the same on a clean maincf605c85. The tests went through eleven rounds of our own second-opinion review. Eachround found timing or lifetime gaps in them (all fixed in these commits), and the last round is clean.
Not tested: the
real_cases on Linux:vk_replay.cpp's Linux adapter ishost/posix's futex, which this test does not build.They skip there with a line saying so (the Linux futex path ran in the game in #162's T-GTM9 test).
Needs other testers: None.
Screenshots
Nothing on screen.
Risk and rollback
Tests only. The
real_cases use the real OS wait, so a heavily loaded runner could make one retry more; a run that cannotconclude fails after 20 attempts with a line saying so. Reverting the commits is enough.
Reviewer notes
The answers to review 1195's five points are on #162 (it was merged before this was pushed).
Issues
See #162
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: test(vk): the recorder own/idle checks with slot identities and the real wait (review 1195 of #162)to test(vk): the recorder own/idle checks with slot identities and the real wait (review 1195 of #162)543846ebinto test/recorder-own-idle-reviewMerged main
543846eb(bb552e07, no force-push). The only conflict was tests/test_recorder_own_idle.py: main copied gpu_wait_stats.h into the fixture's include folder by name (the #60 interplay mooki noted); this PR's version already copies every header vk_work.h and vk_recorder.h include, which covers it, so that side is kept. test_recorder_own_idle (all cases and broken variants), test_recorder_sync and test_gpu_wait_stats pass on the merge; the full suite follows.Full suite on the merge (
bb552e07, main543846eb, Windows, llvm-mingw 20261104, --jobs 4): 532 passed, 3 failed, 36 skipped. The same 3 fail on clean main543846ebhere (532/3/36): tests/test_oot_state_tap.py, tests/test_tested_configurations.py, tests/test_walk_key.py.