Fixes premature unmet release of console list-value gates at Present under
LEONIDA_SUBMIT_ASYNC and unlocked queue execution:
- QueueHolds (runtime/src/queue_holds.h): add process-wide queue_holds::any_progress()
backed by a lock-free active CPU/async work counter (WorkGuard / work_changed),
signaled_unpumped_ tracking across signaled() -> pump_ready(), and per-holder
lock-free has_pending_gpu_work() protected against detach() via holders_use_mutex_.
- VulkanQueue (runtime/src/vulkan_backend.h): account for queued async inbox calls,
active async_worker turns (through pump_ready()), pending release_requested_ flags
(with async_stop_ guard), synchronous/draining executing_ passes (through pump_ready()),
VulkanFence::signal() -> pump_ready(), and unretired GPU tickets (submitted_gpu_ vs
progress_ counter). Stop cross-queue release_ready() ping-pong by waking only when
held_front_seq_ != 0 and calling pump_ready() in async_worker() only when a call
ran or a held op was released.
- Pump::choose_release (runtime/shims/d3d12_xs_list_values.h): treat
leonida::queue_holds::any_progress() as active queue progress so held waits are
never broken unmet while a producer async worker, executing pass, or GPU submission
is still progressing; advance last_progress_ms_ so kStalledMs measures genuine quiet
time. Genuine deadlocks (cycles, idle queues + idle GPU at Present, stalled title)
still break cleanly.
- Tests: add CPU-only QueueHolds + list_value_progress tests in
list_value_progress_test.cpp and real VulkanQueue async-depth=4 + Present + busy
producer + genuine deadlock + synchronous executing_ tests in submit_frame_test.cpp.
AI-assisted: Antigravity, Gemini 4 Neon.
Tested on Linux (RADV RAPHAEL_MENDOCINO, MESA_VK_DEVICE_SELECT=1002:164e!):
8/8 passed (list_value_progress, submit_frame, vk_queue, vk_queue_query_sync,
vk_queue_constructor_oom, vk_fence_dispatcher_sync, vk_semaphore_lifetime,
vk_fence_lost_by_counter).
A list value wait (wait32/wait64) that is not met at submission holds its queue until memory meets it. The fixed
200 ms timeout, LEONIDA_VALUE_WAIT_TIMEOUT_MS and the 4 ms demotions are removed (in Linux world runs 14-63 gates a
run timed out with the writer's value not there yet).
A held gate goes without its value only when nothing else can make progress (releaser idle, no title
ExecuteCommandLists in progress, nothing of the pump's running on the GPU; work the layer holds behind a wait is not
running, asked through the new rt::d3d12::fence_signal_submitted), and then only: in a cycle (at once), at a present
queued behind it (VIctory-Belobug-AMD's rule, queue/behind.rs step, queue.rs release_held), or when the title has made
no queue call for 2 s; every gate goes at device loss. src/list_value_progress.h (portable) replaces
list_value_wait_budget.h. Each release is logged with gate, queue, wait and reason; released waits met later are
counted. stop() drops gates it leaves shut so they no longer hold their queues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>