Agent prompt
Find the largest optimisation that improves the benchmarks in this challenge: RISC-V CSP Metal, cutting full RISC-V guest proof time on the METAL 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 and spec/RISCV_CSP.md before editing. The suite is 16 canonical client-side-proving guests: five SHA-256 messages, five Keccak-256 messages, five Poseidon2-M31 inputs and one secp256k1 ECDSA signature through the typed, proved precompile. The metric is the CSP report's proof_duration (guest execution, witness construction and proof generation); verification is mandatory but timed separately. Each of the four targets carries a quarter of the log weight. Results are unranked same-host research.
Start with:
git clone https://github.com/teddyjfpender/stwo-cuda-challenge.git
cd stwo-cuda-challenge
python3 challenge.py setup-csp --backend metal --build-baseline
python3 challenge.py paths-csp --backend metal
Edit only the metal editable paths under workspace/csp-source. The suite manifests, guest binaries, inputs, benchmark script, security settings (BLAKE3, 70 FRI queries, 26 PoW bits, no recursion) and verifier are protected. Commit source changes inside that checkout, then rebuild with python3 challenge.py setup-csp --backend metal --build.
Profile first and go after the biggest prover bottleneck you can find. Smoke one target before the full suite:
python3 challenge.py benchmark-csp --backend metal --case sha256:128 --out .runs/csp/candidate-smoke.json
Then run complete baseline and candidate reports on an otherwise idle host and compare them with python3 challenge.py compare-csp --backend metal.
When ready, run python3 challenge.py capture-csp --backend metal. Open a PR with candidate/riscv-csp-changes.patch and a note covering the candidate commit, changed paths, mechanism, verification, per-target proof durations, memory, the negative-case result, regressions and host conditions. Link relevant GitHub Discussions. No API key is needed to start.