Repository navigation
fix(cognition): a healthy generation is never dropped — the lane gate and the act deadline are sized from her measured turn (card ebce2ba0) - #4289
Conversation
… and the act deadline are sized from her measured turn, and a drop is a counted outcome (card ebce2ba0) Measured on the M5, 2026-09-20, from ~/.continuum/fixtures/prompt-captures: of the last 50 submitted generations, 13 completed, 18 CANCELLED, 7 failed — 26% completion. Every cancel read "request future dropped before a terminal response", the string only `CaptureLease`'s Drop writes. Their elapsed_ms clustered on EXACT repeated values at different wall-clock moments: 60,009 | 165,843–165,982 (six) | 412,216–412,346 (four) | 485,151–485,196 (three) | 1,207,290 | 1,228,814 | 1,491,253–1,492,456. TWO dropping sites, both confirmed at the source: 1. `cognition/llm_deliberation_faculty.rs` — the `CaptureLease` is created at :1117, BEFORE the serving-lane gate, and the gate's `return None` (:1362) drops it. Those turns never reached the model. Proven by wall-clock: `delib.gate.lane_wait bound_secs=165 lane_hold_p50_ms=82918 queue_ahead=0 lanes_serving=2` fired SIX times and each cancel's submitted_at sits 1–16 ms from its probe, with elapsed == the bound. The bound is `lane_wait_bound` (rounds x lane_hold_p50 x SLACK, clamped): a median over TWO recorded lane holds, deciding how long a mind waits while the lanes were holding 4–7 minutes. It explains 60,009 (LANE_WAIT_FLOOR), ~165.9 s, ~412.2 s, ~485.2 s. NOT #4277's `from_expectation` used as a ceiling — that derivation was never consulted here at all. 2. `cognition/act_observe/settle.rs:565` — `timeout_at(tick_deadline, settle_step(...))` with a flat 25-minute `TICK_DEADLINE`, dropping the whole act future (and the generation inside it) mid-flight. Explains 1,207,290 / 1,228,814 / 1,491,253 / 1,492,283 / 1,492,456 — the deadline, less how far into the act the call started. THE FIX — the constant is a FLOOR, her measured turn is the bound: - The gate takes `effective_bound(queue_estimate, from_expectation(expected_occupancy))`. - The act takes `act_bound_with_source(TICK_DEADLINE, expected_occupancy)` = two turn bounds (a lane wait plus the generation after it), so the gate always trips first. THE SAFEGUARDS: - `cognition/generation_drop.rs` — `InFlight` is armed around the model call. A drop probes `persona.generation.dropped` with the bound, its source, the expectation behind it, elapsed, and the partial: answer chars, reasoning chars, prefill progress, and the COMPLETE tool calls thrown away (salvaged by holding the streaming receiver the non-observing path used to discard). It reports them; Drop is sync and the settle loop is being torn down, so there is no seam to execute them. - `note_generation_outcome` counts both halves; the hour line carries `dropped N of M (P%)` beside acts / lane-starved / think-only, via its own `snapshot_generations_and_reset`. - `Verdict::Dropping` outranks READING above 10%: 36% thrown away is a broken pipe, and it rendered as "READING: n acts, no writes" — which blames the citizens. - A never-dispatched abandon now names itself in the capture (`CaptureLease::abandon`) instead of writing the same generic string a real in-flight drop writes. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…g boundary it creates The detached solve's ACT_STALL_ALLOWANCE reads the CONSTANT (3x), so a box whose measured turn passes ~19 min would derive an act bound above the 75-minute stall allowance. No box in the fleet's measured range is there; the attempt ceiling fires first on one that slow; making the watchdog per-persona is a solve.rs change with its own required-read. Recorded at the seam rather than half-fixed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…T — fix the case's arithmetic CI caught my own test, not the code: lane_wait_bound(7, 1, 300_000, 30) computes 4,800 s and returns the 600 s LANE_WAIT_CEILING, so it was never the larger of the two. The corrected case asserts the more valuable fact — her 848 s measured turn rides ABOVE that clamp (a constant may raise a wait and never shorten one) — and takes a genuinely deeper queue (480 s) against a one-minute turn for the queue-wins direction. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
REVIEWED at head by Fable (team lead). Agent-written under my direction, on evidence I gathered and a site Cormac named; this is a second pair of eyes. The forensics are the strongest thing here and they CORRECTED me. I told the room these turns were being cut off mid-generation. They were not: the capture lease is armed at llm_deliberation_faculty.rs:1117, BEFORE the admission gates, and the lane gate returns None at :1362 and drops it — so those turns never reached the model at all, and lane starvation has been wearing a cancelled generation as a costume. The wall-clock correlation (1 ms to 42 ms between each The root number is the nights recurring disease one more time: THE RISK I CHECKED, being the reverse of the bug: making a bound longer can starve differently. The four safeguards are what Joel asked for and they are all present: the drop is counted and named with its bound and source, the hour line carries generations and generations_dropped, partial tool calls are salvaged rather than silently binned, and a node above ten percent dropped renders as Dropping instead of Reading — so a 36 percent loss rate can never again read as lazy personas. APPROVE — merging on green. |
The measured evidence
From
~/.continuum/fixtures/prompt-captures/*.jsonl(schema 4) on the M5, 2026-09-20. Of the last 50 submitted generations: 13 completed, 18 CANCELLED, 7 failed — 26% completion.Every cancellation reads
"error": "request future dropped before a terminal response"— the string ONLYprompt_capture::CaptureLease'sDropimpl writes, i.e. the awaiting side went away.Cancelled
elapsed_ms, sorted, clustering on EXACT repeated values at DIFFERENT wall-clock moments:The dropping sites
TWO of them. Both confirmed at the source, not inferred.
1. The serving-lane gate —
cognition/llm_deliberation_faculty.rsThe
CaptureLeaseis created atllm_deliberation_faculty.rs:1117, before the admission gates, and the lane gate'sreturn Noneat:1362drops it. Those turns never reached the model at all — the capture called them cancelled generations because the lease spans the gate.Proven by wall-clock correlation against the live probe stream, not by arithmetic alone:
delib.gate.lane_waitprobesubmitted_atelapsed_msbound_secs=165bound_secs=165bound_secs=165bound_secs=165bound_secs=485bound_secs=485bound_secs=485The
bound_secs=165row occurred exactly six times — matching the six ~165.9 s cancels one to one.Explains: 60,009 (=
LANE_WAIT_FLOOR), ~165.9 s (six), ~412.2 s (four), ~485.2 s (three).2. The act deadline —
cognition/act_observe/settle.rs:565tokio::time::timeout_at(tick_deadline, settle_step(...))with a flatTICK_DEADLINE = 25 * 60(settle.rs:29). On elapse the wholesettle_stepfuture — and the generation inside it — is dropped.Explains: 1,207,290 / 1,228,814 / 1,491,253 / 1,492,283 / 1,492,456 — the 1,500 s deadline less however far into the act the model call had started. (Cormac's box logged 1,499,996 ms, i.e. the deadline to the millisecond.)
The bound's derivation — and it is NOT #4277 used as a ceiling
The 166 s family is
resource_admission::lane_wait_bound(rounds x lane_hold_p50_ms x LANE_WAIT_SLACK, clamped to[60 s, 600 s]). The probe row that produced it:A median over TWO recorded lane holds decided how long a mind waits for a lane, while the lanes were actually holding 4–7 minutes (
lane_hold_p50_mslater read 242,574 and 424,348 — the same derivation gives the 485 s and the clamped 600 s families). It measures the LANES; it is not a bound for HER turn.To answer the question directly:
#4277'sfrom_expectation/expected_occupancyis NOT being used as a ceiling anywhere. At this gate that derivation was never consulted at all — the ONLY placeexpected_occupancyreached wasreserve_lendable. The defect is a different derivation, sized from the wrong quantity.#4277is the fix here, not the cause.The fix — the constant is a FLOOR, her measured turn is the bound
turn_bound::effective_bound_with_source(queue_estimate, from_expectation(expected_occupancy())). The queue's number stays the floor (it is the only thing that speaks before her first measured turn); her own measured turn raises it. A mind whose turns take ~7 min waits 848 s, not 165 s.turn_bound::act_bound_with_source(TICK_DEADLINE, expected_occupancy)—ACT_BOUND_TURNS = 2turn bounds, because an act is a lane wait PLUS the generation after it. The named 25 minutes is a floor. This also preserves the composition invariant the flat ceiling used to carry: the act (2 turn bounds) always outlasts the gate (1), so the gate still trips first and she keeps her act budget.expected_occupancy_for(persona_id)is lifted out of the faculty so seams above it can size from the same measured number.The safeguards
(a) A dropped generation is never silent. New
cognition/generation_drop.rs:InFlightis armed around the model call and disarmed on any terminal answer (response or typed adapter refusal). ItsDrop— the only thing that still runs when a future is torn down — probespersona.generation.droppedwith the bound, its source (turn_bound/floor), the expectation behind it, elapsed, and how much output existed.(b) The hour line carries it.
citizen_healthgainsgenerations/generations_droppedwith its ownsnapshot_generations_and_reset()(following thesnapshot_lane_starved_and_resetprecedent — never a tenth slot on the nine-wide tuple). The line renders· dropped 18 of 50 (36%)beside acts / lane-starved / think-only, anddropped n/awhen nothing ended (an unmeasured hour is not a clean one).(c) Partial tool calls are not thrown away silently — salvage IS implemented. The non-observing generation path used to
drop(receiver)on its stream. The witness now holds it, so a drop drains what the model had already produced and reports answer chars, reasoning chars, prefill progress, and the COMPLETE tool calls parseable in the partial text, by name (json_in_prompt_tools::parse_tool_calls). What is missing, stated plainly: it REPORTS them, it does not re-enter the turn with them.Dropis synchronous and the settle loop that would execute them is itself being torn down at that instant — there is no seam to hand them back to. On the live-Speak path the caller owns the stream, so the witness reportsobserved = falserather than a false zero.(d) The verdict says it.
Verdict::DroppingoutranksReadingaboveDROPPED_GENERATIONS_ABOVE_PCT = 10. The measured 36% currently renders asREADING: n acts, no writes — the governor owes a delivery, which points the reader at the citizens. It now renders as a PIPE fault.Also: a never-dispatched abandon names itself (
CaptureLease::abandon) —"lane starved before dispatch: waited 165s of a 165s bound (floor) with 0 lanes free"— instead of writing the same generic string a real in-flight drop writes. That conflation is why 18 of 50 read as dropped generations when most never reached the model.Tests
turn_bound.rs— an act is two turn bounds with the named deadline as a floor; unmeasured → the floor; never below it.resource_admission.rs— the queue's estimate is a floor under her measured turn and never a ceiling, reproducing the exactp50=82918 / queue_ahead=0 / lanes=2 -> 165,836 msrow, plus the gate-before-act composition invariant.citizen_health.rs— a drop increments the ledger, renders on the line, and outranks READING at the measured 36% while 4% still reads READING.generation_drop.rs— the salvage fold names a complete tool call, refuses to invent one from a half-emitted envelope, and folds an empty stream honestly.Each carries the measured elapsed families in its
// what this catches:comment.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo