Skip to content

check roster: a producer/consumer bed pair has no ordering, so the consumer races its producer #1168

Open

Description

@aitrawog

RCA — strata.cachyos.check-instrument-cachyos-vm fails inside the check-all-beds roster

Found while running the 11.2 roster (check run check-all-beds, 160 beds, 16 lanes, binary 2026.318.1348).

The failure, verbatim

.check/strata.cachyos.check-instrument-cachyos-vm/2026.320.1037/summary.yml:

  - name: vm-build
    duration_seconds: 161
    ok: false
    status: FAIL
      findings:
        - severity: error
          text: "charly: error: command \"vm\": VM \"strata.cachyos.check-vm-clone-base\" has no kind:vm entity in charly.yml."
total_seconds: 161
ok: false
status: FAIL

Mechanism

Two beds in charly/box/cachyos/charly.yml are a producer/consumer pair:

bed role line
check-vm-clone-base produces — snapshot: {on_finalize: golden, mode: external} from cachyos-vm :3706
check-instrument-cachyos-vm consumes — vm.from: check-vm-clone-base:golden :3761

The roster selects both and runs them at lanes: 16. Measured timing: the base bed's run dir is
2026.320.1037 and the consumer failed after 161s at vm-build — the consumer resolved
check-vm-clone-base before the base bed had materialized its VM entity, so the reference found
no kind: vm node and the step failed.

requires_exclusive:/requires_shared: (used at :698, :967) serialize on host resources;
they express contention, not ORDER. A grep for depends_on/needs/after:/serial: in this file
finds no ordering field, so nothing in the bed contract can say "run the producer first".

The missed control

The roster's selection is a SET with a throughput knob. lanes: 16 is a performance parameter and
was read as if it were also a correctness one
— and there is no dependency graph in the contract
for a bed to declare, so a producer/consumer pair cannot be ordered even if someone wanted to.

Why my own checks did not catch it: I verified that the roster selects (160/12), that the beds
launch, and that the machinery runs. None of those asks whether the selection is runnable as a
set
— a question that only appears when two beds hold a producer/consumer relation, which no local
gate models because the relation lives in one repo's charly.yml and is discovered only at run time.

Blast radius

Every bed whose vm.from: names a sibling bed's snapshot races its producer under any lane count

  1. In this roster that shape appears wherever a clone-based bed shares a base with another, and the
    consequence is a FAIL that looks like a defect in the consumer when the ordering is the defect.

It also means a roster result cannot be read as "these 160 beds fail/pass" until the roster either
orders its producer/consumer pairs or runs them with lanes: 1 — the second is correct but
serializes ~160 beds.

Root fix — the options, and where the decision belongs

  1. A declared dependency in the bed contract (depends_on: [<bed>]), resolved by the roster into
    a topological order before dispatch. Correct, and the smallest change that makes the relation
    expressible; it is a charly/plugin-check + schema change.
  2. Infer the edge from vm.from: <bed>:<snapshot> — no authoring change, but it makes the roster
    parse another entity's reference semantics, which is the kind of implicit coupling §10.2 exists to
    prevent.
  3. Document lanes: 1 as the requirement for any roster containing a clone pair — cheapest, and it
    moves the burden onto whoever runs the roster, where it will be forgotten.

(1) is the honest fix; (3) is a workaround with a friendly name. This is a product decision about
the bed contract's shape, so it is filed rather than decided inside a check run.

What this does NOT change

The roster's other findings stand on their own, and the two 11.2 gates remain green
(charly box validate: 0 warnings; design-check.sh: all controls pass). This RCA does not impugn
either.

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Activity

  1. aitrawog commented on Nov 16, 2026

    @aitrawog
    ContributorAuthor

    Correction — the diagnosis stands, my proposed fix does not

    The measurement is unchanged and still true: the base bed ran at 2026.320.1037, the consumer died 161s later with VM "…check-vm-clone-base" has no kind:vm entity in charly.yml. A consumer racing its producer is real, and it makes a 160-bed verdict unreadable.

    But all three options I wrote above were invented on the fly, and two one-line checks would have killed them:

    1. depends_on already exists — schema/_common.cue:106 ([...string]) and schema/task.cue:60 ([...#EntityRef], "task names that must complete (in order) before this task"). Adding a third on the deploy shapes would be an R2 duplication.
    2. DESIGN.md already specifies the ordering model — D-FLOW-1: "A pipeline is a named set of stages run in the host venue, ordered by after:. … may run once per item of the list a parameter holds (lane:), with at most concurrency: lanes or deployments at once." And its reconciliation row (DESIGN.md:3012) maps a routine's depends_on closure onto exactly that: "a routine is a pipeline: order with after:".

    What that means for this issue

    The mechanism was never missing — the ROSTER is. DESIGN.md:2996 refuses it outright:

    a second pipeline engine — D-FLOW-1 says charly pipeline run <name> is the only runner, and no subsystem row offers another

    A flat check-roster kind with its own lanes and its own worker pool is that second runner. Its ordering need is D-FLOW-1's after: over stages that "realize deployments and run their checks" — the shape P26 (Pipeline stages, attempts and asks) owns, and which is planned.

    So this issue's correct resolution is not a new bed field. It is: the roster becomes a pipeline per D-FLOW-1, and until that lands, a roster's failures must be read with the cross-bed-dependency class held separate from genuine bed failures.

    No spec change was pushed; the branch was deleted.

    The general control this cost me, recorded so it stops costing: before designing a field, a shape or a mechanism — grep the contract for it, then read the DESIGN.md row that governs the area.

    Agent: lead
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

  2. aitrawog commented on Nov 16, 2026

    @aitrawog
    ContributorAuthor

    Correction to my own example — the arms NEST

    I wrote the roster's replacement as stage: {<bed>: {deployment: [...], after: [...], concurrency: N}}. That does not validate, and the fault is mine, not the contract's: DESIGN.cue:904-907 nests every arm —

    step:       {step!: [...#DeploymentStep], ...}
    pipeline:   {pipeline!: #Ref, ...}
    deployment: {deployment!: #RefSet, ...}
    ask:        {ask!: #StageAsk, ...}

    — a tagged union. So the correct form of this issue's fix is:

    stage:
      check-vm-clone-base:
        deployment: {deployment: [check-vm-clone-base]}
      check-instrument-cachyos-vm:
        deployment: {deployment: [check-instrument-cachyos-vm]}
        after: [check-vm-clone-base]
        concurrency: 4

    The point of the issue is unchanged and now implemented: after: is the ordering edge, the producer runs first, and the consumer waits. opencharly/plugin-pipeline#66 lands exactly that, with a mutation test proving the lowering fails without the reordering.

    The general lesson, which is the third time this session has paid for it: an example in prose is a claim about the schema and gets validated against it, like any other.

    Agent: lead
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

  3. added
    category:verification
    type:fix
    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

No one assigned

    Labels

    category:verificationtype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions