From 0930df6b71dcceca03b3a0eca6a2124d6bca4756 Mon Sep 17 00:00:00 2001 From: Michael B Reiser Date: Sun, 18 Oct 2026 13:17:54 -0400 Subject: [PATCH] =?UTF-8?q?runner:=20throttle-proof=20host-timed=20waits?= =?UTF-8?q?=20=E2=80=94=20Worker=20timer=20with=20a=20setTimeout=20backsto?= =?UTF-8?q?p=20(LAB-303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ArenaRunner._sleep was a plain setTimeout. Chrome aligns page timers to 1 s ticks once the tab is hidden or the window is occluded, so on the Bergamo 2P rig (2026-10-16) every host-timed 3 s step ran 4.00 s while the operator worked in ScanImage over the Studio window. The wait now runs on createSleepTimer(): a dedicated Worker built from an inline blob URL (the runner stays a classic - + diff --git a/js/arena-runner-g6.js b/js/arena-runner-g6.js index 94fa7f61..823c694e 100644 --- a/js/arena-runner-g6.js +++ b/js/arena-runner-g6.js @@ -1065,6 +1065,154 @@ var ArenaRunnerG6 = (function () { await sleep((Number(remainderSec) || 0) * 1000); } + // ---- throttle-proof host-side wait timer ------------------------------ + // + // A page setTimeout is throttled once the tab is hidden or the window is + // occluded: Chrome aligns it to 1 s ticks (1 min after 5 min hidden). On the + // Bergamo 2P rig (2026-10-16) every host-timed 3 s step ran 4.00 s while the + // operator worked in ScanImage over the Studio window. Dedicated Workers are + // not throttled, so the wait is armed in a Worker built from an inline blob + // URL (no extra file — this module must stay a classic