Skip to content

fix(e11): repair the density instrument's measurement artifacts (#291) - #293

Merged
pdettori merged 19 commits into
rossoctl:mainfrom
pdettori:fix/291-e11-driver-artifact
Sep 19, 2026
Merged

pdettori merged 19 commits into
rossoctl:mainfrom
pdettori:fix/291-e11-driver-artifact

Conversation

@pdettori

@pdettori pdettori commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Repairs the three mechanical defects in deploy/microvm/e11-density.sh that issue #291 identified, adds the control arm whose absence let a driver artifact be published as a density finding, and marks the §E11 conclusions that rest on those defects.

Summary

Refs #291 — items 1, 2, 4 and 6. Deliberately not Closes: GitHub's keyword parser ignores the qualifying text and would close #291 outright on merge, while item 3 (persistent-connection client, now tracked as #294) and item 5 (relay instrumentation) remain open work.

Why the published result was suspect

EXPERIMENTS.md §E11 reports a knee at c=8 on both the microVM arm and the container baseline, with nearly identical curve shape, and concludes the bound is replenishment on both arms. Two structurally different backends saturating at the same concurrency with the same shape is the tell. Each defect below affects both arms identically by construction, and any one is sufficient to produce that shape with no contribution from either backend:

  1. Host signals were sampled on an idle machine. host_signals_snapshot ran after every slot subshell had exited and after the throughput window closed, and host_cpu_fraction then slept one second and diffed /proc/stat across that sleep. The recorded values contain their own falsification: hostCpuFraction of 0.0006 on a 72-cpu host is 0.043 cores busy, for a rung sustaining ~41 Exec/sec at ~9 spawns each — on the order of 370 process creations per second. Worse, crosses('cpu') tests hostCpuFraction >= 0.9, so a post-load 0.0006 made the cpu bound structurally unable to fire at any rung: "nothing resembling a CPU or memory ceiling was reached" was a restatement of the sampling bug, not a finding.
  2. ~9 process spawns per Exec inside the timed window, two of them Python interpreters, with t0 stamped before the compound whose argument list contained both command substitutions — so both interpreter startups fell inside the measured latency.
  3. Converge sat in the throughput denominator. wall_t0 was stamped, each slot then ran a git fetch, and wall_t1 closed after all of it. The header's claim that converge is timed separately only ever applied to p50/p95.

What changed

  • Payload construction leaves the timed window. The 7 mix commands are pre-escaped once per rung and each slot's workspace_key once per slot, both above wall_t0, still through the same json_escape so the bytes are identical by construction. Timing moves to $EPOCHREALTIME (LC_ALL=C pinned, with a preflight refusal, because the decimal separator is locale-dependent). Per-Exec cost is now one execve for grpcurl and no forks.
  • A converge barrier precedes the timed window. run_density_rung converges every slot and drains fully; only then is wall_t0 stamped. Slot identity comes from three shared helpers so both phases land on the same workspace and req_id ranges stay disjoint across the barrier.
  • Host signals are sampled during the window. A background sampler brackets exactly wall_t0..wall_t1 and is reaped before aggregation. Its every-tick path forks nothing (/proc read with builtins, previous CPU reading kept in globals, printf -v); pgrep plus the smaps_rollup walk runs every Nth tick and always on tick 1. hostCpuFraction now carries the window's mean, with peak, min and sample count beside it — the mean because scoring a sealed prediction off one one-second peak would be the same class of error pointed the other way. The idle snapshot is retained under postLoad* names so it can never again pass as an under-load reading. A rung yielding zero samples is refused, not backfilled.
  • A driver-control arm, on by default. remote-worker/cmd/null-responder answers every Exec with one End and no execution, loopback-only and enforced post-bind. The identical run_density_rung drives it, so subtracting it at each c gives the driver's own share.
  • RungSample documents what its four host signals now mean and declares the new fields optional. No scorer logic changed; predictions.json is untouched and its SHA-256 pin still passes.

The numbers stay

§E11's tables are unedited. They are the record of what the broken instrument produced, and the re-run is defined by comparison against them. A dated caveat marks the replenishment attribution, the "no ceiling" claim, the c=8 knee position and prediction 3's score as under repair. Records from the repaired driver carry samplingMode; the published ones do not, and the two are not comparable on those four fields.

Known risks, stated plainly

This instrument has not been executed since these changes. A real sweep needs /dev/kvm, Docker, grpcurl and real worker binaries. E10's first real execution found three defects, and a fourth at full ITERS; E11 is the larger driver. An unexecuted fix is a known risk, not a clean bill of health.

hostCpuFraction from a 1–2 sample mean is not yet a number to score a sealed prediction against. At default ITERS_PER_SLOT a c=1 rung spans about one sampler tick. Check hostCpuSamples per rung before letting crosses('cpu') decide anything, and raise SH_E11_ITERS_PER_SLOT so each window spans ≥10 ticks for any rung that will be scored.

The control arm is a strict lower bound on driver cost. The responder sends no Chunk, so it never pays grpcurl's per-Exec chunk decode. Subtracting it over-attributes the residue to the backend — the same direction of error as the original bug. Disclosed in start_null_stack, in every rung's proxyLimitations, and in the §E11 caveat.

Two outcomes of this work that are not failures of it: the control arm may show the driver still dominates, making item 3 mandatory before an authoritative run — that is the control doing its job. And analyzeLadder may now reach falsified where it read inconclusive, because real CPU data can cross 0.9. No scorer logic changed; the verdict it produces can.

Verification

Cluster-free suite deploy/microvm/tests/e11-density.test.sh at 0 failures; make test green (1,247 tests across all packages, plus go test ./... and every deploy shell suite); shellcheck clean at -S warning and with check-unassigned-uppercase on both changed shell files; gofmt/go vet clean; pnpm -r typecheck clean; pre-commit clean over every changed file.

New tests worth noting: the converge barrier is proven behaviourally — the real run_density_rung runs with converge_slot stubbed to fail, and the suite asserts the rung is refused, no Exec is issued and no record is written, with a non-vacuousness complement proving phase 2 is reachable when converge succeeds. That complement is what caught a pre-existing bug in the suite's own extract_fn, which truncated run_density_rung at a column-0 } inside its embedded Python writer.

Known non-blocking follow-ups: deploy/microvm/tests/e10-lifecycle.test.sh still has that naive extract_fn matcher (latent — its only such heredoc sits in main(), which that suite never extracts; e10 is green, and the design doc forbids touching e10), and epoch_delta_ms is now referenced only by tests after its arithmetic was inlined.

🤖 Assisted-By: Claude Code

)

E11's knee at c=8 appears on both the microVM arm and the container
baseline with near-identical shape, which is itself the tell: three
mechanical defects in e11-density.sh hit both arms identically by
construction, and any one of them reproduces the observed curve with no
contribution from the backend.

Records the approved scope (issue items 1, 2, 4, 6), the deferrals and
why, and one finding beyond the issue: hostCpuFraction feeds
crosses('cpu') against a 0.9 threshold, so a post-load 0.0006 does not
merely weaken the "no CPU ceiling" claim -- it makes the cpu bound
structurally unable to fire at any rung.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…nt (rossoctl#291)

Eight tasks against docs/superpowers/specs/2026-09-17-e11-driver-artifact-design.md:
payload construction out of the timed window, a converge barrier, an in-rung host
sampler with the record schema it feeds, a null-responder and the driver-control arm
it serves, RungSample doc comments, and the EXPERIMENTS.md caveat.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
grpc_exec_record ran ~9 processes per Exec -- mktemp, date x2, json_escape x2
(python3 x2), grpcurl, rm, plus wc -l x2 in the caller's loop guard -- and t0 was
stamped before the compound whose argument list held both command substitutions, so
two interpreter startups were inside the measured latency. At c=64 that is ~64 slots
x ~9 spawns continuously, enough to produce the observed c=8 knee on both arms with
no contribution from either backend.

Refs rossoctl#291 item 2.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
The every-tick path reads /proc/stat and /proc/meminfo with the read builtin, keeps
the previous CPU reading in globals so there is no sleep inside a sample, and formats
with printf -v. pgrep plus the smaps_rollup walk runs every Nth tick (and always on
tick 1), because reading 128 rollups a second while measuring a density ceiling would
perturb the thing under test.

Not wired into run_density_rung yet: the converge barrier lands first, or the sampled
window would still contain the git fetch.

Refs rossoctl#291 item 1.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
wall_t0 was stamped, then every slot ran converge_slot -- a git fetch -- inside the
window wall_t1 closed, and throughput is successful Execs over those wall seconds. So
converge WAS a throughput ceiling on both arms by construction; the header's claim
that it is timed separately held only for p50/p95.

run_density_rung now converges every slot, drains, stamps wall_t0, and only then runs
the Exec loop. Slot identity is recomputed from three shared helpers, so phase 2 lands
on the workspace phase 1 prepared and req_id spaces stay disjoint across the barrier.

Refs rossoctl#291 item 3.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
host_signals_snapshot ran after every slot subshell had exited and after the
throughput window closed, and host_cpu_fraction then slept one second and diffed
/proc/stat across that window -- so hostCpuFraction, memAvailableBytes and pssBytes
all described a quiesced machine. 0.0006 on a 72-cpu host is 0.043 cores busy, while
the same rung sustained ~41 Exec/sec at ~9 spawns each. And because crosses('cpu')
reads hostCpuFraction >= 0.9, a post-load 0.0006 made the cpu bound structurally
unable to fire at any rung: 'no CPU ceiling was reached' was a restatement of this bug.

hostCpuFraction is now the MEAN over wall_t0..wall_t1, with peak, min and sample count
beside it -- the mean because scoring a sealed prediction off one one-second peak would
be the same class of error pointed the other way. The post-load snapshot is kept under
postLoad* names so an idle reading can never again pass as an under-load one.

Refs rossoctl#291 item 1.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Serves sandbox.v1.SandboxExec against the existing gen/go stubs and does nothing: Exec
sends one End{req_id, exit_code: 0} and returns, Abort returns empty. No relay, no
Redis, no worker, no codegen.

e11-density.sh will drive the identical run_density_rung against it, so subtracting
that arm at each c gives the driver's own contribution -- the number that decides
whether replacing grpcurl with a persistent-connection Go client is required before an
authoritative metal run.

Loopback is enforced rather than documented: this answers every Exec with success and
no execution.

Refs rossoctl#291 section 4.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
A third arm drives the identical run_density_rung against the null-responder, with no
relay, no Redis and no worker, so subtracting it at each c gives the driver's own
contribution to observed latency. grpcurl still re-parses the proto and opens a fresh
connection per call; if that residue dominates at high c, a fixed-but-still-grpcurl
driver would show a knee that is still an artifact and a persistent-connection client
becomes mandatory before the authoritative run.

It follows the container path -- require_vmm 0, no standby poll, swept dimensions
recorded as null -- and analyze_slice is skipped, because a ladder with no cold
acquires is not what analyzeLadder scores. Its ladder is still assembled: the
subtraction needs it.

SH_E11_ARMS is opt-OUT. The control whose absence let this artifact through should not
be opt-in.

Refs rossoctl#291 section 4.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
requireLoopback checks the requested address string before Listen, but it does not
resolve "localhost" and so could pass despite the real bind landing on a non-loopback
interface. After net.Listen succeeds, also check lis.Addr() as a *net.TCPAddr and
refuse, naming the bound address, if IP.IsLoopback() is false. The pre-Listen check
stays: it gives the better message in the common case of a bad flag value.

TestRequireLoopback also gains IPv6 cases: an IPv4-mapped address and [::1] are
accepted; the unspecified address and a routable address are refused.

Refs rossoctl#291 section 4.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
pssBytes, memAvailableBytes, hostCpuFraction and processCount keep their names and
their place in the contract but now carry the timed window's mean rather than a
post-load snapshot, and the record carries each one's extremes and sample count beside
it. Declared optional because pre-fix records lack them, and no scorer reads any of
them.

No scorer logic changes. The verdict analyzeLadder produces can now differ -- real CPU
data can cross 0.9 where an idle 0.0006 never could -- but not because a comparison
here was edited. predictions.json is untouched and its pin still passes.

Refs rossoctl#291 section 5.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
The numbers stay -- they are the record of what the broken instrument produced, and the
re-run is defined by comparison against them. What is marked is which conclusions rest
on the three defects: the replenishment attribution, the 'no CPU or memory ceiling'
claim (which is a restatement of the sampling bug, since a post-load 0.0006 makes
crosses('cpu') unable to fire at all), the c=8 knee position, and prediction 3's
SUPPORTED score.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Final fix wave for issue rossoctl#291 follow-up findings I1-I5/M6-M12:

- I1: stamp each grpc Exec's latency from $EPOCHREALTIME instead of a
  forked `date` call, so per-Exec timing no longer pays its own driver
  cost inside the timed window.
- I3: caveat EXPERIMENTS.md's published conclusions where they rest on
  the driver's own artifacts (additions only; no published number,
  row, or verdict changed).
- I4: add pssRefusedTicks to the rung record and its TypeScript
  schema, so a smaps_rollup refusal during low-cadence PSS sampling is
  counted rather than silently folded into "no sample".
- I5: gate preflight()'s docker/pnpm and KVM/cgroup/swap/governor
  checks behind a new arm_in_use() helper, so a driver-control-only
  sweep no longer requires container/microvm tooling it never uses.
- M6-M9: header comments for the three-arm model, a guard against a
  silently-shrunk tool-call mix, ${VAR-default} instead of
  ${VAR:-default} where "set but empty" must NOT fall back, and a
  sampler bookkeeping reorder plus a C-style Phase-2 dispatch loop so
  neither lands inside the timed window.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Adds the missing test coverage for the final fix wave: arm_in_use()
and preflight()'s conditional checks (I5), the SAMPLE_TICK==0
no-extra-tick-at-stop gate (I2), pssRefusedTicks' accounting via
sampler_marker_count/sampler_field (I4), and grpc_exec_record's
absence of any command substitution (M10).

Writing these tests surfaced two real bugs in the test harness itself,
both fixed here:

- run_writer's manual variable stub for the extracted record-writer
  body never set pss_refused_ticks, so every writer invocation in
  that section died on "unbound variable" under set -uo pipefail (15
  cascading failures, not a driver bug).
- The new "no diluted extra tick" check used a fixed sleep-then-check
  timing that raced against host_sampler_loop's own slice cadence:
  the loop only notices a stop file once per SAMPLE_SLICE_MS, at the
  top of its loop, so a tick already in flight when stop lands always
  completes regardless of which constants are chosen. Replaced the
  fixed sleep with active polling for the first real tick, then
  signalling stop immediately on seeing it -- deterministic across six
  consecutive runs.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Found by the FIRST-EVER EXECUTION of this driver, in a Linux container: awk's OFMT
defaults to %.6g, so mem_available_bytes' `print $2*1024` emitted 1.73035e+10 on a
16 GiB host and would emit 8.0896e+11 on the documented 754 GiB metal box.
require_numeric refuses that, host_signals_snapshot returned non-zero, and EVERY RUNG
WAS REFUSED with no record written. The metal run this was about to feed would have
produced nothing.

The cluster-free suite passed throughout because its fixture uses 8192000 kB, small
enough to print as an integer. The behaviour is also awk-dependent -- Debian's mawk goes
scientific where macOS awk and gawk do not -- so a dev machine could never see it.

printf "%d" is NOT the fix: mawk clamps %d to 32 bits and prints 2147483647, recording
2 GB where the truth is 17 GB -- wrong in the optimistic direction spec section 7.3's
boxed warning exists to prevent. This reads /proc/meminfo with the same builtin loop the
in-rung sampler uses: 64-bit bash arithmetic, no format string, no fork.

The regression test proves the pathology where the platform exhibits it and skips with an
explanation where it does not, asserting the fix either way.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
I overstated it. The scientific-notation form is MAWK-specific: gawk and macOS awk print
808960000000 for the same expression, because they apply OFMT only to non-integral values.
Both rigs this project runs on -- the 72-cpu/754 GiB metal box and the nested-m8i EC2
instance -- ship gawk, verified on both, and were never affected. So the previous commit's
claim that it would have refused every rung on metal was wrong.

The fix is still worth having: it removes the dependence on which awk a host ships, and a
Debian/Ubuntu host (mawk) really would have recorded nothing. But the comment claimed more
than the evidence supports, and a confidently wrong comment in this file is worse than none.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…lent zero

Found on both rigs during rossoctl#291's shakedown. /proc/<pid>/smaps_rollup passes a mode-bits
-r test but its open is gated by ptrace permissions, and the pid can also exit between
the test and the read. Unhandled, BOTH cases silently contributed 0 kB to Sigma PSS --
awk's failure left pid_kb empty and bash arithmetic reads empty as 0 -- which is the
RSS-fallback failure mode in disguise: the one number spec 7.3 boxes as non-negotiable,
under-reported in the optimistic direction, with the record still looking complete.

A live-but-unreadable pid now takes the 7.3 refusal, naming the pid and pointing at
SH_E11_VMM_PROC_PATTERN's unscoped pgrep -f, which is the likeliest cause: on the metal
box it matched a colleague's . An exited pid stays a
race, contributes 0, and now prints nothing -- 14 awk fatal lines in one three-arm smoke
made a benign race read like a defect.

Also: a thin rung now WARNS at run time. Both fast arms measured 75-256 Exec/sec on the
nested rig and produced exactly one host sample at the shipped ITERS_PER_SLOT, with
hostCpuFractionPeak == hostCpuFraction. That is the common case, not a corner case, and a
one-sample mean cannot support a crosses('cpu') verdict. It warns rather than refuses,
because a thin rung is legitimate, and names both knobs. The ITERS_PER_SLOT default now
carries the >=10-ticks sizing rule with the measured evidence.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Found by execution on the nested rig. RESULTS accumulates across runs and nothing clears
it -- not this script, not the metal runbook -- and assemble_ladder globbed
e11-rung-ARM-c*.json, so a rung from an earlier run with different settings was silently
assembled into the current ladder. Observed: a c=2 rung from a 20-iter smoke reappeared
inside a 600-iter ladder, carrying its one-sample hostCpuFraction. detectKnee anchors on
the c=1 baseline, so a stale c=1 does not merely add a bad point, it re-scales every health
decision after it. That is this issue's own failure mode one level up: a ladder that looks
complete while mixing measurements that were never comparable.

Every rung now carries a per-invocation runId, and assemble_ladder keeps only matching
rungs, names any it drops, and refuses outright rather than writing an all-stale or empty
ladder. A record predating the stamp has no runId and counts as stale, which is the safe
direction.

Two process notes, both self-inflicted and both caught by tests. Appending || die to the
python block's closing quote left extract_fn's skip span open, so the suite sourced a
snippet without the function and every call exited 127 -- the closing quote must stay on
its own line, and there is now a comment saying so. And the guard that should have caught
it passed vacuously, because extract_fns only fails at the first MISSING name; it is now
guarded on extract_fn assemble_ladder alone.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori

pdettori commented Sep 18, 2026 •

Copy link
Copy Markdown
Member Author

Executed on hardware since the review

The branch has now been run, which the original description said had not happened. Two rigs, and it found three defects the whole review chain missed — all fixed on this branch (2107211, c953c98, f3dd610/9d5c97c).

Nested-m8i (m8i.xlarge, 4 cpu): E10 smoke exit 0; full three-arm E11 smoke exit 0 with all 9 rung records. First execution ever of the microVM arm with this code — require_vmm=1 satisfied against real Firecracker processes, Σ PSS scaling 6.5→25.6 MB with VM count, standbysResident 1/2/4, and reclaimConvergenceS 115/92/115 — variable, where the pre-fix code wrote a constant 138 for every rung and made §7.4's prediction 5 unmeasurable. The microVM arm shows no knee to c=4: throughput 3.8→7.9→15.3 near-linear with p95 flat at 250/239/259.

Metal (srv-r16b14s16, 72 cpu / 754 GiB, virt: none): the driver-control arm over the full published ladder — see #294 for the table. Headline: an arm with no backend at all peaks at c=8 and then declines, burning 64 of 72 cores at c=64. Same knee position and curve shape as the published result. Meanwhile postLoadHostCpuFraction reads 0.0006–0.0010 at every rung, reproducing §E11's published "0.001 flat" exactly while the under-load mean reaches 0.89 — direct confirmation the fix targets the right bug.

Defects found by execution and fixed here

  • A ladder could mix rungs from different runs (c953c98). RESULTS accumulates and nothing clears it, and assemble_ladder globbed e11-rung-ARM-c*.json — a c=2 rung from a 20-iter smoke reappeared inside a 600-iter ladder. detectKnee anchors on the c=1 baseline, so a stale c=1 re-scales every health decision after it. Rungs now carry a per-invocation runId; strays are named and dropped, and an all-stale directory refuses.
  • A PSS read failing after -r passed contributed 0 silently (2107211). /proc/<pid>/smaps_rollup passes a mode-bits test but its open is ptrace-gated, and the pid can exit in between. Both cases left pid_kb empty and bash reads empty as 0 — the RSS-fallback failure mode in disguise, under-reporting Σ PSS in the optimistic direction with the record still looking complete. A live-but-unreadable pid now takes the §7.3 refusal; an exited one stays a race and no longer prints 14 awk fatal lines per sweep.
  • Thin rungs now warn at run time (2107211). Both fast arms produced exactly one host sample at the shipped ITERS_PER_SLOT, with hostCpuFractionPeak == hostCpuFraction. That is the common case, not a corner case, and a one-sample mean cannot support a crosses('cpu') verdict. ITERS_PER_SLOT now documents the ≥10-ticks sizing rule with this evidence.

Correction to an earlier claim

I said the MemAvailable scientific-notation defect (f3dd610) would have refused every rung on metal. That was wrong, corrected in 9d5c97c: the form is mawk-specific, and both rigs ship gawk — verified on both. The fix is still worth having (it removes awk-implementation dependence and a fork, and a Debian/Ubuntu host would have recorded nothing), but it rescued no metal run.

What this does not establish

No authoritative sweep. #294 — replacing grpcurl with a persistent-connection client — is now mandatory before one is worth booking, on this branch's own evidence. §E11's caveat stays as written.

🤖 Assisted-By: Claude Code

shellcheck analyses the file as a whole rather than per scope, so a variable assigned in
several subshell fixtures and read only inside a dynamically-sourced snippet is reported
once, at its LAST assignment. The new assemble_ladder fixtures added a later one, which
moved the finding and broke lint.

This is the maintenance trap Task 2's review named and that two later tasks were warned
about; it caught me anyway, and my own per-file shellcheck report claimed this file was
clean when it was not. pre-commit found it. The comment now says why the placement is
load-bearing so the next fixture added below it does not repeat this.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(GitHub does not allow setting a formal review verdict on your own PR, so this is posted as a comment; the verdict below is the intended one.)

Summary

Well-scoped, heavily self-documented repair of three measurement artifacts in the E11 density benchmark driver (post-load host-signal sampling, forked-process cost inside the timed window, converge sitting in the throughput denominator), plus a new driver-overhead control arm. Verified locally on the branch tip: shellcheck -S warning clean, gofmt/go vet/go build/go test ./cmd/null-responder/... clean, the cluster-free e11-density.test.sh suite at 0 failures, pre-commit clean on all 9 changed files, and pnpm --filter @sh/experiments typecheck && test — the only failures there (k8s-sandbox implicit-any errors, 4 test files needing a private @earendil-works/pi-coding-agent package) reproduce identically on rossoctl/main HEAD, so they're pre-existing and unrelated to this PR. All of this matches the PR description's own verification claims.

The blocker is process, not code: the branch has real merge conflicts against current main, and no CI has actually run on GitHub for this PR.

Findings

  1. must-fix (mergeability) — this branch is not mergeable against current main. mergeable_state on the PR is dirty, and git merge-tree reports real conflicts in deploy/microvm/e11-density.sh and deploy/microvm/tests/e11-density.test.sh against 5 commits that landed on main after this branch was cut (relay-kill-by-port, the redis error-listener fix, the E11 4-more-defects audit, and the req_id collision guard). Needs a rebase onto rossoctl/main before this can merge.
  2. suggestion (CI) — no CI or Security Scans workflow run exists for this branch/head SHA at all; only the DCO check ran (verified via the check-runs API on the head SHA). Both workflows trigger unconditionally on pull_request: branches: [main] with no path filters, so this looks like an un-actioned fork-PR approval gate rather than a path-filter skip. Worth triggering the real GitHub-hosted run before merge, even though my local equivalent checks (above) all pass.
  3. suggestion (issue linking) — the body says "Closes #291 items 1, 2 and 4" and lists items 3 and 5 as deferred, but GitHub's closing-keyword parser only sees Closes #291 and will fully close the issue on merge regardless of the qualifying text — even though items 3 and 5 remain open work. Recommend Refs #291 instead (or reopening #291 after merge) so the tracking issue doesn't silently close out from under the deferred items.
  4. nit (commit accuracy) — commit b652c513 ("put a converge barrier before the timed window") says Refs #291 item 3, but issue #291's own numbered list has item 3 as the deferred persistent-connection client — the converge barrier is item 6. (Design spec §3 does cover the converge barrier, so this looks like a spec-section vs. issue-item mislabel.)
  5. nit (PR format) — title is 78 chars (over the 72-char advisory guideline); body has no ## Summary header. Both advisory-only per repo convention.

Author: pdettori (MEMBER — maintainer)
Areas reviewed: Shell, Go, TypeScript, Docs, CI/mergeability
Agent/IDE config (.claude/.vscode): none
Commits: 18 commits, all signed-off: yes
CI status: only DCO ran (pass); CI/Security Scans workflows never triggered

Intended verdict: REQUEST_CHANGES

Driven solely by the unresolved merge conflict — no code-quality must-fixes found. Rebasing onto rossoctl/main should clear it.

@pdettori pdettori changed the title fix(e11): repair the density instrument's three measurement artifacts (#291) fix(e11): repair the density instrument's measurement artifacts (#291) Sep 19, 2026
Clears PR rossoctl#293's merge conflict (review finding 1, the only must-fix). Merged rather
than rebased on purpose: PR rossoctl#296 is STACKED on this branch, so force-pushing a rebase
would orphan 83fd348 from rossoctl#296's history and force a second rebase there. A merge keeps
the 18 reviewed commits byte-for-byte, needs no force-push, and follows this repo's own
precedent (227ebda, "Merge rossoctl/main into E13").

Three conflict hunks, all resolved by keeping both sides:

1. cleanup_on_exit - main added E11_IN_CLEANUP=1 so kill_relay_by_port can tell a
   trap-driven teardown (log and continue) from a between-arm one (die); this branch
   added stop_host_sampler. Both are needed and neither displaces the other. The flag is
   set first, before any stop_*_stack as main's comment requires, and the sampler is
   stopped before the rm -rf of E11_TMPDIR as this branch's comment requires - the
   sampler polls for a stop file under that root, so after the rm it would spin forever
   writing to a deleted path. Verified: kill_relay_by_port reads ${E11_IN_CLEANUP:-} and
   returns cleanly when it was never set.

2. preflight - this branch made the tool and hardware checks conditional on the
   configured arm set (rossoctl#291 item 5), and main added require_tool ss for
   kill_relay_by_port. `ss` is folded INSIDE the container-or-microvm branch rather than
   above it, because kill_relay_by_port is called from stop_container_stack and
   stop_microvm_stack only: the driver-control arm runs no relay and tears its responder
   down by pid. Requiring it unconditionally would re-block exactly the
   SH_E11_ARMS=driver-control run that item 5 exists to unblock.

3. tests - both sides appended an independent section at the same point (the
   driver-control arm here, kill-by-port teardown on main). Both kept.

Also correcting the record for review finding 4, which a merge cannot fix by rewriting
history: commit b652c51's trailer says "Refs rossoctl#291 item 3". Issue rossoctl#291's numbered list has
item 3 as the deferred persistent-connection client (now tracked as rossoctl#294); the converge
barrier that commit implements is item 6. Design spec section 3 does cover it, so the
mislabel is spec-section vs issue-item. b652c51 stays as written - it is public and
rossoctl#296 is stacked on it.

Gates on the merged tree: e11-density.test.sh 0 failures; shellcheck clean at -S warning
and -o check-unassigned-uppercase on both changed shell files; go build, gofmt -l (empty),
go vet, go test ./... all clean; make test-deploy 0. EXPERIMENTS.md's §E11 caveat survives
alongside main's new E12/E13 sections, blockquote integrity intact.

Refs rossoctl#291.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori

pdettori commented Sep 19, 2026 •

Copy link
Copy Markdown
Member Author

Review addressed

1. must-fix (mergeability) — fixed. mergeable is now MERGEABLE.

Merged rossoctl/main in rather than rebasing, deliberately. PR #296 is stacked on this branch, so force-pushing a rebase would orphan 83fd348 from #296's history and force a second rebase there. A merge clears the conflict, keeps the 18 reviewed commits byte-for-byte, needs no force-push, and follows this repo's own precedent (227ebda, "Merge rossoctl/main into E13"). If you'd rather have linear history and are willing to rebase #296 too, say so and I'll redo it as a rebase.

Three conflict hunks, all resolved by keeping both sides. The second one was a judgement call worth flagging:

  • cleanup_on_exit — main added E11_IN_CLEANUP=1 (so kill_relay_by_port can tell a trap-driven teardown from a between-arm one); this branch added stop_host_sampler. Both kept: the flag is set first, before any stop_*_stack as main's comment requires, and the sampler stops before the rm -rf of E11_TMPDIR as this branch's requires — it polls for a stop file under that root, so after the rm it would spin forever writing to a deleted path. Verified kill_relay_by_port reads ${E11_IN_CLEANUP:-} and returns cleanly when never set.
  • preflight — this branch made the tool and hardware checks conditional on the configured arm set (E11: the density knee may be a driver artifact — host resource signals are sampled post-load, and the driver spawns ~9 processes per Exec #291 item 5); main added require_tool ss. I folded ss inside the container-or-microvm branch rather than above it, because kill_relay_by_port is called from stop_container_stack and stop_microvm_stack only — the driver-control arm runs no relay and tears its responder down by pid. Requiring it unconditionally would re-block exactly the SH_E11_ARMS=driver-control run that item 5 exists to unblock. Worth a second look, since it's the one place I chose neither side as-written.
  • tests — both sides appended an independent section at the same point (driver-control arm here, kill-by-port teardown on main). Both kept.

2. suggestion (CI) — resolved by the push. All 13 check runs pass on e38c8c0: check, lint, proto, microvm-gates, deploy-scripts, shellcheck, hadolint, CodeQL, codeql (javascript-typescript), Trivy, trivy-scan, dependency-review, DCO. Your reading was right that it was an un-actioned gate rather than a path-filter skip — the new head SHA triggered the real runs.

3. suggestion (issue linking) — fixed. Body now reads Refs #291 — items 1, 2, 4 and 6, with an explicit note that Closes was avoided because the keyword parser ignores qualifying text and would close #291 while item 3 (now #294) and item 5 remain open.

4. nit (commit accuracy) — confirmed, and corrected in the record rather than in history. You're right: #291's item 3 is the deferred persistent-connection client and the converge barrier is item 6. b652c51's trailer stays as written — it's public and #296 is stacked on it — so the merge commit message carries the correction, including that the mislabel is spec-section vs issue-item.

5. nit (PR format) — fixed. Title is now 70 chars, and the body has a ## Summary header.

Gates re-run on the merged tree, locally

e11-density.test.sh 0 failures; shellcheck clean at both -S warning and -o check-unassigned-uppercase on both changed shell files; go build, gofmt -l (empty), go vet, go test ./... clean; make test-deploy 0. §E11's caveat survives alongside main's new E12/E13 sections with its blockquote intact.

I did not re-run pnpm -r test/typecheck locally — the merge touches no TypeScript this branch owns, and CI's check job covers it and passed. That also matches your note that the local k8s-sandbox/private-package failures reproduce on main and are unrelated.

🤖 Assisted-By: Claude Code

@pdettori
pdettori merged commit e68ab80 into rossoctl:main Sep 19, 2026
13 checks passed
@pdettori
pdettori deleted the fix/291-e11-driver-artifact branch September 19, 2026 13:17
pdettori added a commit to pdettori/moca that referenced this pull request Sep 19, 2026
The driver-control arm PR rossoctl#293 added supplied the measurement issue rossoctl#291
deferred item 3 on: on metal the driver alone peaks at c=8, burns 64 of 72
cores at c=64, and carries 753ms of the published microVM arm's 1686ms p95.
The remaining per-Exec execve is grpcurl, which re-parses the proto and opens
a fresh TCP connection and HTTP/2 session per call.

The design: a new remote-worker/cmd/exec-driver holding one grpc.ClientConn
for a whole rung and c goroutines in place of c bash subshells, writing the
existing `<ms> <status> <cause>` per-slot lines so aggregation, percentiles
and the record writer are untouched. Opt-in behind SH_E11_EXEC_CLIENT so the
bash path stays the reference until the two are compared on one host.

Records one finding beyond the issue: the relay yields ExecEvent.error and
then returns a gRPC OK status, so grpcurl exits 0 and an ExecError-failed Exec
counts toward throughput and never reaches execErrorsByCause. It cannot affect
this issue's comparison (the null-responder only sends End), so the Go path
classifies it correctly and discloses the divergence.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
pdettori added a commit to pdettori/moca that referenced this pull request Sep 22, 2026
…not density

The re-run's position reproduces and its instrument repairs hold, but every
microVM ladder in this section swept offered concurrency `c` while the worker
admitted only 4 concurrent Execs (`session.DefaultConcurrency = 4`, which
`e11-density.sh` never overrode). Slots and `c` are confounded throughout, so
no conclusion drawn above `c = 4` can separate a property of the design from a
property of that constant.

The section's own arithmetic exposes it: it derives a ~4.5 VMs/s replenishment
supply and offers it to explain a flat ~62 Exec/s plateau, 14x apart. Four
slots at the measured 61.4 ms per Exec predicts 65.1 Exec/s against a measured
62.99, and predicts every other rung within a few percent. The p95 column
doubling per doubling of `c` is the same fact read as latency — queueing
against a fixed-capacity server.

Purely additive; no measurement is removed. Separated explicitly:

- Survives: the rossoctl#293 sampling and rossoctl#296 Go-client repairs, "it is not the
  driver's knee" (driver share under 0.4%), "no CPU ceiling was reached" (now
  explained — 4.81 of 72 cores because only 4 Execs were admitted), and the
  container arm, which at ~1940 Exec/s is nowhere near a 4-slot cap.
- Does not survive: the `coldAcquireRate` argument (#306 — wrong by 13x at
  c=8, ~250x above), `bound = replenishment` as a genuine crossing, and the
  `D` sweep as evidence. "Rate, not depth" is independently correct, but with
  4 Execs in flight no value of `D` could have changed the outcome, so that
  sweep is what a slot-capped ladder must produce either way.
- Left open: c=8 peaks at 80.62 Exec/s, ~4.9 effective slots, which a 4-slot
  cap cannot produce. Unexplained.

With slots raised to match `c`, the same host reaches 577.55 Exec/s at 64
slots. Resolves rossoctl#291 as investigated with a stronger outcome than "it holds":
the knee reproduces and its cause is known.

Refs rossoctl#291 rossoctl#305 #306

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
pdettori added a commit that referenced this pull request Sep 22, 2026
…the re-run

The 2026-09-17 caveat asked a falsifiable question: does E11's c=8 knee stay
there once driver cost is removed and host CPU is sampled under load. It does.
So the caveat's items are resolved rather than retracted, and this section's
conclusion was right while only its evidence was wrong.

Purely additive: no published number is removed. This section's own policy is
that "the numbers stay ... the record of what the broken instrument produced",
and the re-run is defined by comparison against them.

Adds `### Issue #291 -- the re-run`, on the same bare-metal host and golden
snapshot as the existing E10/E11 tables, with PR #293's repaired sampling and PR
#296's Go Exec client:

- knee = 8 on BOTH real arms, by the same p95-doubling criterion this section
  used for its published knee. The microVM knee is sharper than published:
  throughput now peaks at c=8 and declines, where the published ladder peaked at
  c=16. The container knee was reproduced twice, at ITERS_PER_SLOT 80 and 2000.
- It is not the driver's knee. driver-control's own knee is 4 (Go) or 32
  (grpcurl), never 8, and the Go driver is under 0.4% of the microVM arm's p95 at
  every rung -- against up to 23.7% had it been grpcurl, which quantifies the
  confound the 2026-09-18 note suspected.
- bound = replenishment on the microVM arm is a GENUINE crossing, at the same c
  as the knee. A D sweep (2/4/8) then shows the knee does not move while standbys
  go 52 -> 439 and Sigma PSS 0.324 -> 1.443 GB, so the bound is the serialized
  200ms replenishment RATE, not pool capacity -- standby-depth sizing is not the
  lever.
- "No CPU or memory ceiling was reached" becomes a real finding instead of a
  restatement of the sampling bug: the true under-load means are 0.067 and 0.093
  against crosses('cpu')'s 0.9, from 20-284 ticks per rung.
- Sealed prediction 3 scores `supported` from a threshold derived from the same
  client that produced the ladder (94ms = go-client microVM c=1 p95 82.0 + E10
  rung 3 restore 23.06/2), not from the grpcurl era's 124-133ms.
- Issue #295 stays open and is recorded as such; it confounded nothing here.

Also records two corrections to this section as published, rather than leaving
them to be rediscovered:

- The container arm's `bound: "cpu"` is attributeBound's documented fallback, not
  a crossing. Peak hostCpuFraction is 0.093 against a 0.9 threshold. It means
  "nothing bound", not CPU.
- The driver-control table in the 2026-09-18 note does not reproduce past c=1.
  Same host, client and settings now give 1910.8 Exec/s at p95 39.26ms at c=64
  where that note recorded 231.6 at 753ms on the same ~64 busy cores; c=1 agrees
  closely. Logged as an open discrepancy, explicitly not as a diagnosis.

And the three instrument defects the run found: the dying-VMM PSS refusal that
aborted the ladder (fixed in PR #299), that SH_E11_VMM_PROC_PATTERN cannot
usefully be scoped and must be left unset, and that the in-rung sampler has no
zero-PSS refusal (unfixed, same shape as #291's own item 1).

predictions.json is untouched and its hash pin still passes. Every table figure
was cross-checked against the committed rung records.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E11: the density knee may be a driver artifact — host resource signals are sampled post-load, and the driver spawns ~9 processes per Exec

1 participant