Archives
All posts, ordered by most recent.
Simulating the Hail Mary: Centrifugal Gravity & Relativistic Aberration at 0.92c
Interactive browser physics lab for Project Hail Mary: relativistic starfield aberration and blackbody Doppler blueshift at 0.92c alongside tethered spin-gravity Coriolis trajectories.
11 min readNeural Cellular Automata (NCA) in WebGL2: Self-Healing Morphogenesis on the GPU
Bridging Gray-Scott reaction-diffusion with deep learning: Sobel perception stencils, asynchronous stochastic updates, pool-based BPTT in PyTorch, and a live 60 FPS WebGL2 ping-pong FBO simulator.
12 min readTopological Edge States & the Aharonov–Bohm Effect in WebGL2
Simulating a 2D Harper-Hofstadter Chern insulator at 60 FPS: Peierls magnetic flux phases, TKNN Chern numbers, and defect-immune chiral edge wavepackets.
11 min readZero-Bubble Pipeline Parallelism & DualPipe: Overlapping All-to-All with Compute at 671B Scale
How Zero-Bubble B/W backward splitting and DeepSeek-V3's bidirectional DualPipe hide cross-node MoE All-to-All communication and crush pipeline bubbles.
11 min readTerrell–Penrose Rotation: What a 0.99c Flyby Actually Looks Like
Solving the exact retarded light-cone equation in real time to show why a Lorentz-contracted cube flying past at 0.90c visually rotates by arcsin(beta) and exposes its back face.
10 min readWorld Models & Video DiTs: 3D Causal VAEs, Spatiotemporal RoPE & Action-Conditioned Rollouts
From 2D Flow Matching to interactive World Models: 3D Causal VAE temporal padding, factorized 3D RoPE, Diffusion Forcing per-frame noise schedules, and fighting autoregressive drift.
12 min readThe Physics of Glass: Ray-Tracing Real Camera Lenses & Swirly Bokeh in GLSL
Connecting photography optics with ray-tracing: vector Snell's law, Cauchy chromatic dispersion, mechanical cat's-eye vignetting, and why vintage Petzval lenses swirl.
11 min readFrom Features to Circuits: Transcoders, Crosscoders & Attribution Graphs
The mechanistic interpretability sequel to Sparse Autoencoders: replacing dense MLPs with JumpReLU Transcoders, exact input-invariant circuit weights, and Crosscoder model diffing in PyTorch.
12 min readMLS-MPM (Material Point Method) in WebGL2: Snow, Jelly & Elastic-Plastic Fracture
Stepping beyond Eulerian fluid grids into hybrid continuum mechanics: quadratic B-spline P2G/G2P transfers, APIC affine velocity, and SVD snow plasticity at 60 FPS.
11 min readTest-Time Reinforcement Learning & Self-Play Verifiers: Scaling Reasoning Without Human Labels
How TTRL majority-vote RL, Absolute Zero Proposer-Solver code self-play, and Test-Time Self-Play bootstrap reasoning curricula without human-labeled ground truth.
12 min read2D Magnetohydrodynamics (MHD) & Magnetic Reconnection at 60 FPS
Real-time browser resistive MHD simulation of Harris current sheets, Sweet-Parker reconnection, plasmoid magnetic islands, and exact divergence-free flux contours.
11 min readNative Sparse Attention (NSA) & KV-Cache Eviction at 1M+ Context
Hardware-aligned, natively trainable sparse attention: 3-branch gated decomposition (compressed, selected, sliding window), GQA group-shared block loading, and attention-sink eviction mechanics.
12 min readKuramoto Coupled Oscillators & Chimera States on the GPU
Simulating 2D non-local Kuramoto-Sakaguchi oscillators in WebGL2: how identical phase-lagged oscillators spontaneously split into coherent spiral waves and boiling incoherent chimera cores.
10 min read3D Gaussian Splatting from First Principles: EWA Projection, Differentiable Rasterization & Tile Sorting
A practitioner's first-principles guide to 3D Gaussian Splatting: quaternion-scale covariance factorization, EWA Jacobian projection, 16x16 GPU tile radix sorting, and exact reverse-order backward gradients.
13 min readTopological Phase Transitions in Your Browser: The 2D XY Model & BKT Vortex Unbinding via Checkerboard Monte Carlo
How to simulate the 2D XY spin model and Berezinskii–Kosterlitz–Thouless (BKT) topological phase transition at 60 FPS on the GPU: red-black checkerboard Metropolis–Hastings Monte Carlo, plaquette winding numbers, and vortex–antivortex unbinding at T_BKT ≈ 0.893.
12 min readNo Poisson Solver Required: D2Q9 Lattice Boltzmann (BGK) Mesoscopic Fluid Dynamics in WebGL2
How to simulate incompressible fluid dynamics without a global pressure Poisson solver: the D2Q9 Lattice Boltzmann Method (LBM), BGK collision-streaming, Chapman–Enskog recovery of Navier–Stokes, and exact bounce-back no-slip walls in WebGL2.
12 min readTest-Time Training (TTT) & Fast-Weight RNNs: Updating an MLP Hidden State via Gradient Descent on Every Token
A first-principles guide to Test-Time Training (TTT) layers and fast-weight neural memory: replacing linear SSM hidden states with online self-supervised SGD, TTT-Linear vs TTT-MLP, and the parallel mini-batch dual form in PyTorch.
14 min readWriting Fused LLM Kernels in Triton (Liger-Kernel): Eliminating the 128k-Vocab Logits VRAM Cliff
How fused GPU kernels in Triton (Liger-Kernel) cut LLM training VRAM by 80%: chunked FusedLinearCrossEntropy with in-place gradient overwriting, online SRAM log-sum-exp, and FP32 accumulation footguns in PyTorch.
13 min readMasked Diffusion Language Models (MDLM & LLaDA): Breaking the Autoregressive Token-by-Token Bottleneck
A practitioner's guide to discrete absorbing-state diffusion LLMs (MDLM and LLaDA 8B): continuous-time Rao-Blackwellized ELBO, SUBS zero-mask parameterization, low-confidence parallel remasking, and solving the reversal curse in PyTorch.
14 min readKlein Tunneling & Zitterbewegung at 60 FPS: Solving the 2D Relativistic Dirac Equation in Graphene via WebGL2
How to simulate relativistic 2D Dirac fermions and graphene pseudospinors in real time in WebGL2: the Klein paradox (100% barrier transmission), Zitterbewegung trembling motion, and Veselago negative-refraction electron lenses in GLSL.
12 min readSpinodal Decomposition & Ostwald Ripening at 60 FPS: Solving 4th-Order Cahn–Hilliard Biharmonic PDEs in WebGL2
How to solve the fourth-order Cahn–Hilliard phase-field PDE in real time in WebGL2: conserved H^-1 gradient flow, two-pass chemical potential biharmonic splitting, Eyre convex-concave stabilization, Ostwald ripening t^(1/3) coarsening, and hyperuniformity in GLSL.
12 min readDisentangling Polysemantic Superposition: TopK & JumpReLU Sparse Autoencoders (SAEs) and Dead-Latent Resurrection
A first-principles mechanistic interpretability guide to TopK and JumpReLU Sparse Autoencoders (SAEs): eliminating L1 activation shrinkage, Riemannian tangent gradient projection on unit-norm decoders, and AuxK dead-latent revival in PyTorch.
14 min readBeyond AdamW: Matrix Orthogonalization (Muon), Newton–Schulz Iteration & RMS Scale Alignment at 16B+ Scale
A practitioner's first-principles guide to the Muon optimizer and Moonlight scaling laws: 5-step quintic Newton–Schulz matrix orthogonalization in BF16, 0.2*sqrt(max(m,n)) RMS update alignment, and per-head QKV splitting in PyTorch.
14 min readFull-Duplex Speech-to-Speech Systems: Parallel Audio-Text Streams (Moshi), Inner Monologue & WebSocket Barge-In
How to architect sub-200ms full-duplex conversational audio systems: Dual-Stream RQ-Transformers (Moshi), time-aligned Inner Monologue text prefixes, acoustic delay patterns, and WebSocket barge-in KV-cache rollback.
13 min readNegative-Index Metamaterials & Talkbox Waveguides: Solving Yee-Grid FDTD & Formant Tubes at 60 FPS
How to solve Maxwell's curl equations and acoustic talkbox waveguides in real time in WebGL: Kane Yee's staggered FDTD lattice, Auxiliary Differential Equations (ADE) for Drude negative-index metamaterials, Pendry's sub-diffraction superlens, and 1984 11-band talkbox formant transfer functions.
13 min readExtracting Energy from Gargantua: Force-Free Kerr Magnetospheres & Blandford–Znajek Relativistic Jets in WebGL2
How a spinning Kerr black hole powers relativistic astrophysical jets: force-free electrodynamics in Boyer–Lindquist coordinates, the Znajek horizon regularity condition, ergospheric magnetic twist, and 60 FPS WebGL visualization.
13 min readSE(3)-Equivariant Flow Matching on Lie Groups: Geodesic Interpolants & Matrix Exponential Maps (FoldFlow)
A first-principles geometric deep learning guide to Riemannian Conditional Flow Matching on SE(3) and SO(3): Rodrigues matrix exponential and logarithmic maps, geodesic optimal transport, and protein backbone generation in PyTorch.
14 min readOutlier-Free 4-Bit & FP8 LLM Systems: Hadamard Invariance (QuaRot), Stiefel Rotations (SpinQuant) & Blockwise FP8
How orthogonal Walsh–Hadamard rotations (QuaRot), Cayley Stiefel manifold optimization (SpinQuant), and 1x128 blockwise FP8 scaling eliminate Transformer activation outliers and enable lossless W4A4KV4 inference in PyTorch.
15 min readBeyond Length-Biased RL: Online Dr. GRPO, Iterative RPO-DPO & Rubric Verifiers Under ASR Noise
A practitioner's first-principles guide to unbiased verifiable reinforcement learning (Dr. GRPO) and Iterative RPO-DPO under noisy multilingual ASR transcripts: fixing length bias, likelihood collapse, and shotgun-questioning exploits in PyTorch.
14 min readFourier Neural Operators (FNO) vs. PINNs: Zero-Shot Super-Resolution on Navier–Stokes
A first-principles practitioner guide to Fourier Neural Operators (FNO): Banach-space operator learning vs. coordinate PINNs, spectral convolution via rfft2, zero-shot 4x super-resolution on 2D Navier–Stokes turbulence, and cuFFT AMP footguns in PyTorch.
14 min readState Space Duality (SSD) & Hybrid Mamba-2: Sub-Quadratic Sequence Parallelism
A practitioner's first-principles guide to Structured State Space Duality (SSD / Mamba-2) and Ring Attention: 1-semiseparable matrix equivalence, Tensor Core blockwise scans, O(1) recurrent state caching, and hybrid GQA+SSD architectures in PyTorch.
15 min readAutonomous AI Scientists: Recursive Hypothesis Search, Sandboxed Execution & Verifiable Rewards
How to architect an autonomous ML research agent: MCTS over executable git commits, rule-based verifiable rewards (GRPO), AST and causal-leakage verification gates, and distributed spot-GPU experiment orchestration.
13 min readContinuous-Time Audio Flow Matching: Vocal Seed Infilling & Phase Coherence Across Long Tracks
A first-principles guide to Masked Conditional Flow Matching for generative music and voice: preventing acoustic timbre drift, bidirectional master-seed infilling, raised-cosine boundary crossfades, and DiT audio velocity fields in PyTorch.
12 min readSuperfluid Vortices in Your Browser: Solving the Gross–Pitaevskii BEC Equation in WebGL
How to simulate a quantum Bose–Einstein Condensate (BEC) and quantized superfluid vortices in real time in the browser: the Gross–Pitaevskii nonlinear Schrödinger equation, Madelung quantum hydrodynamics, healing length, and BKT vortex-pair dynamics in GLSL.
12 min readWeight-Space Programming on Physics Neural Networks: Can an LLM Read and Write PDE Weights?
Testing Gemini 4 Carbon and Gemini 4 Argon on Weight-Space Programming for Physics-Informed Neural Networks (PINNs): zero-shot PDE weight generation, read-only forensics on neuron-permuted models, and surgical weight patching without gradients.
10 min readSparse Mixture-of-Experts (MoE): Routing Math, Load Balancing & Expert Parallelism
A practitioner's first-principles reference to Sparse Mixture-of-Experts (MoE) LLMs: Top-K gating, Switch auxiliary load-balancing loss, Router z-loss, DeepSeek-V3 auxiliary-loss-free bias routing, and All-to-All Expert Parallelism in PyTorch.
15 min readFlow Matching & Diffusion Transformers (DiT): Continuous-Time Generative Physics
A first-principles physics and ML guide to Flow Matching, Optimal Transport Rectified Flows, Score-SDE equivalence, Logit-Normal timestep sampling, and Diffusion Transformers (DiT) with adaLN-Zero in PyTorch.
15 min readQuantum Tunneling in Your Browser: Solving the 2D Schrödinger Equation in WebGL
How to solve the 2D time-dependent Schrödinger equation in real time in WebGL: Visscher's unitary symplectic leapfrog integrator, complex domain coloring, evanescent barrier tunneling, and Young's double-slit diffraction in GLSL.
11 min readHow the Leopard Got Its Spots at 60 FPS: Gray–Scott Reaction–Diffusion in WebGL
How to simulate Alan Turing's 1952 chemical morphogenesis in real time in the browser: the coupled Gray–Scott reaction–diffusion PDEs, diffusion-driven instability, isotropic 9-point Laplacians in GLSL, and 3D Blinn–Phong normal-mapped coral relief.
10 min readTest-Time Compute & Reasoning Verification: PRMs, MCTS & Search Scaling Laws
A practitioner's first-principles guide to LLM test-time compute scaling: Outcome vs. Process Reward Models (ORM vs. PRM), step-level credit assignment, Best-of-N asymptotics, and Monte Carlo Tree Search (PUCT) in PyTorch.
14 min readLLM Inference & Speculative Decoding: From Roofline Physics to Lossless Acceleration
A first-principles practitioner guide to LLM inference engineering: Roofline memory-bandwidth bounds, Paged KV-Cache mechanics, exact Speculative Decoding rejection sampling proof, and tree-based verification in PyTorch.
14 min readDoes the Totem Fall? Ray-Tracing Inception’s Spinning Top in GLSL
How to simulate and ray-trace Cobb's spinning top totem from Inception in real time: the heavy symmetric top Lagrangian, effective potential U_eff(θ), sleeping-top stability threshold, exact biconical smin SDF, and brushed pewter + 85mm bokeh in GLSL.
10 min readSolving Navier–Stokes at 60 FPS: Stable Fluids & Helmholtz–Hodge Projection in WebGL
How to build a real-time incompressible Navier–Stokes fluid solver in WebGL: Jos Stam's semi-Lagrangian Stable Fluids, Helmholtz–Hodge pressure projection via Jacobi ping-pong FBOs, and von Kármán vortex streets in GLSL.
11 min readAttention Engineering: From MHA to GQA, MLA & FlashAttention
A practitioner's first-principles reference to modern LLM attention: Roofline arithmetic intensity, RoPE & YaRN, GQA, DeepSeek's Multi-Head Latent Attention (MLA) with weight absorption, and FlashAttention-2 online softmax tiling.
14 min readWhen Two Shadows Collide: Ray-Tracing a Binary Black Hole Merger
How to ray-trace an orbiting binary black hole merger in real time: the Majumdar–Papapetrou two-hole metric, Fermat's optical refractive index, figure-eight photon bridges, and eyebrow shadows in GLSL.
11 min readSpinning Up Gargantua: A Real-Time Kerr Black Hole in Your Browser
How to ray-trace a spinning Kerr black hole in real time: Boyer–Lindquist null geodesics in Mino time, Carter's constant, frame dragging, the ergosphere, and Bardeen's D-shaped shadow in GLSL.
11 min readThrough the Wormhole: Rendering a Morris–Thorne Spacetime Bridge
How to ray-trace a traversable Ellis–Bronnikov / Morris–Thorne wormhole in real time: two-sheeted spacetime geodesics, nested Einstein rings, and a seamless 4K 120 fps fly-through loop.
10 min readRendering Gargantua: A Real-Time Black Hole in Your Browser
How to render an Interstellar-style black hole in real time: Schwarzschild null geodesics, a Shakura–Sunyaev disk, Doppler beaming in GLSL, and a seamless 4K 120 fps loop.
11 min readLLM Post-Training: A Practitioner's First-Principles Guide
A deep-dive into the modern post-training stack: SFT, DPO, PPO, GRPO, and Knowledge Distillation with mathematical formulation and PyTorch implementations.
8 min read
Into Inception, Again, Again and Again
A rewatch review of Inception (2010) by Christopher Nolan.
2 min read
Snowpiercer (2013): Movie Review
A movie review of Snowpiercer (2013) by Bong Joon-ho.
3 min readTesting Gemini Omni: Making a Still Bird Fly
A first look at Gemini Omni's image-to-video generation capabilities, evaluating biomechanical motion realism and temporal consistency.
4 min readNo Other Choice (2025): Movie Review
A movie review of No Other Choice (2025) by Park Chan-wook.
3 min read
Project Hail Mary (2026): Movie Review
A movie review of Project Hail Mary (2026) by Phil Lord and Christopher Miller.
3 min readBuilding a Custom Agent Skill: The Semantic Git-Commit Assistant
A hands-on tutorial for building a three-layered local agent skill following progressive disclosure design guidelines to enable clean self-correction loops.
7 min readBuilding a Custom MCP Server: The Port & Process Manager
A hands-on tutorial for building a robust, cross-platform Port and Process Manager MCP server using FastMCP and psutil to reclaim ghost ports.
6 min read
Paprika (2006): Movie Review
A movie review of Paprika (2006) by Satoshi Kon.
3 min readFrom Prompts to Playbooks: Distilling Anthropic’s Guide to Agent Skills
A high-density guide to building portable, production-ready AI playbooks: progressive disclosure, YAML routing, validation boundaries, and evaluation suites.
7 min readBeyond Chatbots: Hard-Won Realities from OpenAI's Agent Guide
A high-density distillation of OpenAI's practical guide to agents: core mental models, production-grade tool design, and guardrail realities.
10 min readThe Future of Video: AI, Anime, and the New Cinema
Exploring how AI video generation will revolutionize cinema, drawing parallels to the anime industry's shift to digital.
4 min readThe "Human" Element in a Generative World
Examining what makes photography distinctly human in an age where AI can generate any image imaginable.
4 min read
Inception (2010): Movie Review
A movie review of Inception (2010) by Christopher Nolan.
3 min readSetup for MCP (Model Context Protocol)
A modern guide to setting up the Model Context Protocol (MCP) for Claude Desktop and Cursor using FastMCP, uvx, and npx.
5 min read
The Thinking Game (2024): Movie Review
A movie review of The Thinking Game (2024) by Greg Kohs.
3 min read
The Unreasonable Realness of Dreams
Pondering how dreams work, how neurons combine memories, and what this means for consciousness and AI.
3 min read
Stalker (1979): Movie Review
A deep dive into Tarkovsky's masterpiece – exploring the philosophical depth, cinematography, and enduring relevance of Stalker.
3 min readPhotos of 2025
A visual journey through the moments in 2025.
📷 0 Photos