AI coding agents drive 13-fold throughput gain in modernised Rust consensus engine
A new Rust-based multi-Paxos engine achieves 300,000 operations per second, up from 23,000, by using AI-generated contracts and lightweight spec-driven development to ensure correctness and efficiency.
A developer has engineered a Rust-based multi-Paxos consensus engine that replicates the functionality of Microsoft Azure’s Replicated State Library (RSL) while adapting it for contemporary hardware architectures. The project, comprising over 130,000 lines of code, was developed primarily through the utilisation of AI coding agents, notably Claude Code and Codex. By employing AI-assisted performance optimisation techniques—including zero-copy methods, lock minimisation, and reduced asynchronous overhead—the author reported a significant throughput increase from approximately 23,000 to 300,000 operations per second.
The development process relied on AI-generated code contracts and a lightweight, spec-driven methodology to ensure system correctness. The author noted that AI-generated property-based tests identified a subtle Paxos safety violation prior to production, preventing a potential replication consistency issue. This approach replaced rigid Spec-Driven Development with a more flexible workflow using user stories and acceptance criteria generated via AI, allowing for faster iteration and easier management of complex distributed system logic.
The project timeline spanned approximately three months, with 100,000 lines of code written in four weeks and performance optimisation taking three weeks. The developer utilised a range of AI tools including GitHub Copilot, Claude Code, Codex, Augment Code, Kiro, and Trae, with Claude Code and Codex CLI becoming the primary drivers. The author employs a psychological forcing function by paying $100/month for Anthropic’s max plan to ensure daily usage, alongside a second subscription to handle rate limits for Codex.
Key techniques included the use of AI-generated code contracts and lightweight spec-driven development to ensure correctness and efficiency. Code contracts were used to specify preconditions, postconditions, and invariants, which were converted into runtime asserts during testing. Two of the three original RSL limitations (pipelining and NVM support) have been addressed; RDMA support remains to be determined. The codebase now includes over 1,300 tests, accounting for more than 65% of the total code.
Performance gains were achieved by minimising allocations, applying zero-copy techniques, avoiding locks, and reducing async overhead. The author highlighted that Rust’s safety model made it easy to push these optimizations confidently, peeling back layers of latency without fear of corrupting memory. The project demonstrates that AI coding agents can handle the complexity of production-grade distributed systems when paired with rigorous testing and contract-based verification.
The developer’s workflow evolved to favour asynchronous coding from the CLI, which maximised productivity by creating a seamless flow between human direction and AI execution. While the author retains control over architectural decisions and user story definition, the AI agents handle the bulk of implementation, test generation, and performance tuning. This hybrid approach allows for unprecedented productivity while maintaining the high standards required for critical infrastructure components.
Reflecting on the journey, the author outlined a wish list for the future of AI-assisted coding, including end-to-end user story execution, automated contract workflows, and autonomous performance optimization. The seed of the project is an elegant design markdown authored by Jay Lorch from Microsoft Research, which simplified the implementation of multi-Paxos. The completed engine addresses key gaps in the original RSL, such as the lack of pipelining and NVM support, unlocking significantly lower latency and higher throughput for modern cloud workloads.


