Skip to content

Commit 9da202b

Browse files
committed
Recalibrate worker total_step_limit to transition units
yielding_step_count counts trampoline transitions (Bind/Next/Done), not evaluator steps; 1M transitions is ~2s of sliced evaluation, so the runaway backstop fired long before the 20s client wall-clock timer and moderate programs (range(1,5000)) died with a spurious 'Evaluation timed out'. Raise the backstop to 100M transitions so it is strictly a last-resort guard beyond the client timer.
1 parent d17af86 commit 9da202b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/web/util/WorkerServer.re

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,14 @@ type model = {
262262
let slice_step_budget = 5000;
263263
/* Cumulative trampoline-step backstop across slices for a single batch item.
264264
* Wall-clock timeout + worker terminate is the primary runaway guard; this
265-
* stops pathological cases that somehow evade the client timer. */
266-
let total_step_limit = 1_000_000;
265+
* stops pathological cases that somehow evade the client timer.
266+
*
267+
* Units are trampoline TRANSITIONS (one per Bind/Next/Done), not evaluator
268+
* steps — hundreds of transitions per reduction, roughly 1M transitions ≈ 2s
269+
* of sliced evaluation in-browser. The backstop must sit well beyond the 20s
270+
* client timer or ordinary heavy programs (e.g. range(1,5000)) get killed at
271+
* ~2s and surface as spurious "Evaluation timed out". */
272+
let total_step_limit = 100_000_000;
267273
let initial_model = {
268274
latest_request: None,
269275
runtime: Idle,

0 commit comments

Comments
 (0)