You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ready-for-review (correctness phase + GO-bar bench measurement both complete; PR #140 open; default stays OFF pending owner decision)
Next action
Owner: review PR #140 and decide (a) merge as-is (flag default OFF, safe no-op unless opted in), (b) request the budget=1024 tuning experiment noted in notes/21 before merging, or (c) flip QWISP_TOKEN_BUDGET_SCHED default ON in a follow-up once satisfied with the p90 tradeoff documented below.
Verification
Correctness: xcodebuild build -scheme qwisp BUILD SUCCEEDED, RAWTESTS 92/92, COMPTEST 83/83 (4 new locked tokenbudget_* self-checks), BENCHBATCHTEST PASS — all independently re-run outside the authoring agents.
GO-bar bench (real model, scripts/bench_lane_budget_ab.sh 24000): steady-decode-lane inter-token-latency while a 24K-token prompt admits concurrently. OFF: p99/max = 93,668ms (one unbounded stall = the other request's full prefill, scales with its size). ON (budget 2048): p99/max = 13,516ms (~7x reduction, bound no longer scales with admitted-prompt size — the motivating failure mode is fixed). Caveat: p90 got worse (17ms → 9,983ms, OFF concentrates pain into 1-2 samples vs ON spreading smaller stalls across ~25%) — full analysis in notes/21's new "Bench verification results" section.
Bench tool (new, kept as regression tool): scripts/bench_lane_budget_ab.sh + tools/lane_budget_probe.mjs.
Diff: swift/Sources/QwispCore/ContinuousBatch.swift (AdmitProgress/admitStep/tokenBudget/loopBudgeted/tokenBudgetSelfCheck), swift/Sources/QwispCore/LaneServe.swift (LaneBatchSlots.Prefill state hoist + admitStep override + LaneBackend flag wiring).
Decisions made
Correctness (locked COMPTEST) and the perf GO-bar are separate gates, same as WS-A's phase-1/phase-2 split — both now land in this PR, flag still default OFF regardless of merge.
The spec's original GO-bar framing ("~1 chunk-worth of decode latency") was corrected post-measurement: the real bound is "≤1 budget-worth of prefill compute at the admitting request's current depth" (chunk cost itself grows with depth per notes/19 §8) — see notes/21.
Failed approaches
First bench attempt used a 24K-token prompt that, combined with the default QWISP_LANE_CTX=16384 cap, clamped maxTokens to 0 — the "big" admit became a silent no-op in BOTH the OFF and ON passes (indistinguishable ~210ms noise, not a real measurement). Fixed by explicitly raising QWISP_LANE_CTX=32768 for the bench server only (not the shipped default — that's Stage B's job).
Second attempt still measured a no-op: a units bug in the probe's filler-prompt generator repeated a 14-word sentence words times instead of words/14 times, producing a ~295K-token prompt (12x past even the raised cap). Fixed by dividing by the sentence's own word count.
Only after both fixed did the OFF pass show the real, expected 93.7s stall — always sanity-check a "no interleaving benefit measured" result against the actual server log (prompt= token count, gen=0) before trusting it as a negative result.
Snapshot
claude/token-budget-scheduler82b585a@ 2026-07-25Status
ready-for-review (correctness phase + GO-bar bench measurement both complete; PR #140 open; default stays OFF pending owner decision)
Next action
Owner: review PR #140 and decide (a) merge as-is (flag default OFF, safe no-op unless opted in), (b) request the budget=1024 tuning experiment noted in notes/21 before merging, or (c) flip
QWISP_TOKEN_BUDGET_SCHEDdefault ON in a follow-up once satisfied with the p90 tradeoff documented below.Verification
xcodebuild build -scheme qwispBUILD SUCCEEDED, RAWTESTS 92/92, COMPTEST 83/83 (4 new lockedtokenbudget_*self-checks), BENCHBATCHTEST PASS — all independently re-run outside the authoring agents.scripts/bench_lane_budget_ab.sh 24000): steady-decode-lane inter-token-latency while a 24K-token prompt admits concurrently. OFF: p99/max = 93,668ms (one unbounded stall = the other request's full prefill, scales with its size). ON (budget 2048): p99/max = 13,516ms (~7x reduction, bound no longer scales with admitted-prompt size — the motivating failure mode is fixed). Caveat: p90 got worse (17ms → 9,983ms, OFF concentrates pain into 1-2 samples vs ON spreading smaller stalls across ~25%) — full analysis in notes/21's new "Bench verification results" section.Context pointers
scripts/bench_lane_budget_ab.sh+tools/lane_budget_probe.mjs.swift/Sources/QwispCore/ContinuousBatch.swift(AdmitProgress/admitStep/tokenBudget/loopBudgeted/tokenBudgetSelfCheck),swift/Sources/QwispCore/LaneServe.swift(LaneBatchSlots.Prefill state hoist + admitStep override + LaneBackend flag wiring).Decisions made
Failed approaches
QWISP_LANE_CTX=16384cap, clampedmaxTokensto 0 — the "big" admit became a silent no-op in BOTH the OFF and ON passes (indistinguishable ~210ms noise, not a real measurement). Fixed by explicitly raisingQWISP_LANE_CTX=32768for the bench server only (not the shipped default — that's Stage B's job).wordstimes instead ofwords/14times, producing a ~295K-token prompt (12x past even the raised cap). Fixed by dividing by the sentence's own word count.prompt=token count,gen=0) before trusting it as a negative result.