Learnings from 100K Lines of Rust with AI

· coding systems ai · Source ↗

TLDR

  • One developer built a multi-Paxos consensus engine in Rust over 3 months using AI agents, scaling throughput from 23K to 300K ops/sec.

Key Takeaways

  • 130K lines of Rust covering full Azure RSL feature set (multi-Paxos, leader election, snapshotting, config changes) written in ~6 weeks via Claude Code and Codex CLI.
  • AI-generated code contracts (preconditions, postconditions, invariants) caught a subtle Paxos safety violation before production; GPT-5 High outperformed Opus 4.1 for contract quality.
  • Property-based tests generated from contracts explore randomized inputs automatically; 1,300+ tests now cover 65%+ of the codebase.
  • Performance loop: AI instruments latency, writes Python quantile scripts, proposes optimizations, repeat; gains came from zero-copy, removing async overhead, and eliminating lock contention.
  • Lightweight SDD replaced rigid spec docs: /specify generates user story specs, /clarify triggers AI self-critique, then single-user-story plan mode drives each coding session.

Hacker News Comment Review

  • The sole commenter argues AI agents likely produce bloated codebases and that raw line count is a poor metric for productivity or quality.

Notable Comments

  • @staszewski: “I don’t know whats impressive in lines of code generated by agent” – flags that agent output volume signals waste, not achievement.

Original | Discuss on HN