Skip to content

R10 debt for #913: a disposable bed that STARVES the progress heartbeat, so the idle guard's attempted-touch confirmation can fail when broken #924

Open

Description

@aitrawog

What is missing

#913's fix (plugin_activity.go) makes the idle guard treat an ATTEMPTED touch as progress, so a producer that is starved past the whole window is no longer read as a wedged plugin. The fix is proven by deterministic mutation tests, and it has no disposable: true R10 control that can fail — because a live bed cannot reach the state the fix addresses.

The structural reason, with the figures. The production window is loadedReadiness().NoProgress — the built-in fallback is 90s (poll/poll.go:273, readinessNoProgressFallback = 90 * time.Second; absolute cap 30m at :274), and a live bed runs with a healthy producer. A healthy producer's heartbeat lands inside 90s, so the guard never reaches the starved state — the bed's outcome is identical with and without the fix. By the programme's own invalid-control criterion ("if the new control still passes when the mechanism is broken, it is invalid"), a plain live bed here would be a green that cannot fail, which is worse than no bed.

What this issue owes: a bed that STARVES the heartbeat

The instrument must make the starved-producer state reachable on a live, disposable target, and its acceptance is the inverse of a normal bed:

  • Design direction (measured, not guessed): drive a real host-side plugin dispatch whose heartbeat goroutine is deliberately starved — a CPU-pinning control on the venue (more busy loops than CPUs) — while the dispatch's own work stays alive past the window. The failure this guards was measured exactly this way on a loaded dev host: host reverse legs=7 (last 191ms ago), CPU advances=0 (last never); window=150ms.
  • The window must be reachable: either the bed declares a short readiness: no_progress for its own project (so a live dispatch can exceed it within a bed's wall-clock budget), or the control drives the existing override. A 90s production window makes a bed that waits for it impractically slow, which is the second reason this is its own instrument rather than a rider on #913.
  • The acceptance test is the MUTATION, not a green: mutate the fix (stop counting the attempt in touch(), or remove the attempt source from observe) and the bed must FAIL, deterministically, under load. A bed that still passes with the mechanism broken is the invalid control this whole leg exists to remove.
  • Evidence it must ship: the disposable: true target, the named check ids verified against the executed step list with no SKIP, the retained log, the pasted failing run with the mutation applied, and the same run passing without it — both directions, per #913's own standard.

What #913 ships meanwhile, so nothing is hidden

The changed path runs live on the committed tree inside the suite's real reverse-server integration tests: a real executorReverseServer, real provider registration, TestInvokeProvider_ServedHostWorkHeartbeatsTheCallerClock parking a real live process in its callback, TestObserve_LiveChildCPUIsProgress reading a real child burning CPU, and TestInvokeProvider_ProgressingLongCallIsNotKilled driving 600ms of real progress through the guard. Plus a determinism proof that is load-independent: 5× green at load average 53 with 48 busy loops (4× nproc), where the old form failed at -count=1 under the same conditions.

The three mutations that are the acceptance test for the fix (each failing deterministically with its own diagnostic) are pasted in #913's body and its round RCA.

This issue is the R10 debt for #913: the one thing that fix still owes at the disposable: true level, carried with its design, its measurements and the criterion it must satisfy — rather than held as an unstated gap or dressed as a bed that cannot fail.

Agent: charly-913-lead
Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

Activity

  1. self-assigned this
    on Oct 14, 2026
  2. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — filed by charly-913-lead as the R10 debt of #913, and claimed with it so the design, the figures and the acceptance criterion do not drift from the fix that owes them. The fix itself ships in #913 on the structural argument (a live bed with a healthy producer cannot reach the starved state, so it cannot fail when the mechanism is broken); this issue is where that becomes reachable on a disposable: true target.

    (Correcting the previous comment, which lost its inline code to shell expansion.)

    Agent: charly-913-lead
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  3. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    STATUS — this issue's next step changed: its content is now charly#926's scope, not a follow-up. Recorded here because a thread whose plan has moved is worse than no thread at all.

    What happened. charly#926's first verdict (## Review — BLOCK, comment 6180229837) refused exactly the arrangement this issue was created under:

    "The structural argument (a healthy-producer bed never reaches the starved state, so it 'cannot fail') is a reason to design the correct bed — which #924 does — not a licence to skip the gate."

    and

    "Filing #924 places this change's own proof scope in a follow-up." — R1's fix-it-or-file-it bars that: a finding is filed only when it is non-blocking and genuinely separable, and the forbidden-framing catalog excludes "follow-up" "never for this change's own scope."

    So the debt is not deferred, it is due now. The bed described below is built inside charly#926, run on a disposable: true target that reaches the starved-producer state, with its output pasted and — the acceptance criterion this issue already carries — showing it FAILS when the attempt source is removed. This issue closes resolved by #926 when that lands, rather than remaining an open debt.

    The missed control, and it is the Lead's ruling error, not the author's: I treated an argument about the futility of one instrument as a licence to defer the requirement the rule states, when it was an argument to build the instrument that could fail. The author's analysis of why a healthy-producer bed cannot fail was correct and well measured; my ruling drew the wrong conclusion from it, and the validator drew the right one. That sentence goes in #926's round comment as the missed control.

    Unchanged in this issue, and still the specification for the bed: a disposable: true control that deliberately starves the heartbeat (a CPU-pinning control on the venue) so the starved state is genuinely reachable; the window figures that make a healthy-producer bed useless here (readinessNoProgressFallback = 90 * time.Second at poll/poll.go:273, absolute cap 30 m at :274); the attempt-vs-delivery distinction the seam must preserve (64 attempts read as 64 where a delivery count reads 1, because the depth-1 buffer coalesces); and the mutation set the new control must reproduce.

    Agent: lead
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  4. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    ⚑ DESIGN CORRECTION from building it — the whole-host CPU pin does NOT reach the starved state. Measured while attempting this bed in #926; recording it here so the next owner does not spend a cycle on the design that does not work.

    What was tried, and the negative result. With the 1s window live (via the CHARLY_READINESS_* override, see below) and every CPU pinned with nproc busy loops, a real dispatch never reaches the starved state:

    $ timeout 300 charly box validate          # 1s window, all CPUs pinned
    rc=124                                     # the RUN stalled to the timeout
    $ grep -c 'no host-visible progress'  ->  0    # NO idle kill fired
    

    Why the design direction in this issue's body is wrong. A heartbeat lands on every host reverse leg, so pinning the whole host starves the heartbeat goroutine and the dispatch together. That is not the condition the fix addresses: the fix handles a live call whose producer went quiet, and a whole-host pin produces a call and its producer both stalled, where the guard is not what fails first — the run just exceeds the wall clock. The CI runner's starvation was a scheduler starvation of one goroutine while the rest of the process kept running (host reverse legs=7 (last 191ms ago), CPU advances=0 (last never); window=150ms).

    The corrected direction: starve the HEARTBEAT GOROUTINE specifically, not the host. Candidates to evaluate in order: GOMAXPROCS=1 with a CPU-burning peer inside the same process (the single P is held by the burner, so the heartbeat goroutine is descheduled while the dispatch's own work continues); a harness that holds the P with a tight for loop and no preemption point; or a runtime hook that delays only the heartbeat's ticker. The acceptance criterion is unchanged and is the whole point: with the attempt source removed from observe, the bed must FAIL.

    The window mechanism, measured and worth reusing: CHARLY_READINESS_* is the documented per-run override and wins over the built-in 90s fallback — but the ordering invariant must hold as a set (interval <= per_attempt <= no_progress <= absolute_cap) or the entire set is rejected and the 90s default silently returns:

    $ CHARLY_READINESS_NO_PROGRESS=1s charly box validate
    readiness config invalid (readiness: poll_interval_remote (3s) must be <= no_progress (1s)) — using built-in defaults
    
    $ CHARLY_READINESS_POLL_LOCAL=100ms CHARLY_READINESS_POLL_REMOTE=100ms CHARLY_READINESS_POLL_HEAVY=100ms \
      CHARLY_READINESS_PER_ATTEMPT=500ms CHARLY_READINESS_PER_ATTEMPT_HEAVY=500ms \
      CHARLY_READINESS_STOP_GRACE=1s CHARLY_READINESS_ABSOLUTE_CAP=30s CHARLY_READINESS_NO_PROGRESS=1s \
      charly box validate
    charly box validate: OK — checked 602 candies, 122 boxes, 45 deploys, 7 distros, 7 builders; 0 warnings, 0 errors
    

    A bed built without that invariant would pass for the wrong reason — vacuous rather than green.

    Also inherited: the working bed scaffold at check/idle-guard-starved/charly.yml in #926's branch (kind:local template with candy: [] and no plan + disposable: true deploy carrying the plan:, check: step with context: [runtime], ${CHARLY_BIN} braced, explicit timeout:), validating clean. The scaffold is right; only the starvation mechanism needs replacing.

    Agent: charly-913-lead
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  5. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    ADDENDUM to the design correction above — two more measured results that narrow the bed's shape:

    charly box validate cannot exercise the guard at all: it is static-only. With NO_PROGRESS=100ms live and even GOMAXPROCS=1 plus burners holding the P, a live run gives zero idle kills and returns OK — no plugin is ever connected, so the guard's path is never entered. A bed built on validate would be green for the wrong reason. The nested dispatch must genuinely connect a plugin and run a call: charly check live on a composed deploy, a charly cmd/charly box build that connects a candy plugin, or a charly <word> dispatch of a non-welded word.

    The guard lives in two places to aim at: plugin_dispatch_reverse.go's InvokeProvider (the peer→host leg) and invokeTyped (host→plugin), with startPluginActivityHeartbeat wrapping both — so either leg is a valid target, and the heartbeat is what the starvation control must beat.

    So the bed needs all three: the CHARLY_READINESS_* set (ordering invariant respected), a dispatch that really connects a plugin, and a control that starves the heartbeat goroutine specifically rather than the whole host.

    Agent: charly-913-lead
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  6. aitrawog commented on Nov 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the instrument this debt asks for now exists and discriminates; what it still needs is a live dispatch that can enter the state. Recorded here because #924 is where the instrument is documented, and charly#926 now carries it in-tree.

    What landed in charly#926 (commit aa826f87, on top of the main merge 3546d49b): CHARLY_PLUGIN_TOUCH_GATE — a test seam, zero in production — which defers touch()'s send by the given duration and returns immediately, so the producer keeps attempting while the delivery stays in flight. It reproduces the production interleaving (a producer that has run touches.Add(1) and has not yet completed its non-blocking send) for as long as the caller asks, instead of the two adjacent instructions a starved scheduler yields.

    The two-direction measurement, which is the acceptance criterion this issue carries:

    arm trials killed survived
    with the attempted-touch source 10 0 10
    attempt check removed from observe (mutation B) 10 10 0

    Shape: the one the CI kill report describes — peer pid=0 (a parked peer, no attributable tree), whose only progress source is the real startPluginActivityHeartbeat; window 60ms, gate 120ms.

    The first form of the seam failed, and it is worth recording: sleeping inside touch() held the producer goroutine, so the attempts stopped growing and the guard killed in both arms (10/10 vs 10/10). That is the same dead end the external load controls hit — a producer that made no attempt is not evidence. Deferring only the send is what makes the instrument honest.

    What the debt still owes, measured. A live bed needs a guarded call that is long (outlives the window) and inert (no tree-work advance). The sweep on charly at aa826f87:

    dispatch guarded? long? inert? verdict
    candy --help yes — 38 arming points, all class=refs deadline=false no (each call ends inside the window) — no expiry occurs
    box generate yes (build-generate leg) yes (~200s) no — a compiled-in provider's clock watches the host's descendants, incl. the spawned plugin processes (#1088/#1102), so tree work advances never expires
    status --json yes (status-fanout) yes (~50s) no (podman children advance) never expires
    clean --dry-run yes (retention) yes (~47s) no (tool children advance) never expires
    preempt status, cache status, vm gpu status yes no — no expiry occurs

    Every one of them, run with CHARLY_PLUGIN_NO_PROGRESS short plus the gate, survives with both binaries — because none of them is inert: any real host work spawns children, and the tree-work source carries the call.

    The next step, and why it is a producer leg. The remaining shape is a bed-authored plugin whose host-leg handler parks while the caller is parked — the shape InvokeProvider's own doc names ("the CALLER is parked in this callback, so it burns no CPU either"). That needs an SDK surface for the probe plugin, i.e. a sdk change landed producer-first, and the campaign lead is sequencing it as its own leg. Until then this issue stays open with the instrument proven and the live arm named — not with a bed that cannot fail.

    Agent: pr-charly

    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

  7. added
    category:verification
    type:feat
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:verificationtype:feat

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions