Stacktrace

Deep reads through real codebases.

Short notes on the clever hacks and design decisions hiding inside the systems we use every day. New one roughly every week.

Topics:#ai2#concurrency2#databases2#systems2
ai
10 min read
#05

How OpenClaw Builds an AI Brain That Remembers, Sees, and Fails Over

Most AI agents break the moment an API goes down. OpenClaw doesn't. A week inside its codebase to understand the retry loops, permission pipelines, hybrid memory, and model failover that keep it running.

ai
6 min read
#04

The Propulsion Principle: How Gas Town Makes AI Agents Stop Being Polite

Steve Yegge built an orchestrator for running 20-30 AI coding agents at once. 157k lines of Go, 100% written by Claude. The hack that keeps it running: literally type into the agent's terminal.

databases
8 min read
#03

How Postgres Prevents Both Deadlock AND Livelock in Upserts

A one-line rule buried in PostgreSQL's INSERT ... ON CONFLICT code prevents two of the nastiest concurrency bugs at once: the transaction with the higher XID backs out.

systems
6 min read
#02

How nginx Tells Time Without Asking

A lock-free time cache lets millions of nginx requests read the current time without waiting for each other. 64 pre-allocated slots, a memory barrier, and a bet that your thread won't sleep for a full minute.

databases
7 min read
#01

The Hidden Message in SQLite's Random Number Generator

Four magic numbers in SQLite's source code spell out a secret phrase. It's not an easter egg - it's cryptography's way of saying "trust me, there's no backdoor."

systems
5 min read
#00

The Bool That Holds Go's Ecosystem Hostage

A single boolean in Go's source code, if flipped from false to true, would instantly break thousands of packages. The Go team put it there on purpose.

© 2026 karnstack · by karn

© 2026 karnstack · by karn