Chunk 3.0

In this chunk, the assistant conducted an exhaustive investigation to plan a pipelined SNARK proving daemon called **cuzk**. The work began by reading all seven prior optimization proposals and background documents to understand the full architecture, then systematically explored every layer of the existing system: the ffiselect child process model for GPU proving, SRS/parameter loading paths across all proof types (PoRep, SnapDeals, WindowPoSt, WinningPoSt), the supraseal C2 C++/CUDA API surface, the bellperson supraseal prover internals, and the circuit sizes and resource profiles for each proof type. The assistant also studied GPU inference engine architectures (vLLM, Triton, TensorRT-LLM) for patterns in model loading, memory management, and scheduling—drawing direct analogies between model weights and SRS parameters, inference requests and proof jobs, and KV cache and witness vectors. Finally, the assistant verified the golden test data in `/data/32gbench/` and explored `lotus-bench simple` commands for generating vanilla proofs for all proof types. The culmination of this research is the **`cuzk-project.md`** document written to the repo root, which lays out a complete architecture and phased implementation plan. The document covers the gRPC API surface (SubmitProof/AwaitProof/Prove/Cancel/GetStatus/PreloadSRS/EvictSRS), a three-tier SRS memory manager (hot/warm/cold) with explicit budget control, a priority-based scheduler with batch accumulation and GPU affinity tracking, and a GPU worker pipeline that evolves from sequential (Phase 0, zero upstream modifications) to fully pipelined (Phase 2+). A testing utility (`cuzk-bench`) is designed with concrete commands for single/batch/stress testing using the existing golden data and `lotus-bench` for vanilla proof generation. The 18-week roadmap progresses from scaffold (SRS residency, +25% throughput) through multi-type scheduling, pipelining, batching, compute optimizations, and finally the pre-compiled constraint evaluator (PCE), with cumulative throughput gains from 1.3x to 10x+. Key themes include pragmatic incrementalism (Phase 0 delivers immediate value with no library changes), inference-engine-inspired resource management, and deep integration with Curio's existing infrastructure and test data.

From Investigation to Architecture: The Design of cuzk, a Pipelined SNARK Proving Daemon 2844 words

Message Articles

Subagent Sessions