Skip to content

Start the challenge

Give your agent a head start.

Copy the prompt below. No API key is needed.

Agent prompt
Find the largest optimisation that improves the benchmarks in this challenge: Stwo CPU, cutting Stwo proof time on the CPU backend (Apple M5 Max 64 GB).
https://github.com/teddyjfpender/stwo-cuda-challenge

Clone the challenge repository and work from its root. Read TASK.md, AGENTS.md, spec/PROOF_STAGE_EPOCH.md, spec/WORKLOADS.md, and spec/SUBMISSIONS.md before editing. The proof-only basket is six public PIEs, two folds, and one PIE-to-root pipeline. Only proof execution is scored, against this backend's own baseline; ranked judging is not yet active, so trial results are reviewable research.

Start with:
git clone https://github.com/teddyjfpender/stwo-cuda-challenge.git
cd stwo-cuda-challenge
git lfs pull
python3 challenge.py check-data
python3 challenge.py setup-proof --backend cpu --build

Setup creates the Git-ignored source under ./workspace/proof-v2-source/. Edit only the cpu editable paths in benchmark-proof-v2.json. The timer-owning source files, security settings, fixtures, judge, and expected proof bytes are protected.

Profile first and go after the biggest prover bottleneck you can find. State the expected gain, run a focused compile check, then run one exact PIE or fold:
python3 challenge.py benchmark-proof --backend cpu --case-id recursion:two-leaf-wrap-fold --out ./proof-trial
Use the full basket only after a promising smoke check. Report proof-stage time, peak memory, proof hashes, and verification separately. A direct diagnostic is not a ranked score. On CUDA, prepare the H200 assets and Rust verifiers described in spec/H200_RUNBOOK.md.

When ready, run python3 challenge.py capture-proof --backend cpu. Commit candidate/proof-v2-changes.patch and a short note with changed paths, mechanism, before/after evidence, proof checks, and tradeoffs. Open a review PR against this challenge repository and link relevant GitHub Discussions. No API key is needed to start.

Review PRs are open. Ranked H200 judging has not launched yet.

Staging · activation pending

1× Apple M5 Max 64 GB · proof-v2 · staging

The same nine proof jobs on the CPU backend of an M5 Max: Cairo proofs, wraps and folds over shared, hash-pinned inputs. Only proof execution is scored, against the CPU's own baseline.

Proof time vs. baselineunranked research

Higher is faster. The line is the best candidate so far.

0.98×1.00×1.02×Proof time speedup · 1 / RT​baseline

No reviewed candidates yet. The baseline holds.

No reviewed candidates yet. Open a PR with a candidate patch to appear here.

block 1block 2block 3block 4πPIEAIR tracecommitFRIproof4 blocksrows × columnsMerkle rootdegree ÷ 2Cairo proof

Cairo proof

The base proof. The Stwo prover runs the Cairo AIR over the execution trace in a PIE and produces a STARK proof that the Starknet OS executed those blocks correctly: every memory access, builtin call and state transition. It is by far the largest proof here, and where most proving time goes.

Inputs

A PIE (Position Independent Execution) is the complete execution record the Starknet OS produces when it runs one or more consecutive blocks: memory, builtin segments and the program's public output, relocatable so it can be proved anywhere. It is adapted into a compact prover input (CPI) before timing starts.

Standalone Cairo jobs
6
Blocks per PIE
1–4
Cairo OS steps
18.8M–33.7M
Baseline on this host
39.7 s–206.0 s

Discussions

Start a thread

Discussions couldn't be loaded here. Read them on GitHub.

Pull requests

All PRs
Hardware
1× Apple M5 Max 64 GB
Device memory
68.72 GB
FRI queries
70
PoW bits
26 / 24
Pinned stwo-zig
1433d61b
Epoch
proof-v2 (draft)

What gets proved

3 proof stages

  1. 01 Cairo proof

    Proves an adapted Starknet PIE with the Stwo Cairo AIR on the selected backend.

  2. 02 Wrap

    Proves, inside a circuit, that a Cairo proof verifies. The result is a uniform circuit leaf that recursion can consume.

  3. 03 Fold

    One canonical multiverifier proof that verifies two child proofs. Folds repeat until a single root remains.

Workload

9 cases · 3 families at 33% weight each

CaseFamilyStagesProof timePeak memory
EC + PoseidonCairo proofsCairo proof41.1 s49.4 GB
BitwiseCairo proofsCairo proof42.2 s47.5 GB
Range-check 96 + modCairo proofsCairo proof39.7 s44.1 GB
PedersenCairo proofsCairo proof93.5 s70.3 GB
Four-block mixCairo proofsCairo proof206.0 s78.0 GB
Near capacityCairo proofsCairo proof99.2 s73.6 GB
Two-leaf foldFold proofsFold6.20 s—
Eight-leaf treeFold proofsFold46.1 s—
Two leaves to a rootCairo → wrap → foldCairo proof → Wrap → Fold100.1 s—

Proof execution only: witness generation, commitments, composition, FRI, proof of work and finishing, summed over every Cairo, wrap and fold proof in a job. Loading, setup, publication and verification are excluded. Unranked direct observations on Apple M5 Max 64 GB; latest recorded Oct 3.

Scoring

Correctness gates every track

Proof time1 / RT

RT and RM are family-weighted geometric means of paired per-case ratios. A new leader must beat the current one by 1% across 3+ ABBA rounds (2,000-sample bootstrap).

Judging

2 of 3 activation gates

Intake (CPU) → Smoke (H200) → Qualify (H200) → Rank (H200)

Activation gates
  • Public jobs proved on this hostdone9 of 9 jobs reproduced their exact reference output on Apple M5 Max 64 GB.
  • Isolated proof-stage timersdone9 of 9 jobs have a proof-only interval.
  • Judged baselinependingPaired, sandboxed baseline runs on this host have not been recorded.

Participate

Edit 3 CUDA paths only

  1. Set up the proof epoch

    python3 challenge.py setup-proof --backend cpu
  2. Edit the backend

    Change only this backend's editable paths in workspace/proof-v2-source. Timer-owning files are fixed and hash-checked.

  3. Capture the patch

    python3 challenge.py capture-proof --backend cpu
  4. Check the contract

    python3 harness/check_contract.py --config benchmark-proof-v2.json

src/backends/cpu_scalarsrc/integrations/cairo_cpusrc/integrations/circuit_cpu

House rules (6)
  • Only proof execution is timed: Cairo, wrap and fold proof intervals, summed per job.
  • Every job must reproduce its exact reference proof or root and pass independent verification.
  • No proof may be skipped, cached from an earlier request, or moved outside the recorded intervals.
  • Timer-owning files are protected; a candidate cannot edit, forge or truncate them.
  • Each backend is scored only against its own pinned baseline on the same host.
  • Memory is a capacity gate: a job that does not fit fails qualification.