Skip to content

bench(v0.5.1): real-package pip-install chain spawn numbers#228

Merged
WaylandYang merged 1 commit into
mainfrom
v0.5.1-pip-chain-bench
Jun 5, 2026
Merged

bench(v0.5.1): real-package pip-install chain spawn numbers#228
WaylandYang merged 1 commit into
mainfrom
v0.5.1-pip-chain-bench

Conversation

@WaylandYang
Copy link
Copy Markdown
Contributor

Summary

Follow-up to Phase 5 (`RESULTS-v0.5.md`) now that v0.5.1 closed #218 + #225. Phase 5 had to use stdlib-only Python source deltas because `pip install` hung; this bench drives the actual `numpy → pandas → scikit-learn` chain v0.5 was designed for.

Headline

head depth p50 ms per-link tax
L0 demo-pyt 0 75
L1 +numpy 1 778 +703
L2 +pandas 2 1 229 +451
L3 +sklearn 3 1 700 +471
Flat (compacted) 0 78

10 iters per head, 512 MiB `python:3.12-slim` base. Per-link tax model from Phase 5 confirmed: ~460 ms per link, tracking SHA-256 of the base at ~1.1 GiB/s.

The new data point

`snapshot-compact py-sklearn → py-sklearn-flat` produces a flat snapshot (`parent_tag=None`) that spawns at 78 ms p50 — 22× faster than the depth-3 chain head. So compact really does buy back the chain's per-link tax.

Operational guidance: build with chain, ship with compact. The chain stores lineage compactly while you iterate; compact collapses the per-link tax once the chain stabilizes.

Correctness

Spawn from py-sklearn → `import numpy, pandas, sklearn` → fitted `LinearRegression` runs to completion. Vmstate-drift question stays closed for real PyPI packages.

Closes

n/a — pure benchmark documentation, no code changes.

🤖 Generated with Claude Code

Same harness shape as Phase 5 (bench/chain-spawn/RESULTS-v0.5.md)
but driven against the actual numpy → pandas → scikit-learn chain
that v0.5 was designed for. The Phase 5 bench had to use stdlib-only
Python source deltas because pip install hung on CRNG starvation
(#218); now that #218 + #225 closed in v0.5.1, this is the apples-
to-apples follow-up.

Headline numbers (10 iters per head, 512 MiB python:3.12-slim base):

  head                 depth   p50_ms   per-link tax
  L0 demo-pyt          0        75      —
  L1 +numpy            1       778      +703
  L2 +pandas           2      1229      +451
  L3 +sklearn          3      1700      +471
  Flat (compacted)     0        78      —

Confirms the per-link tax model from Phase 5: ~460 ms per link,
tracking SHA-256 of the 512 MiB base at ~1.1 GiB/s. The big new
data point is the **Flat-equivalent row at 78 ms p50** — produced
by `snapshot-compact py-sklearn → py-sklearn-flat`, which actually
sets parent_tag=None and restores via the historical Phase 1 fast
path. So `forkd snapshot-compact` really does buy back the chain's
per-link tax. 22× faster spawn vs the depth-3 chain head.

Headline operational guidance for v0.5.1 users:

  Build with snapshot-diff chains, ship with snapshot-compact.

The chain stores lineage compactly while you iterate; compact
collapses the per-link tax to zero once the chain stabilizes.

Probe correctness: spawn from py-sklearn, `import numpy, pandas,
sklearn` succeeds and a fitted LinearRegression model runs to
completion. Vmstate-drift question stays closed for real PyPI
packages.

Raw log included at bench/chain-spawn/bench-v0.5.1-pip-chain.log
for reproducibility.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WaylandYang WaylandYang merged commit a5d6546 into main Jun 5, 2026
2 checks passed
@WaylandYang WaylandYang deleted the v0.5.1-pip-chain-bench branch June 5, 2026 05:11
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.

Guest image: ssl.create_default_context() hangs in spawned sandbox (blocks pip)

1 participant