HeadlinesBriefing favicon HeadlinesBriefing.com

AI wrote 100K lines of Rust to rebuild Azure's consensus engine

Hacker News •
×

A developer spent three months building a Rust-based multi-Paxos consensus engine from scratch, using AI coding agents to reproduce all features of Azure's Replicated State Library. The result: 130K lines of Rust written in roughly four weeks, with throughput climbing from 23K to 300K operations per second on a single laptop. Tools like Claude Code and Codex CLI formed the backbone of the workflow.

Azure's RSL underpins most major Azure services but hasn't kept pace with modern hardware. The new implementation adds pipelining, NVM support, and RDMA awareness — gaps that inflated latency in the original. Testing alone wasn't enough. The developer layered in 1,300+ tests plus runtime code contracts specifying preconditions, postconditions, and invariants on critical functions like process_2a's 16 contracts.

Performance tuning consumed another three weeks with AI as co-pilot, identifying lock contention and redundant allocations. A single AI-generated contract caught a subtle Paxos safety violation before production. Spec-driven development shifted from rigid markdown chains to lightweight user stories via spec kit's /specify command, keeping context manageable for agents.