Send the held batch before waiting for a recording #1276
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!1276
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/radv-readback-wait-flush"
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?
With batched submits (
RX_VK_BATCH, on by default with RADV), a recording reaches the GPU, with its signal on the recordings' timeline, only when the batch is flushed.wait_recordeddid not flush first. Soinvalidate's readback wait could wait for a signal that was never sent. The game job that was waiting held up the main thread, and the main thread's progress polls are the other thing that flushes the batch. The game stopped presenting while it loaded a save.wait()already flushed before waiting;wait_recordednow does the same.tests/test_recorded_wait_flush.pychecks thatwait_recordedflushes before it waits. It fails on currentmain.How it was tested
RX 7900 XTX, RADV (Mesa 26.0.8), Linux 7.0, Ryzen 7 7800X3D. Default settings. Each run loaded a Kokiri Forest autosave from the title screen.
main(09e4eb5)main+ this fix, run 1main+ this fix, run 2A thread dump of the hang showed a
ModuleSystemWorkerjob insideinvalidate→wait_recordedandsead::MainThreadwaiting on that job, with the batch still holding the recording.Not covered
RX_VK_BATCH=1; I did not test them.tests/run_all.py --strict: the new test passes. 26 other tests fail locally only becauseclang++and the Pythonzstandardmodule are missing on my machine. They fail the same way without this change.Good catch. On main
wait_recordedwaits onrec_timelinewithout flushing first.wait()andwait_value()both flush, andqueue_flush_lockedis what addspend.recto the submit's signals, so a recording still held in the batch never signals. That matches the hang.The flush is safe here.
queue_flush_fortakespresent_mubriefly, returns early when nothing is held, and drops the lock before the wait.wait()already flushes before callingwait_recorded, so that call becomes a no-op, andinvalidate's fallback (wait_value) already flushes from the same context. The test is picked up by run_all's directory scan.Nits: the new comment is a bit long, and the test checks the source text, so a refactor could trip it (its message says so). No CI has run on the branch yet.