Skip to content

sandbox-cpu: grade provider CPUs — SHA-256 throughput, single + all-core - #522

Closed
HeyGarrison wants to merge 2 commits into
masterfrom
devin/1792438814-sandbox-cpu-bench
Closed

HeyGarrison wants to merge 2 commits into
masterfrom
devin/1792438814-sandbox-cpu-bench

Conversation

@HeyGarrison

@HeyGarrison HeyGarrison commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds sandbox-cpu, a dedicated CPU benchmark that grades each sandbox provider's delivered compute — per market size tier — so composite scores can drive CPU provider selection in the market. Unlike dax (which mixes clone/install/typecheck), this is a pure CPU test: no network, disk, or package installs touch the clock.

Workload (benchmarks/scripts/cpu-benchmark.sh, uploaded via heredoc like dax's):

  • single: dd if=/dev/zero bs=1M count=4096 | sha256sum — per-core speed
  • multi: nproc copies of that pipe in parallel (2 GiB each) — whole-box throughput
  • Emits BENCH_META (cpu model/arch/kernel/logical_cpus/memory), BENCH_PHASE, BENCH_BYTES, BENCH_DONE/BENCH_ERROR; fails rather than substituting a different tool when sha256sum/dd are missing

Per-size grading: the config declares one phases arm per market size — small/medium/large/xlarge, matching PLATFORM_SIZES in benchmarks-platform (lib/sandboxes/sizes.ts) — 3 iterations each. scoring.groupBy: 'phase' produces a composite per size per provider, so a buyer sees "this provider's large is a 90."

benchmarks/sandbox/sizes.ts is rewritten as PROVIDER_SIZE_OPTIONS (provider → tier → options): providers taking raw cpu/memory params scale to all four tiers; template/preset-locked providers (e2b, superserve, novita, codesandbox, arker, declaw, sail, gravixlayer, createos, northflank, upstash) only grade the tiers they can provision — a missing tier fails as size_not_supported instead of substituting a wrong-size box. STANDARD_RESOURCE_OPTIONS is now the derived xlarge layer, byte-identical to the old map, so dax is unaffected (verified).

Scoring: multiCoreMBps 60% (floor 500 / ceiling 20000) + singleCoreMBps 40% (floor 50 / ceiling 3000), per tier × success rate. Create/destroy are timed but unscored steps.

Files: cpu.bench.ts, scripts/cpu-benchmark.sh, sizes.ts rework, cpu.md tech doc, CI workflow (weekly Friday cron + provider/iterations/dry_run dispatch, ~35-provider matrix, same vault pattern as dax), bench:sandbox:cpu script, and a one-line dax refactor to import from sizes.ts.

Verified: tsc --noEmit clean; real e2b dry run — small/medium/large fail as size_not_supported (e2b is template-locked), xlarge succeeds: 213.8 MB/s single, 1915.5 MB/s all-core, vcpus=8, phase: "xlarge" tagged on the record.

Link to Devin session: https://app.devin.ai/sessions/08621fc28d124168920f539e8f9eb771
Open in Devin Desktop: https://app.devin.ai/desktop/session/08621fc28d124168920f539e8f9eb771?variant=devin
Requested by: @HeyGarrison

New benchmark measuring raw CPU inside a fresh sandbox at the standardized
8 vCPU / 16 GiB profile: one dd|sha256sum pipe per phase — single-core speed,
then nproc parallel pipes for whole-box throughput. No network, disk, or
installs on the clock. Composite score = weighted ops/s (multi-core headline,
single-core so weak cores can't hide) x success rate. The per-provider sizing
map moves to sizes.ts, shared with dax; the script reports observed vcpus and
CPU model so under-provisioning shows in results.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

One phases arm per market size (small/medium/large/xlarge, matching
benchmarks-platform PLATFORM_SIZES) with scoring.groupBy='phase', so every
provider gets a composite per tier. Providers taking raw cpu/memory params
scale to all four tiers; template/preset-locked providers grade only the
tiers they can provision — a missing tier fails as size_not_supported
rather than substituting a wrong-size box. The xlarge layer is exported
unchanged as STANDARD_RESOURCE_OPTIONS for dax.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Closing — the benchmark moved to the private suite (computesdk/benchmarks-stealth): stays visibility: private on the platform and is not announced on dotcom. Superseded by https://github.com/computesdk/benchmarks-stealth/pull/10.

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