From 9ddbc7b49d050297e6fbb1f8fe6300fccdeb5748 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Mon, 26 Oct 2026 07:44:43 +0300 Subject: [PATCH] Check the replay queue for room again after taking the core back, since another thread may have filled it meanwhile Co-Authored-By: Claude Opus 5.5 --- runtime/vk_backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/vk_backend.c b/runtime/vk_backend.c index 2595cacb..27fa0bcd 100644 --- a/runtime/vk_backend.c +++ b/runtime/vk_backend.c @@ -263,7 +263,8 @@ static uint64_t replay_enqueue(ReplayItem *it) { CloseHandle(h); r_started = 1; } - if (rq_n == RQ_CAP) { + // rl is dropped while the core is taken back, and another thread may fill the queue again meanwhile: check again. + while (rq_n == RQ_CAP) { uint64_t p0 = perf_begin(); dr_calls[DR_FULL]++, dr_tcalls[DR_FULL]++; int away = core_away_unlocked();