Skip to content

P3.1: E6 workload-parameterized sandbox-load (#62) - #63

Merged
pdettori merged 11 commits into
mainfrom
feat/e6-workload-parameterization
Jul 4, 2026
Merged

pdettori merged 11 commits into
mainfrom
feat/e6-workload-parameterization

Conversation

@pdettori

@pdettori pdettori commented Jul 4, 2026

Copy link
Copy Markdown
Member

Reworks P3's E6 (spec docs/specs/2026-07-03-e6-workload-parameterized-sandbox-load-design.md), resolving #62 (noise-sensitive knee) and the workload-realism gap. P3's E6 used a trivial marker.txt leaf, so its N ≈ 29–48:1 was an optimistic upper bound.

What shipped

  • buildRatioCurve + WorkloadPoint/RatioCurvePoint (experiments/src/sharing.ts, unit-tested): N ≈ 1/duty at each workload intensity, each point tagged with the leaf's measured sandbox exec count.
  • Noise-tolerant detectKnee (patience-based sustained-decline; E6 knee detector is noise-sensitive: use multi-sample rungs / warm baseline #62): tolerates a single throughput dip, breaks only after patience consecutive unhealthy rungs.
  • Real Archetype-A code-review fixtures on a git-daemon work ref (small/medium/large.py), replacing the marker leaf.
  • E6 driver rewrite: Phase 1 measures per-leaf sandbox duty at C=1 on a warm pod (exec-timing delta, median of samples) across L0/L1/L2 → the N curve; Phase 2 sweeps concurrency at the heaviest variant with the harness un-capped (max-scale raised so the sandbox, not the 5-pod harness cap, limits concurrency) → the knee as a floor.
  • harness/ and packages/ untouched — intensity is emergent + measured, not injected (spec D5).

Key finding (supersedes the plan's decreasing-curve hypothesis)

The Kind live run shows the N-vs-workload curve is flat, not decreasing:

variant file execCount execMs wallMs N
L0 small.py 2 280 6095 21.8
L1 medium.py 2 277 6648 24.0
L2 large.py 2 290 5711 19.7

execCount is a constant 2 across all variants — per-leaf sandbox work is fixed converge git plumbing (.sh-fetch.lock + per-leaf worktree add) amortized over the shared clone, independent of review scope. The small→large difference lands in the LLM turn (wall-time/tokens), not sandbox execs. So N ≈ 20–24:1, flat (the spread is wall-time noise). Concurrency sweep: throughput rose 0.114→0.664 leaves/s over c=1→16, p95 crossed the 2× bound at c=4 → knee floor = 2 (latency-bound on Kind's single node, not throughput saturation). EXPERIMENTS.md prose corrected to this measured reality.

Live-caught driver bugs (fixed; invisible to shellcheck / the gated no-op)

  1. Pod-Running race — wait_ksvc_ready confirms the ksvc config is Ready but not that a pod is Running; harness_pod() returned '' → execCount=0. Fixed with a bounded Running-wait + a warm-up converge dispatch.
  2. Single-pod sampling under Knative multi-revision routing — multiple revision pods run concurrently and a leaf may be served by any; sampling one pod missed execs. Fixed by aggregating the exec-timing delta across all Running harness pods (sum_exec_ms_all/count_exec_lines_all).

Status

  • Kind-verified (sh-knative, SH_MODEL=claude-haiku-4-5). Two per-task reviews per code task + an opus whole-branch review (caught 1 Critical + 3 Important, all fixed and re-reviewed clean).
  • Authoritative OCP 4.20 run deferred to a follow-up (per maintainer decision).

Assisted-By: Claude Code

Paolo Dettori added 11 commits July 3, 2026 21:13
…ad realism)

Reframes E6's headline as an N-vs-workload curve measured at C=1 across real
Archetype-A code-review leaves (L0/L1/L2 by review scope), so the sharing ratio
is tied to per-leaf sandbox work rather than reported as one optimistic
upper-bound number (the trivial marker-check leaf). Also fixes the #62 knee
confounds: raise harness max-scale for the sweep (so the sandbox, not the 5-pod
harness cap, limits concurrency), warm baseline, multi-sample rungs, and a
sustained-decline detectKnee. Registers P3 as built and P3.1 as design.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
7-task TDD plan: buildRatioCurve + sustained-decline detectKnee (unit-tested),
git-daemon work-ref code fixtures (L0/L1/L2), lib.sh helpers, E6 driver rewrite
(N-vs-workload curve at C=1 + un-capped noise-robust sweep), EXPERIMENTS.md
reframe, and a gated Kind->OCP re-run + PR.

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

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…llow, zero-exec floor, gitd race)

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

Two E6 driver bugs caught only by the live Kind run (invisible to shellcheck
and the gated no-op), both producing execCount=0 / a meaningless N curve:

1. Pod-Running race: after set_scale 1 1, wait_ksvc_ready confirms the ksvc
   config is Ready but NOT that a pod is status.phase=Running, so harness_pod()
   returned '' and the exec-timing delta read a non-existent pod. Fix: bounded
   wait for the pinned min-scale pod to be Running, plus one warm-up converge
   dispatch so the first sample isn't cold-start / first-clone inflated.

2. Single-pod sampling under Knative multi-revision routing: Knative keeps
   several revision pods Running across a config transition and may route a leaf
   to any of them, so sampling one pod (harness_pod, NR==1) misses execs served
   elsewhere. Fix: sum_exec_ms_all / count_exec_lines_all aggregate the
   exec-timing delta across ALL Running harness pods (all pin the same sandbox).

Driver-only; harness/ and packages/ untouched (FS-free contract). shellcheck -x
clean on both files; gated no-op still SKIPs with no cluster contact.

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

The live Kind run shows the N-vs-workload curve is FLAT, not decreasing:
execCount is a constant 2 across L0/L1/L2 (small/medium/large.py), so per-leaf
sandbox duty is fixed converge git plumbing (lock + worktree, ~280 ms) amortized
over the shared clone — independent of review scope, which lands in LLM wall-time
instead. N approx 20-24:1 (21.8 / 24 / 19.7 = wall-time noise). Corrects the E6
prose (which had asserted a decreasing curve as hypothesis) to the measured
reality and records the Kind numbers + the concurrency sweep (knee floor = 2,
latency-bound on Kind's single node). Authoritative OCP run deferred to a
follow-up per maintainer decision.

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.

1 participant