Archive

1422 posts · Page 6 of 119. ← Blog

Pratik Dhanave · ·5 min read

Latent Diffusion — Why Stable Diffusion Doesn't Diffuse Pixels

The single decision most responsible for putting image generation on consumer GPUs was not a better denoiser or a faster sampler — it was moving the entire diffusion process out of pixel space. Latent diffusion compresses images roughly 48× with a learned autoencoder, runs every denoising step in that compressed space, and decodes once at the end. Same theory as posts 2–5, radically different economics: this is the architecture decision that made Stable Diffusion stable to run.

Stable Diffusion doesn't diffuse pixels. A perceptually-trained autoencoder compresses images ~48×, the entire diffusion apparatus runs unchanged on latents, and a decoder re-synthesizes texture once at the end. The economics, the three-piece architecture, the autoencoder-as-quality-ceiling caveat, and why video inherited the pattern.

Pratik Dhanave · ·4 min read

Reconciliation and Durable Sync — The Backstop That Makes Webhooks Trustworthy

Everything in this series hardened the event path — and post 1's contract still stands: delivery is not guaranteed, eventually. Endpoints stay down past retry horizons, subscriptions get misconfigured, providers have incidents too, and events from before your integration existed never arrive at all. The final discipline accepts this and closes the loop: periodic reconciliation against the source of truth, convergence-oriented sync design, and the backfill machinery that makes "we missed a week" a procedure instead of a crisis. This is what turns a webhook integration into a synchronization system.

Non-delivery is in the contract, so build the backstop: modified-since sweeps through the same version-gated upserts (healing and counting missed deliveries), deliberate deletion detection, and rehearsed resumable backfill. The end state is a sync engine: events for latency, reconciliation for truth, replay for recovery.

Pratik Dhanave · ·4 min read

Migrations as a Capability — Linters, Harnesses, and the Fleet View

One team running one careful migration is craft; an organization running hundreds a month across a fleet of databases is either a capability or a casino. The closing move of this series is the same one the enterprise-AI series made about adoption: stop treating each migration as a bespoke heroic project, and build the machinery that makes the safe way the easy way — linters that catch the outage before review, harnesses that embody posts 2–5 so nobody re-implements them, and automation that watches the fleet so humans watch the exceptions.

Scale migration safety by productizing it: linters that mechanize the failure taxonomy (teaching errors, signed escapes, incident-grown rules), harnesses packaging backfill/verification/cutover declaratively, and a control plane with ladder-climbing automation keeping humans on the novel. Closes the series.

Pratik Dhanave · ·4 min read

Scoring, Thresholds, and the Cost of Errors — Where ML Meets the P&L

A fraud model outputs a probability; the business needs a decision; and the line between them — the threshold — is where machine learning stops and economics begins. Set it by gut and you've made your most consequential business decision by vibes. This post builds the machinery that makes the error trade-off explicit: metrics that survive extreme imbalance, calibration that makes scores mean something, and thresholds derived from costs rather than from tradition.

At 0.1% base rates ROC-AUC flatters; use precision at review capacity and recall at FP budget on time-split, segmented data. Calibration makes scores probabilities; thresholds become cost derivations that move with amount and segment, extended into a ladder across approve, friction, review, and decline.

Pratik Dhanave · ·4 min read

Flakiness — The Operational Disease That Kills Test Signal

A flaky test — same code, different verdicts — is worse than no test: it costs full price, delivers noise, and teaches the team that red means retry. Post 1 did the arithmetic (ten thousand 99.9%-reliable tests ≈ permanent red); this post is the operating system for the disease: detect flakes statistically, quarantine them mechanically, fix them by root-cause class, and prevent the re-infection that follows any one-time cleanup.

Flakiness managed as an operational disease: detected statistically into per-test flake scores, quarantined mechanically (out of the gate, loudly, with fix-or-delete SLAs), fixed by taxonomy — synchronization over sleeps, hermetic isolation, fakes at boundaries — with lint rules and burn-in preventing re-infection.

Pratik Dhanave · ·4 min read

Paved Roads — Turning Tools into a Platform People Choose

A pile of excellent tools is not a developer platform, any more than a pile of excellent services is a product. The organizations that get compounding returns from DevProd all converge on the same packaging: the paved road — a supported, integrated, measurably-better default path through the entire development lifecycle, adopted because it wins rather than because it's mandated. This closing post is the assembly: how the series' pieces become a platform, how adoption actually happens, and how to avoid the paved road's own failure modes.

The paved road packages everything into a platform: scaffolded-on by default, integrated across the lifecycle, maintained by org-loop services — winning by product craft and measured adoption, engineered against rot, prohibition, and irrelevance. Developer platforms compound or decay; there is no steady state. Closes the series.

Pratik Dhanave · ·5 min read

Why Agents Forget — The Context Window Is Not Memory

Every production agent has the same embarrassing failure mode: ask it to continue yesterday's work and it has no idea what you're talking about. The model that reasoned brilliantly for two hours retains nothing of those two hours. This is not a bug to patch but an architecture to build — memory is the system around the model, and designing it well is becoming the distinguishing skill of agent engineering. This series builds agent memory from first principles.

LLMs are stateless, and the context window is working memory — bounded, ephemeral, and unevenly attended — not memory. Forgetting costs re-work, broken user relationships, repeated mistakes, and drift, and no model upgrade fixes it: memory is the system around the model. Opens an 8-post series on building it.

Pratik Dhanave · ·6 min read

The Enterprise AI Adoption Problem

Almost every large organization has run an AI pilot. Far fewer have turned one into something that reliably creates value at scale. The gap between an impressive proof-of-concept and AI woven into how a company actually operates is where most enterprise AI effort quietly dies — and crossing it is a problem of organization, data, and change as much as technology. This series is a playbook for crossing it.

Almost every enterprise has run an AI pilot; far fewer have turned one into value at scale. The gap is mostly organizational, not technical — and crossing it means treating adoption as a repeatable capability, not a series of one-off projects. Opens an 8-post playbook and maps the adoption lifecycle the series walks.

Pratik Dhanave · ·5 min read

Agentic Software Engineering in Go: Specification Engineering

Replacing vague English prompts with precise, machine-readable specifications

Replace prose prompts with machine-readable YAML specifications: typed inputs and outputs, error contracts, acceptance criteria, and versioning. The Go spec parser and validator, the specification lifecycle, and code generation driven from the spec — specification-driven versus English-prompt-driven, side by side.

Pratik Dhanave · ·5 min read

Sampling Faster — DDIM and the Art of Skipping Steps

A thousand network evaluations per image is not a product. The first great act of cost reduction in diffusion was realizing the thousand-step walk could be shortened without retraining anything: the same network, asked smarter questions, gets there in fifty steps — or twenty. This post covers DDIM and the sampler zoo it opened, the step-count economics that made diffusion deployable, and why samplers are the rare component you can swap after training.

DDPM's thousand steps were a property of one sampler, not the trained network. DDIM's deterministic walk follows the probability flow ODE — 50 steps, zero retraining, plus invertible noise-space addresses — and the sampler zoo is just numerical analysis: a ~40× cost cut from math alone, down to the ~10-step curvature floor.

Pratik Dhanave · ·4 min read

Building the Provider Platform — Fan-Out, Endpoint Health, and the Art of Delivering to Strangers

The moment your product offers webhooks, you've signed up to run a delivery platform: fan-out to thousands of endpoints you don't control, operated by teams of wildly varying competence, every one of them capable of being slow, down, or misconfigured — without letting any of them degrade the others or your own system. This post is the provider's view: the architecture, the per-endpoint health machinery, and the policy decisions that separate a webhook feature from a webhook platform.

The provider side: outbox-captured events, per-endpoint filtered fan-out, signed deliveries through contained workers — and per-endpoint isolation so one slow stranger costs only themselves. Endpoint health run actuarially, suspension that warns early and retains for redelivery, and the trust-earning platform short-list.

Pratik Dhanave · ·4 min read

Cross-Store Migrations — Changing Databases Entirely

Same-store migrations reshape a schema; cross-store migrations change the ground itself — relational to document, single-node to distributed, self-hosted to managed, one vendor to another. Every pattern from this series still applies, but the safety nets of a single database — transactions spanning old and new, one replication stream, one consistency model — are gone, and their replacements have to be built. The backbone of those replacements is change data capture: stop writing to two places, start following one.

CDC replaces dual-writes: tail the source log, snapshot-then-stream to convergence while writes never stop. The transform is the risk concentrate; verification compares intended equivalence; cutover gates on lag with a rehearsed seconds-long pause; rollback is a pre-built reverse pipeline. The killer is stalling, not breaking.