Skip to content

Performance profile: measured acceleration headroom + decomposition (#56)#60

Merged
kiki830621 merged 2 commits into
mainfrom
idd/56-perf-headroom-local-direct
Jul 5, 2026
Merged

Performance profile: measured acceleration headroom + decomposition (#56)#60
kiki830621 merged 2 commits into
mainfrom
idd/56-perf-headroom-local-direct

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #56

Summary

#56 asked: within the local+direct architecture (no central cache), where's the acceleration headroom — and can subagents/haiku help? This PR delivers what the issue's Expected section demands: a dated, reproducible profile + a measured decomposition into children.

Measured (2026-07-06, directional — reproduce: python3 evals/look-up/profile_mcp.py)

  • Engine: zero structured concurrency (0 TaskGroup/async let hits) → sequential probe chains; resolve_source fastapi 1055–1159 ms vs react 353–385 ms. Warm ETag 10× (344→32 ms) but per-process only (docstring admits it).
  • Skill: docs questions = 2 sequential main-loop turns; turns dominate end-to-end latency, not fetch time.
  • Haiku delegation hypothesis: headless spawn ≈ 9 s wall vs the 0.3–1.2 s it would absorb → refuted for single-shot (8–25× net loss); viable only amortized over batches. The cheapest worker is the MCP server itself.

Changes

No engine code changes here (those are the children). Python suite untouched: 72 green; committed harness re-run confirms the capture's shape.

Checklist

  • Diagnose (measured: static + stdio timings + delegation experiment)
  • Implement (1 commit, Refs #56)
  • Verify (pinned-opus agent lenses — Workflow blocked by session model-tier doctrine)
  • Verify-gated — no close trailer; manual /idd-close after merge

🤖 /idd-all · Do NOT add Closes/Fixes/Resolves.

…mposition (#56)

Profile-before-optimize, per #56's own mandate — measured-never-asserted applied
to performance:

- evals/look-up/profile_mcp.py: speaks MCP stdio (newline-delimited JSON-RPC)
  directly to the installed signed binary — engine-side timings, no agent loop.
  Cold→warm within one server lifetime + fresh-process cold.
- evals/look-up/perf_profile.md: dated capture (2026-07-06) with reproduce
  commands + loud caveats (small n, one machine/network — directional).
  Key numbers: warm ETag 10× (344→32 ms) but per-process only; sequential
  probing (zero TaskGroup/async-let in Sources/) makes fastapi resolve ~3× react
  (1055–1159 vs 353–385 ms); haiku headless spawn ≈9 s — refutes subagent
  delegation for single-shot lookups (8–25× net loss); look-up docs questions
  cost 2 main-loop turns, which dominate end-to-end latency.
- README pointer.

Children filed from the measurements: #57 (TaskGroup parallel probing),
#58 (disk-persisted bounded ETag cache — local-only, inside the anti-positioning
boundary), #59 (composite one-call lookup, turns 2→1 — the measured replacement
for the refuted single-shot delegation). Python suite untouched (72 green).
…s per #56 verify (#56)

Two pinned-opus lenses (measurement-honesty + scope/regression) reviewed the profile;
their findings materially improved the measurement:

- MEDIUM: the original "cold" resolve_source react ran AFTER latest_version calls had
  ETag-/connection-warmed the registry leg → understated cold by ~2x (367 vs the
  unbiased 649 ms). Harness reordered (each library's resolve runs first in its
  process); table replaced with the corrected capture; the biased first capture is
  kept in a "capture note" as a worked example of why single runs mislead.
- Consequence: fastapi is ~1.8x react (1146 vs 649), NOT 3x — causal claim softened to
  "consistent with summed probes; harness cannot decompose per-probe vs host latency;
  #57 must instrument per-probe timing before projecting gains".
- MEDIUM: "largest MEASURED lever" mislabeled the composite-call lever — its magnitude
  is the per-turn cost this engine-side harness deliberately does not measure.
  Relabeled "expected"; section ② now splits measured (tool time) from asserted
  (turn cost) explicitly.
- LOW: warm-win attribution conceded to bundle connection/DNS/TLS reuse with ETag
  (observed 2-10x across runs); #58 implication stated (disk cache recovers only the
  revalidation share).
- LOW: 8-25x arithmetic corrected to ~7-30x (9/1.2=7.5, 9/0.3=30); claude -p proxy for
  the Agent tool explicitly labeled an assertion.
- LOW (scope lens): graceful missing-binary error (friendly hint, exit 1) instead of a
  raw FileNotFoundError traceback.
- New "stable vs noise" section separates structural facts (source-derived) from
  timings (network-dominated, wide same-day spreads).

Children #57/#58/#59 bodies synced to the corrected numbers. 72 Python green.
@kiki830621
kiki830621 merged commit 5933624 into main Jul 5, 2026
2 checks passed
@kiki830621
kiki830621 deleted the idd/56-perf-headroom-local-direct branch July 5, 2026 22:30
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