A from-scratch LLM inference engine in C++20 that runs Qwen2.5, Llama 3.2 and TinyLlama GGUF models on the CPU in F16 and seven quantized formats, with no dependencies beyond the standard library. Checked against llama.cpp: F16 logits reach 0.99996 cosine similarity and quantized dot products match bit for bit. Q4_0 decode is within 1.19× of llama.cpp at 8 threads.
Full project overview
A from-scratch LLM inference engine in C++20 with no runtime dependencies beyond the C++ standard library and pthreads. It memory-maps GGUF model files and runs Qwen2.5-0.5B-Instruct, Llama-3.2-1B-Instruct and TinyLlama-1.1B-Chat on the CPU in F16 and seven quantized formats (Q8_0, Q4_0, Q5_0, Q5_1, Q4_K, Q5_K and Q6_K, which covers the common Q4_K_M, Q5_K_M and Q6_K files), with its own tokenizers, transformer forward pass, seeded top-k/top-p sampler and a multi-turn `nibble chat` in ChatML, Llama 3 or Zephyr format that keeps the KV cache between turns. The point is correctness, checked against llama.cpp at every level. The three tokenizers match llama.cpp's token IDs exactly on a 37-entry corpus, the quantized dot products match its reference implementation bit for bit (pinned by golden vectors), and 50 end-to-end tests compare every model and format: F16 logits reach a cosine similarity of at least 0.99996, and greedy decoding matches 64/64 tokens on 8 of 9 prompts. Quantized files must reach 0.995 cosine at every position (0.97 for Llama-3.2's k-quants, where llama.cpp's own generic and native builds differ) and 90% top-1 agreement, a gate set at the measured noise floor: nibble, llama.cpp and an fp64 oracle agree to about 0.9966. When cases failed, the cause was F16 rounding in llama.cpp's flash-attention kernel, so the references were regenerated with it off instead of loosening the gate. For speed, the AVX2 and AVX-VNNI versions of the quantized kernels are bit-identical to the scalar code (the float kernels stay within about 1e-6 relative error), and one x86-64 binary picks AVX-VNNI, AVX2 or scalar kernels at startup; a symbol check in CI stops tier-compiled code from leaking into shared code, where it would crash older CPUs. The forward pass allocates nothing per token (enforced by a test), a spin-then-futex thread pool cut dispatch latency 81x to 171x, and a tiled GEMM handles prompts. Measured against llama.cpp b11715 in paired A/B/B/A runs on one WSL2 laptop, Qwen2.5-0.5B Q4_0 decode at 8 threads is 1.19x slower (the target was within 1.5x) and Q8_0 prompt processing about 2x faster; the tiles cut single-thread k-quant prompt processing on Llama-3.2-1B and TinyLlama-1.1B from 4.0x to 4.7x slower than llama.cpp to 2.3x to 2.6x (2.5x to 3.2x at 8 threads). The GGUF parser is bounds-checked, overflow-checked and fuzzed with two libFuzzer targets. 304 unit and integration tests run at 94.8% line coverage on GitHub Actions with gcc and clang builds, ASan/UBSan, TSan, fuzzing and clang-tidy, and a release workflow reruns the suite on the tag. Released as v0.8.0: a `linux-x86_64` tarball and a container image on ghcr.io. The SIMD kernels are x86-64 only, and there is no GPU backend yet. MIT licensed.
A configurable computer-vision pipeline with 15 features, four swappable face detectors, and independently optional model backends. Held-out evaluation rejected race fusion: 63.3% versus the best model's 76.5% on 1,002 FairFace test faces. Missing backends degrade gracefully; detection needs any one of the four detectors.
Full project overview
Real-time face analysis in Streamlit: 15 features (age, gender, race, emotion, gaze, liveness, recognition, and more) over four swappable face detectors, with up to four interchangeable backends per core attribute running side by side. Emotion backends combine votes after reconciling label taxonomies; age, gender, and race name their most reliable available model instead. Race fusion was rejected after scoring 63.3% against the best model's 76.5% on 1,002 held-out FairFace test faces from a 2,000-image sample, with 95% bootstrap intervals. A learned logistic-regression stacker did not beat the best single model beyond noise for any of the three attributes, so none ships. A public demo on Streamlit Community Cloud runs a CPU-only model set; aligning face crops on the detector’s own landmarks fixed its misgendered faces, raising held-out gender accuracy from 88.1% to 92.2% and race from 61.1% to 76.0%. An installable package with a config-driven, stage-based pipeline, split from a 3,167-line module and guarded by a golden characterization test that pins every model prediction, with 386 tests, lint and format checks in CI on Python 3.11 and 3.12.
A multi-model computer-vision application, deployable natively or via Docker.
Graceful degradation as an architecture, not an afterthought:The core attributes have multiple selectable backends — four each for age, gender, and emotion, two for race and for recognition — and every model is independently optional. If a model’s files or framework dependency are missing at runtime, including an unpulled git-lfs pointer file, that backend is skipped and listed as offline rather than crashing the app. Face detection is the one required feature, and any one detector is enough: SSD/ResNet-10 via cv2.dnn, YOLOv8-Face, SCRFD, or RetinaFace MobileNet0.25 (all three ONNX), with a fallback to SSD and then to whichever detector loaded.
Fusion decided by evidence, not by instinct:The 2,000-image FairFace validation sample is split into 998 fit images and 1,002 held-out test images; all reported accuracies use the test half, with 95% bootstrap confidence intervals. Previous equal-weight race fusion scored 63.3%, fitted fusion 70.1%, and the FairFace backend alone 76.5% — DeepFace’s near one-hot probabilities dominated the blend, so race switched to best-model selection. Age-fusion strategies likewise scored at or below the best single model. Age, gender, and race now name their most reliable model; the former gender fusion was dominated by MiVOLO’s hard prediction and could not overrule it except at an exact tie, so it was not evidence of a gain over MiVOLO alone. A learned logistic-regression stacker over every backend’s outputs was fitted on the fit half and scored on the test half. No attribute’s paired-bootstrap 95% interval for improvement over the shipped answer lay above zero, so none of the stackers ships. On 1,500 UTKFace faces, out of distribution for the FairFace-based comparisons, MiVOLO kept its lead (67.5% bucket accuracy, 3.7-year mean absolute error), and a ConvNeXt-Tiny age model fine-tuned on FairFace on a Kaggle GPU trailed it by 8.7 points, so it was not shipped either. Emotion still uses canonical weighted voting.
Reconciling label taxonomies before combining votes:Backends disagree on label sets before anything can be combined or compared: emotion fusion counts happy and happiness as one vote rather than two, and FairFace’s separate East and Southeast Asian categories collapse into one canonical Asian class when race backends are scored against each other.
A public demo, and the bug it surfaced:The demo on Streamlit Community Cloud loads only permissively licensed, CPU-only models with RetinaFace detection, analyses one upload at a time, caps upload size, and processes images in memory without storing them. Its first run misgendered both women in the sample photo: without MediaPipe, FairFace received an unaligned box crop. Aligning on RetinaFace’s own five landmarks (near-profile faces keep the box crop) raised held-out accuracy on the same 1,002 test faces from 88.1% to 92.2% for gender, 61.1% to 76.0% for race, and 46.3% to 59.4% for age buckets. Visitors can analyse a public-domain NASA sample photo and save any face’s result card as a PNG.
Performance:Per-face classifier results are cached with LRU eviction at 2048 entries, keyed on a hash of the exact preprocessed input bytes — sound because identical bytes always produce identical deterministic output. In webcam live mode a classifier frame-skip control runs the heavier classifiers every Nth frame while detection and overlays stay real-time on every frame.
Docker:Single-stage build with per-feature build args (AGE_MODEL, GENDER_MODEL, and so on, each a comma-separated list of model keys). Model weights are fetched on demand by tools/fetch_models.py and checked against the manifest's SHA-256 hashes; Git LFS is no longer required. The Docker build downloads only the selected weights plus the required SSD detector, rather than copying a local weight directory into the image. Bring-your-own models remain unavailable until their files are provided. torch and tensorflow are installed only if a selected feature needs them.
Feature range:Age, gender, race, and emotion classifiers; gaze direction and face/hand landmarks via MediaPipe; glasses and mask detection; colorization (Zhang et al., ECCV16); face recognition by VGGFace embedding with cosine similarity, and an OpenCV LBPH backend that trains from scratch on enrolled photos with no pretrained weights; identity search against bundled local reference photos; SQLite-backed save with a sparse schema plus PCA/eigenfaces search retrained per query; 3D face reconstruction to an .obj mesh; age progression and regression; liveness and anti-spoofing via blink-transition tracking and high-frequency texture scoring; voice-and-face fusion comparing mic RMS energy against detected emotion arousal; and eleven Lightroom-style image adjustments applied at two independent points in the pipeline.
Honest about what is heuristic:Eye colour is a colorimetric heuristic — median-HSV bucketing, not ML — and the README documents it as lower-accuracy than the model-backed attributes rather than presenting it alongside them as an equal. Hair colour, built the same way, was removed once it proved inaccurate. Crowd count and demographics are opt-in and off by default, explicitly flagged for privacy.
Engineering and testing:An installable face_analyzer package. analyze_frame(models, frame, config) takes a single AnalysisConfig and runs as a sequence of stage helpers, and the Streamlit UI is split into theme, sidebar, results, and live-webcam modules, with live state kept per session. A golden characterization test snapshots every prediction for a public-domain NASA crew photo (6 faces, 9 backends). 386 pytest tests, including Streamlit AppTest smoke tests that boot the real app, plus ruff lint and format checks, run in GitHub Actions on Python 3.11 and 3.12. CI downloads only the required SSD detector (3 MB); tests requiring absent optional model weights skip rather than implying those predictions were exercised.
Supply chain:Every weight file is SHA-256-verified against the manifest, every GitHub Action is pinned to a commit SHA, gitleaks scans each commit for secrets, and Dependabot proposes weekly updates with two documented holds: OpenCV stays on 4.x because OpenCV 5 removed the Caffe importer three model families use, and the Docker base stays on Python 3.11 to match CI and the optional framework pins. When the glasses model’s upstream repository was deleted, it became bring-your-own rather than silently re-hosted, and a weekly CI job now checks that every model download link still resolves.
Licensing audit:MODEL_LICENSES.md documents per-model licence provenance individually, with the upstream source checked for each — MIT, Apache-2.0, research-and-educational-only, non-commercial CC BY-NC-SA, or unstated — rather than one blanket note. Age progression is flagged non-commercial because a required architecture component, BlurPool vendored from Adobe’s antialiased-cnns, is CC BY-NC-SA, not merely because of the training data.
3D reconstruction, verified end to end:Deep3DFaceRecon_pytorch (ResNet50 plus the Basel Face Model) was verified against the real upstream checkpoint and real BFM data rather than synthetic weights, producing a valid 35,709-vertex mesh.
Scope & limitations
Both race backends were trained on FairFace's training split, so the held-out race results are in-distribution; MiVOLO's training data is not published, so overlap with FairFace cannot be ruled out.
Age is scored in nine buckets, not as error in years. FairFace's labels are perceived attributes, not verified identity; emotion is not evaluated because the dataset has no emotion labels.
Ships with no working 3D weights out of the box, because both required files are gated behind Google Drive links and university licence registration.
3D reconstruction stops at mesh export with no rendering, because upstream’s renderer is GPU-only and this repository is CPU-only by design.
The glasses detector ships with no default weights since its upstream repository was deleted; users supply the file themselves.
Twenty-six puzzles and games, plus nine algorithm labs, connecting search, exact methods, and learned guidance. A TD-learned n-tuple network reaches 2048 in 88.1% of 3,000 held-out games without search; a neural 15-puzzle heuristic expands about 120× fewer nodes on 40 puzzles, with paths 3.3% longer on average.
Full project overview
Twenty-six puzzles and games solved by search, exact methods, and learned guidance, plus nine separate algorithm labs, served by a FastAPI backend that streams live searches over WebSocket. On 40 random 15-puzzles, a neural heuristic trained on a 5-5-5 pattern database expands about 120× fewer nodes than optimal IDA* with that same database (paths 3.3% longer on average). A TD-learned n-tuple network reaches the 2048 tile in 88.1% of 3,000 held-out games with no search. Sudoku constraint propagation averages 7 guesses, against 364 for MRV with forward checking. Battleship's Bayesian targeting averages 45.9 shots to sink a random fleet, against 51.9 for hunt/target. A Snake evaluation function with eight weights tuned by the cross-entropy method averages 90.1 apples on held-out boards, against 56.1 for a BFS planner. An AlphaZero-style network trained only by self-play scores 77% against depth-4 alpha-beta at Connect Four over 50 games (44% against depth 6). Approximate Q-learning wins 64.2% of 400 Pac-Man games on two mazes, up from 5% without its survival-lookahead feature. Leduc poker's CFR+ strategy has exact exploitability of 0.05 milli-big-blinds per hand in the six-card game. Models are exported to NumPy so the 1 GB server runs without PyTorch.
Each entry has its own mechanism in Search Agents. The labs are separate playgrounds, not additional games. Open the live demo above to interact with them; this portfolio does not reimplement them.
Puzzles & games
N-Puzzle
Classic search, pattern databases, and a neural cost-to-go heuristic trained by approximate value iteration.
Connect Four
Alpha-beta negamax, UCT, and AlphaZero-style PUCT with a self-play policy-value ResNet.
Checkers
Minimax versus iterative-deepening alpha-beta, with transposition tables and move ordering.
Battleship
Bayesian fleet-layout probabilities, using exact enumeration or importance sampling, compared with hunt/target.
Blackjack
Exact dynamic programming for the infinite-deck model, alongside Monte Carlo control.
Route planner
Nearest neighbour and 2-opt, Held-Karp up to 12 cities, simulated annealing, and a genetic algorithm.
2048
Expectimax with tuned hand-crafted features and a TD(0) afterstate n-tuple network.
Sudoku
Backtracking, MRV with forward checking, and naked/hidden-single constraint propagation.
Lights Out
Exact Gaussian elimination over GF(2); the null space enumerates solutions and identifies the lightest.
Endgame tablebases
Retrograde analysis computes exact distances to mate for king-and-queen or king-and-rook endgames.
Sokoban
Push-space search with admissible goal bounds, Hungarian box-to-goal matching, and deadlock pruning.
Pac-Man
Approximate Q-learning over 13 features, including survival lookahead, against A*-routed ghost personalities.
Warehouse robots
Independent A*, prioritized planning, and Conflict-Based Search with space-time A* replanning.
Wordle
Exact feedback-bucket entropy and minimax scoring, compared with random consistent guesses.
Poker
Leduc hold'em self-play with CFR/CFR+, evaluated by exact best response and exploitability.
Minesweeper
Frontier constraint components counted by memoized backtracking, weighted by the global mine count.
Hex
Monte Carlo tree search with RAVE, compared with shortest-path and random baselines.
Bandits
Greedy, epsilon-greedy, UCB1, Thompson sampling, EXP3, and sliding-window UCB under drifting payouts.
CartPole
Pure-NumPy REINFORCE and actor-critic, cross-entropy policy search, and a hand-tuned PD baseline.
N-Queens
Bitmask backtracking, hill climbing with restarts, simulated annealing, and min-conflicts.
Snake
Cross-entropy-tuned evaluation weights and an evolved neural policy, compared with a safety-checked BFS planner.
Rover
D* Lite incrementally repairs paths as a sensor discovers walls, compared with A* replanned from scratch.
Ghost Hunt
Exact HMM forward filtering, particle-filter approximation, and Viterbi reconstruction from noisy sonar.
Lost Robot
Histogram Bayes filtering versus Monte Carlo localisation with systematic resampling and kidnap recovery.
Tetris
Placement search across rotations and columns, with nine board features and cross-entropy weight tuning.
Nonogram
Automaton-reachability line solving followed by DPLL SAT or guess-and-propagate search, with uniqueness checks.
Algorithm labs
Cluster lab
k-means with k-means++ starts, DBSCAN, and Gaussian-mixture EM over points the visitor paints.
Neural net lab
A NumPy MLP with hand-written backpropagation and Adam/SGD; browser/Python parity tests.
Pathfinding arena
Classic searches race weighted maps, checked against Bellman-Ford and the weighted-A* bound.
Gridworld MDP
Value and policy iteration, tabular Q-learning, and SARSA on a slippery grid.
Optimizer race
Gradient descent, momentum, Nesterov, RMSProp, Adam, and AdaGrad on shared loss landscapes.
Tree lab
CART splitting and cost-complexity pruning, plus bagged forests with out-of-bag scoring.
Markov text
Order-n counts, add-alpha smoothing, temperature, held-out perplexity, and source-copy measurement.
Regression
Normal equations versus Householder QR, ridge penalties, gradient descent, and logistic regression.
Evolving walkers
Genetic evolution of soft-body creatures with NEAT-style speciation and graph mutation.
An encoder-decoder from PyTorch primitives, extended into controlled experiments on four positional encodings. Models train on copy and reverse up to length 16 and test through 48 across three seeds. Every encoding reaches 0% exact match by length 24; inspect the results, attention maps, and KV-cache benchmarks in the study.
Full project overview
The full “Attention Is All You Need” encoder-decoder built from PyTorch primitives, extended into a small-scale replication of Kazemnejad et al. (NeurIPS 2023): decoder-only models with no positional encoding, sinusoidal, RoPE, and ALiBi, trained on copy and reverse at lengths up to 16 and evaluated at every length to 48, with attention-head heatmaps showing where generalization breaks down. Across 3 seeds, every encoding fell to 0% exact match by length 24; RoPE broke first (100% to 25% on copy one token past training), while NoPE, with no positional encoding at all, held on longest (87% on reverse two tokens past training) despite being the weakest model on reverse inside the training range. A KV cache speeds up batched generation by up to 20× with output identical to uncached decoding, and a 79-test pytest suite checks the attention numerically against PyTorch’s built-in implementation. The encoder-decoder is my own AI-course assignment; the study extends it from a design spec that set a 95% in-distribution bar before any training; when one configuration missed it at 3,000 steps, all 24 runs were retrained at 5,000 and the change disclosed. CI runs ruff and the suite on GitHub Actions with SHA-pinned actions and Dependabot, with pre-commit hooks for gitleaks, ruff and typos. MIT licensed.
Built from scratch in PyTorch: the encoder-decoder as my own AI-course assignment, the study on top of it with Claude Code.
Scaled dot-product multi-head attention, sinusoidal positional encoding, causal and padding masks, token embeddings scaled by √d_model, and autoregressive greedy decoding.
Independently configurable encoder and decoder stacks linked via cross-attention, where decoder queries attend to encoder key and value projections, with residual connections and layer normalization after every sub-layer.
Extended into a decoder-only model with a selectable positional encoding (none, sinusoidal, RoPE, or ALiBi) and a KV cache, trained with AdamW, warmup and cosine decay on copy and reverse tasks, with the loss on answer tokens only.
A 79-test pytest suite checks the attention numerically against PyTorch’s scaled_dot_product_attention and nn.MultiheadAttention, that source padding leaves outputs unchanged, that every encoding is causal, and that cached generation matches uncached generation. CI runs ruff and the suite on GitHub Actions with SHA-pinned actions and Dependabot, and pre-commit hooks run gitleaks, ruff and typos.
The study follows a design spec that set the bar before any training (every configuration at 95%+ in-distribution exact match, with any miss reported) and project rules requiring every README number to come from generated results; when NoPE on reverse averaged 94.7% at 3,000 steps, all 24 runs were retrained at 5,000 steps and the change disclosed.
Separately rewritten in vanilla JavaScript with manual backpropagation for the AI Projects web app.
Source: cv.md, Transformer Positional-Encoding Study; transformer/README.md, docs/specs/2026-10-07-length-generalization-design.md and .github/workflows/tests.yml
DDPM and DDIM sampling from PyTorch primitives, with a conditioned U-Net and an interactive denoising demo. On 1,000 MNIST samples, 50-step DDIM matches 1,000-step DDPM's 99.9% classifier accuracy while sampling 18–21× faster. Evaluation uses dataset-specific CNN features, not a directly comparable published FID benchmark.
Full project overview
A class-conditional denoising diffusion model (DDPM) built from PyTorch primitives, with classifier-free guidance and DDIM sampling, trained on a laptop CPU using data-parallel single-threaded workers. On MNIST, 50-step DDIM matches 1000-step DDPM’s 99.9% class accuracy at a lower FID (19.0 vs 28.0 over 1,000 samples, measured in a dataset-specific classifier’s feature space) while sampling 18–21× faster. An η ablation shows the gap comes from DDPM’s injected noise, and the results replicate on FashionMNIST. A noise-schedule ablation trained on a Kaggle GPU (7.5 minutes vs about 3 hours on the CPU) shows a cosine schedule cuts guided 20-step DDIM FID from 17.2 to 9.5 against a matched linear baseline but hurts unguided samples; a guidance-weight sweep shows the fidelity–diversity trade-off, and 2D toy distributions show where few-step DDIM breaks down. An interactive demo of both datasets runs on GitHub Pages, and a clone can sample live through a local FastAPI server using the bundled 1.7 MB weights, with no training needed. A 65-test suite (57 Python, 8 for the web UI) verifies the sampler math, including that DDIM with η = 1 reproduces the DDPM posterior step. Every GitHub Action is pinned to a commit SHA and kept current by Dependabot, and pre-commit hooks run gitleaks, ruff and typos.
Written from scratch in PyTorch, with no diffusers or other diffusion libraries, and trained entirely on a laptop CPU.
The model and its training:A linear or cosine noise schedule over 1,000 timesteps with the closed-form forward process; a 0.42M-parameter noise-prediction UNet (28→14→7, ResBlocks with GroupNorm, attention at 7×7, sinusoidal time and learned class embeddings); ε-prediction MSE with 10% label dropout so one network learns both the conditional and unconditional model; EMA weights; data-parallel training over single-threaded torchrun workers, which scale better on a shared CPU than intra-op threads.
Samplers:Ancestral DDPM from the true posterior, and DDIM at any step count with η from 0 to 1. Classifier-free guidance batches the conditional and null-label passes into one forward call. A test checks that DDIM with η = 1 and consecutive steps reproduces the DDPM posterior step.
Why DDIM beats DDPM here: the noise, not the step count:At a fixed 50 steps, turning DDIM’s stochasticity back on walks FID from 19.0 (η = 0) to 30.1 (η = 1), back to DDPM’s 28.0. At 10 steps full stochasticity hurts badly (FID 36.4), because each large step injects noise the model has too few steps left to remove.
Guidance trades diversity for fidelity:On MNIST with 50-step DDIM, w = 1 (the plain conditional model) gives the best FID, 8.5, at 92.7% class accuracy; w = 2 reaches 99.9% at FID 19.0; past that, samples stay on-class while FID climbs as variety collapses (45.4 at w = 3, 79.0 at w = 5).
Cosine vs linear noise schedule:Two MNIST models differing only in the schedule, trained with the same UNet, optimizer, batch size and 15,351 steps on a Kaggle T4 GPU (about 7.5 minutes each, against about 3 hours on the laptop CPU). With guidance w = 2 the cosine schedule cut DDIM FID by 32–45% at every step count (20 steps: 17.2 → 9.5), but roughly doubled FID for the plain conditional model at w = 1 (9.5 → 18.8). Because sampling noise is drawn on the CPU from fixed seeds, re-scoring the CPU-trained model on the GPU reproduced every number to within 0.0003.
One interface, two backends:The same vanilla-JS page serves precomputed samples on GitHub Pages, where every slider setting starts from the same noise, and live sampling through a local FastAPI server on one CPU thread with requests serialized and cancelled when the client disconnects.
Scope & limitations
FID and KID use the 64-d features of a small CNN trained on each dataset, not Inception-v3, so they compare only within this project and at equal sample size (N = 1,000 per config), never with published FIDs.
Wall-clock speedups were measured on a laptop running other jobs; the step ratio (exactly 20× for DDIM 50) is the load-independent measure.
28×28 grayscale datasets only (MNIST and FashionMNIST), plus 2D toy distributions.
Source: cv.md, Diffusion from Scratch; diffusion-from-scratch/README.md and NOTES.md
Python / JavaScriptEinstein ChatPreparing for publication
An Einstein chat agent for my Designing LLM Agents class: hybrid retrieval from his writings, separate content and voice modules, and guardrails for his historical knowledge.
Full project overview
A conversational agent that answers as Albert Einstein, built for my Designing LLM Agents class. A FastAPI backend combines local embedding and keyword retrieval with separate evidence-grounded content planning and voice generation. A fast historical filter and an LLM scope classifier check questions against a knowledge cutoff of 18 April 1955; guardrail failures block unchecked replies. The React frontend supports conversation folders, favorites, editing, rewinding and branching, with conversations stored as JSON.
An interactive React and TypeScript application for exploring machine learning and AI algorithms. Adjust parameters, run models through a Python/FastAPI backend, and inspect charts and model outputs. The interface covers regression, classification, clustering and PCA, alongside neural networks, natural language processing, computer vision, reinforcement learning and classical search.
A C++20 engine replays 5.1M real NVDA quotes in 1.3 s against 111.5 s in Python, held bit-identical by parity tests. ML models and a 16-configuration PPO search on Kaggle GPUs are judged against holding the same stocks; the best agent made +51.9% while holding made +97.2%. Two Alpaca paper bots run daily; real money stays locked behind statistical qualification and 30 paper sessions.
Full project overview
A stock-trading system built to answer one question honestly: can any strategy beat simply holding the same stocks, after costs, on data it never saw? At its center is a C++20 market-data and decision engine that parses Alpaca JSON with simdjson, builds causal 5-second bars, and computes features and rule signals. Parity tests hold it bit-identical to the Python reference, down to matching CPython’s compensated float summation. It replays a real 5.1M-quote NVDA session in 1.3 s, against 111.5 s in Python. Replacing a node-based string hash set with an allocation-free 128-bit open-addressing set cut p50 tick-to-decision latency from 72 to 12.7 µs. A Nasdaq TotalView-ITCH 5.0 parser and full-depth limit order book, also in C++20, rebuild a real trading day of 368 million messages with zero unknown references, overfills or malformed messages, and match a Python reference exactly on the first 50 million. Against goals set before measuring, parsing takes 18–21.5 ns per message on one core and peak memory is 0.17 GiB, while the full book's 321–444 ns misses its 120 ns goal and is next to be profiled. The research side trains models on 67 million one-minute bars and 335,000 news headlines from 2016 to 2026: LightGBM and MLP stock pickers, CNN, GRU and transformer models that time trades within the day, and news features from fixed patterns and a 2019 FinBERT, chosen so no model could have read about later prices. 108 variants trained on Kaggle T4 GPUs. A pre-registered reinforcement-learning search followed: 16 PPO configurations on a GPU environment that steps 4,096 episodes at once and is parity-tested against the fill simulator, with differential-Sharpe rewards, costs randomized from 1x to 3x and three-seed ensembles. The best agent made +51.9% over 2023–2024 (Sharpe 1.93), while holding the same stocks made +97.2%; its deflated Sharpe over 124 trials was 0.54. Every strategy test is pre-registered in git before any result is computed, ten so far, and judged with date-clustered bootstrap intervals, Bonferroni correction, 3x-cost stress tests and a one-time final-test registry. None beat holding after costs, so real money stays locked in code behind statistical qualification and 30 paper sessions. Python runs the money side: two Alpaca paper-trading bots on a multi-stock runner with per-stock budgets, Decimal ledgers, loss and drawdown guards, and broker reconciliation that fails closed, watched by cron and by a GitHub Actions job that emails on any missed trading day. Live sessions surfaced bugs the tests had missed, each fixed with a regression test: an opening-burst backlog that shut a stock out for the day, per-fill cent rounding that tripped cash reconciliation, regulatory fees posted at 3 a.m., and limit-on-close orders the paper broker silently expired.
Tests 66 candlestick patterns across 117 stocks and ETFs, on 1,021,358 one-minute trades and 227,879 higher-timeframe trades, with matched random controls, clustered bootstrap, multiple-testing correction, and a chronological holdout. Synthetic-market calibration exposes and fixes inference bias. No pattern beats random entry at any tested timeframe, even before costs.
Full project overview
Tests whether 66 classic candlestick patterns have a real intraday edge, on two years of 1-minute bars for 117 US stocks and ETFs (1,021,358 pattern trades), then repeated at 5-minute, 15-minute and 1-hour bars (227,879 more). Each trade is charged the NBBO spread quoted at that time of day and paired with a stop-matched random entry. Inference uses a market-date clustered bootstrap, Holm correction and a chronological holdout. Running the method on a synthetic random walk exposed two biases in it: comparing in net R rewarded wide stops, and controls placed before their pattern inherited the pattern’s selection. Fixing both cut false positives from 38 in 800 to 1, the rate a 5% familywise error predicts. Planting edges of known size measured detection power: a 0.10R advantage over random entry is caught 88% of the time, so “no edge” comes with a size. Calibration and power held on markets with clustered volatility (4 of 80 noise-only markets had a false positive, the 5% bound), and the limits reported for rare patterns proved accurate. Result: no pattern beats random entry at any timeframe, even before costs. The same test runs on any signal a user writes: its test command measures a detector of their own against matched random entries and states how large an edge a null result rules out. It is published on PyPI. The dashboard exports as a server-free static site, held to identical answers by a parity test against the dashboard server, and a read-only public server runs it on a synthetic market generated at startup. The trade walk runs in an optional C++ extension (pybind11) that simulates trades and their controls 4–5× faster, held bit-identical to the Python engine by a parity test and by a record of the trades the engine made before the port. Releases are built by CI for Linux, macOS and Windows, and each of the 16 wheels must reproduce that record bit for bit on its own platform before it is published. Keeping trades as columns instead of objects cut a 1,600-trial run’s peak memory from 1.38 to 0.92 GB, with results unchanged. About 1,500 tests, including headless-Chromium browser tests. Every GitHub Action is pinned to a commit SHA, Dependabot keeps dependencies current, and a gitleaks pre-commit hook blocks secrets.
A command-line tool that runs the real git but shows what a command will do first and lets you undo it after. A snapshot of refs, index, files, stashes and in-progress merges makes `gitwhy undo` recover from `git reset --hard` and `git clean -fdx`, and previews report merge conflicts before they happen.
Full project overview
A command-line tool in Go that runs the real `git` but shows what a command will do before it runs and lets you undo it afterward. Previews use git’s own dry runs and `git merge-tree`, so merge, rebase, cherry-pick and revert conflicts are reported before they happen; every command is broken into plain-English parts, and a table of danger rules warns before commands that lose work or rewrite shared history, with the prompt defaulting to No when a warning was shown. Before a command runs, an undo engine saves every ref, the index, tracked and untracked files (as one git commit whose parents and refs keep everything reachable, so `git gc` cannot remove it), stashes, sparse-checkout settings and any merge, rebase, cherry-pick, revert or bisect in progress. `gitwhy undo` then recovers from `git reset --hard` and `git clean -fdx`. It restores a ref only if it is still where the command left it, so later work is never overwritten and skipped refs are listed; it checks that everything it needs exists before touching anything, saves its own pre-undo state so an undo can be undone, and runs nothing at all if the snapshot fails. 61 hand-written YAML recipes ("move my last commit to a new branch") pass each answer to git as its own argument, never through a shell, and refuse an answer git would read as an option, and docs for 181 git commands and about 2,700 flags are embedded in the binary, so it works offline with no AI, account or network. A Bubble Tea full-screen home offers hunk- and line-level staging and a commit graph, a bash/zsh hook makes plain `git` commands undoable while always running the real git and keeping its exit code, and `gitwhy recover` reads reflogs to find lost commits. Tested with real git in temporary repositories instead of mocks (205 test functions, 55 of them end-to-end tests of the built binary); a whole-repo review found about 40 defects across undo, previews, the hook, the TUI and recipes, each fixed with a reproducing test. Released as v0.9.4 through a CI/CD pipeline with every GitHub Action pinned to a commit SHA, `govulncheck`, CodeQL code scanning, and Linux and Windows tests: GoReleaser builds Linux, macOS and Windows binaries (amd64 and arm64) and packages published to Homebrew, Scoop, npm (with provenance), a Nix flake, and GPG-signed apt and dnf repositories on GitHub Pages. The `curl` and PowerShell installers verify a SHA-256 checksum, and a post-release workflow installs every channel on real operating systems.
Ctrl-Z for the terminal and for AI coding agents. It snapshots a project into a private git repository after every shell prompt and before every Claude Code tool call, so `undo` brings back uncommitted work lost to `rm -rf`, `git reset --hard` or an agent's shell command. Restore saves the current state first, so running `undo` again flips back, and the project's own `.git` is never written.
Full project overview
Ctrl-Z for the terminal and for AI coding agents, written in Rust. Git can't bring back uncommitted work lost to `git reset --hard` or `git clean -fdx`, and Claude Code's `/rewind` doesn't cover anything an agent does through Bash, so undo snapshots the project's working tree after every shell prompt (bash, zsh, fish) and synchronously before every Claude Code Bash, Write, Edit and NotebookEdit tool call; when `rm -rf`, `sed -i` or an agent destroys work, `undo` restores the newest snapshot that differs. It never parses commands. Each snapshot is a commit in a private bare git repository outside the project, built with git plumbing (`add`, `write-tree`, `commit-tree`, `update-ref`) using its own index and an isolated environment (user config, hooks and attribute filters disabled), so the project's `.git` is never written, files are stored byte for byte, and an unchanged tree creates no commit. Snapshots include ignored files up to 1 MiB, such as `.env`, and skip build folders and nested repositories, which are listed in `undo status`. Restore saves the current state first, so running `undo` again flips back; it writes files through `git checkout-index` into a private staging folder, renames them into place, and refuses paths that cross a symlink or touch `.git`. Hooks never change the shell's exit code, a watchdog kills git at a 10-second deadline, errors go to a size-capped log, and retention keeps 7 days in full, then one snapshot per hour to 30 days, under a 2 GiB cap per project. `undo init claude` merges the hook into Claude Code's settings without disturbing other settings, backs up the original and does nothing on a second run. Tested with 70 Rust tests (12 unit, 58 integration) at 93.6% line coverage that run real destructive commands in sandboxed temporary homes and compare file hashes before and after, plus 6 tests for the apt packages; review agents found real defects, including a git timeout that left a lock file behind and broke every later snapshot and a background prune that raced the first snapshot, each fixed with a test. Released as v0.1.2 with cargo-dist for x86_64 and aarch64 Linux and macOS, published to crates.io, a Homebrew tap, a `curl` installer and a GPG-signed apt repository, with CI on Ubuntu and macOS (rustfmt, clippy, Codecov, SHA-pinned Actions, Dependabot).
A command-line tool for Linux and WSL that finds cache and temp files that are safe to delete. Eight rules say where to look, a guard refuses anything a running process has open (matched by path and by device and inode, so containers are seen too), and the one function that deletes re-checks every file right before removing it.
Full project overview
A command-line tool in Rust for Linux and WSL that finds cache and temp files that are safe to delete, for a machine whose disk keeps filling up and whose CPU keeps pegging. It is rule-based, with no AI: eight rules cover the XDG cache, pip, uv, npm, cargo, `/tmp`, `__pycache__` and idle build directories. The program is split into scan, guard and clean, so only `clean` deletes and only the guard decides, and `clean` measures and checks every candidate again immediately before removing it, logging each removal to a file it opens before deleting anything. The guard refuses symlinks, paths outside the rule's root, files owned by other users, anything modified within the rule's age limit, sockets and FIFOs, and anything a running process has open, matched by path and by (device, inode) so files held by containers and other mount namespaces are seen too. A one-second `/proc` snapshot cache cut a 300-candidate clean from 34.6 s to 2.8 s, and one real `clean --apply` freed 2.4 GiB. `safesweep why` reports which programs are using the CPU, and a ratatui terminal UI runs the same scan and clean code, so it cannot delete anything the command line would refuse. Tested with 110 Rust tests (90 unit and 20 end-to-end) at 94.8% line coverage with a 90% floor in CI, plus 49 shell tests for the installer and 8 for the npm launcher; a whole-repo review found real defects, including a container blind spot in the in-use check and a signal race in the npm launcher, each fixed with a reproducing test. Released as v0.6.7 through a CI/CD pipeline with every GitHub Action pinned to a commit SHA, clippy, cargo-audit and npm trusted publishing: crates.io, PyPI, npm, Homebrew, a GPG-signed apt repository, cargo-binstall, Nix, `.deb` and `.rpm` files, and a `curl` installer that verifies a SHA-256 checksum. It runs on Linux and WSL only, because it reads `/proc`. Pre-commit hooks run gitleaks secret scanning, rustfmt and typos, and Dependabot keeps Actions and crates current.
A command-line tool for Linux, macOS and Windows that shows what is listening on a port: the command line, working directory, owner and uptime, plus the Docker container behind it. Its `--kill` identifies a process by pid and start time, never signals `systemd` or a parent of another holder, and asks before it forces.
Full project overview
A command-line tool in Rust that shows what is listening on a TCP or UDP port, for the moment a server fails with "address already in use": the command line, the directory it was started from, the owner and how long it has been running, plus the Docker container behind a published port, as a table, details or JSON. It runs on Linux, macOS and Windows as one static binary with five dependencies, and each system is read directly (`/proc` on Linux, `lsof` on macOS, the IP Helper API on Windows) behind one shared contract. `--kill` is built so it cannot stop the wrong thing: each target is identified by pid and start time, so a pid reused by another process is left alone; service managers (`systemd`, `launchd`, `svchost.exe`), parents of other holders and Docker's port forwarder for a container's published port are never signalled, and it exits 3 and names the holder that remains; it asks first (`SIGTERM`, or Ctrl+C and `WM_CLOSE` on Windows, refused when the console is shared with unrelated programs) and forces only with `--force`, which still applies when the polite step errors. Text from other processes is escaped (control, bidirectional-override and zero-width characters), Docker lookups are limited to a local daemon and cut off after 2 seconds, and every item has a doc comment, enforced by `clippy::missing_docs_in_private_items`. Tested with 65 Rust tests (49 unit and 16 end-to-end against real sockets and helper processes) at 97.2% line coverage with a 90% floor in CI, plus 16 shell and 9 PowerShell tests for the installers and 8 for the apt repository; code reviews found real defects, including every holder of a shared socket being signalled (`systemd` included), a reused pid and Windows Ctrl+C reaching every program on the console, each fixed with a test, and a test flake traced to a probe socket inherited by a forked child was fixed at the root. Released as v0.5.8 through a draft-then-publish pipeline with every GitHub Action pinned to a commit SHA, clippy, cargo-audit, tests on four runners and a protected `master`: crates.io, PyPI, npm (trusted publishing with provenance), Homebrew, Scoop, cargo-binstall, a GPG-signed apt repository on GitHub Pages (installed in a clean Debian container after every release), `.deb` and `.rpm` files, and `curl` and PowerShell installers that verify a SHA-256 checksum and are smoke-tested on every OS in the release. A winget submission is waiting on Microsoft. Rust, clap, GitHub Actions.
A command-line tool that explains why a package is in your dependency tree by reading the lockfile directly, offline and read-only, for npm, pnpm, Yarn, Bun, uv, Poetry, Cargo and Go. Every format becomes one graph, so `--remove` can show what dropping a direct dependency would free and what would stay and why.
Full project overview
A command-line tool in Go that explains why a package is in your dependency tree, for the moment `npm audit` flags a package you never installed. It reads the lockfile directly, offline and read-only with no package manager needed, for eight formats across four ecosystems: `package-lock.json` (v1-3), `pnpm-lock.yaml` v9, `yarn.lock` (Classic and Berry), `bun.lock`, `uv.lock`, `poetry.lock`, `Cargo.lock` and `go.mod`. Every format is parsed into the same graph (packages, edges tagged prod, dev, optional, peer or indirect, and the project as root), so every question is one algorithm on that graph: `depwhy <pkg>` prints every chain from your direct dependencies as a reverse tree that marks cycles and already-expanded packages, so it stays linear in the graph's size, with a 10-path cap; `--remove` is a dry run that compares reachability with and without the root's edge to show what would be freed and what would stay and why; `--dupes` lists packages at several versions, and `-r --dupes --across` finds version conflicts between the projects of a monorepo, honoring `.gitignore`; `--heaviest` ranks direct dependencies by the installed size their removal would free. Lockfile data is treated as untrusted: bash, zsh and fish completion offers package names from the lockfile but never evaluates them (tested with a package named `$(touch PWNED)`, including on bash 3.2), terminal escape sequences in lockfile text are escaped, size measurement cannot leave the project, and `--cargo-metadata` and `--go-graph` run offline and read-only with timeouts and with toolchain and rustflags hijacking blocked. Opt-in `--online` adds OSV advisories and npm deprecated or PyPI and crates.io yanked status, cached for 24 hours, and never fails a run. `--json` is a frozen schema-1 contract pinned by a key-set test. Tested with 221 top-level Go tests (368 with subtests) and 111 golden files at 96.4% statement coverage with a 90% gate in CI, the race detector on Linux, macOS and Windows, and 13 npm launcher tests; independent reviews before releases found real bugs, including every real `bun.lock` failing to parse, Yarn Berry multi-descriptor names, `go mod graph` pseudo-modules and unselected versions, and `cargo metadata` rewriting `Cargo.lock`, each fixed with a test. Released as v1.0.0 through a CI/CD pipeline with every GitHub Action pinned to a commit SHA, golangci-lint, `govulncheck`, actionlint and shellcheck: GoReleaser builds six OS and architecture targets and `.deb`, `.rpm` and `.apk` packages, alongside `go install`, a Homebrew cask, a GPG-signed apt repository on GitHub Pages whose CI rejects tampered and unsigned indexes, an npm package (a zero-dependency launcher with a checksum-verified, atomic install and provenance) and a Scoop bucket, all seven channels install-tested at 1.0.0.
A command-line tool in Go that shares a site on `localhost`, or a file or folder, with a phone or another device on the same network through a link and QR code, with nothing to install on the other device. Every run makes a new 128-bit token, `--approve` makes the owner allow each new device at the terminal, and `--for` stops sharing after a set time. It uses plain HTTP on the local network, so it is meant for networks you trust.
Full project overview
A command-line tool in Go that shares a site running on `localhost`, or a file or folder, with a phone or another device on the same network through a link and QR code, with nothing to install on the other device. A reverse proxy rewrites `Host` and `Origin` so dev servers that check them accept the request, works with servers that listen only on loopback, and keeps WebSocket hot reload working. Every run makes a new 128-bit token that is swapped for an `HttpOnly` cookie on the first visit, compared in constant time, and kept out of logs and `Referer`; `--approve` makes the owner allow each new device at the terminal, with limits on how many can wait and a block on refused visitors, and `--for` stops sharing after a set time, checked against the wall clock so a sleeping laptop does not extend it. A folder file server built on Go's `os.Root` has the operating system enforce the folder boundary, refuses hidden files, symlinks and special files, and `--upload` streams each upload to a hidden temporary file and renames it into place with `O_EXCL` so nothing is overwritten. `--public` shares over the internet through a Cloudflare quick tunnel: Cloudflare's visitor-address headers are trusted only on a separate loopback listener and stripped everywhere else, and the link is shown only after the tunnel has registered. Tested with 174 test functions at 93.7% coverage (85% floor in CI, reported to Codecov) on Linux, macOS and Windows, using a stand-in `cloudflared` that the test binary re-executes and then confirmed against the real one; independent reviews found real defects, including an orphaned `cloudflared` process on exit, an https-to-http downgrade in proxied redirects and a way to refill the approval queue, each fixed with a test that failed first; a code review before v0.6.1 found seven more bugs, including unbounded memory growth from closed WebSocket connections and a startup hang under WSL, all fixed in that release. Released as v0.6.1 through a tag-gated CI/CD pipeline with every GitHub Action pinned to a commit SHA and kept current by Dependabot, golangci-lint and `govulncheck`, and a release only if CI passed for the commit: GoReleaser builds the release, the workflow publishes to npm and PyPI (trusted publishing), Homebrew, Scoop and GPG-signed apt, dnf and pacman repositories update from it, and a `curl` installer verifies a SHA-256 checksum; the Linux installs were checked in clean containers. It uses plain HTTP on the local network, so it is meant for networks you trust; HTTPS is built in an unreleased draft pull request, waiting on testing with real phones. Go, GitHub Actions, GoReleaser.
A command-line tool in Go for flaky tests, the ones that pass on one run and fail on the next with no code change. It reruns any test command up to 1,000 times, each run in its own temporary copy of the project, and ranks the tests that fail intermittently by failure rate. `flaky bisect` finds the commit where a test became flaky, using a 90% Wilson score interval at each commit and exiting 3 instead of naming a commit when the evidence is too weak.
Full project overview
A command-line tool in Go for flaky tests, the ones that pass on one run and fail on the next with no code change. It reruns any test command up to 1,000 times, each run in its own temporary copy of the project so parallel workers never share files, reads the JUnit XML report from every run (with adapters for pytest, gotestsum and Jest, and `--junit` for cargo-nextest and custom runners), and ranks the tests that fail intermittently by failure rate, with a failing and a passing output side by side. `flaky bisect` finds the commit where a test became flaky: plain `git bisect` needs a yes or no per commit, so flaky runs the test 30 to 1,000 times at each sampled first-parent commit, in a fresh detached git worktree, and classifies the commit as stable, flaky or inconclusive with a 90% Wilson score interval against a 10% failure-rate threshold; when the evidence is too weak it exits 3 instead of naming a commit. Your branch, index and files are never modified. Every test command and git call runs in its own process group, killed on Ctrl-C and after each run, only the last 8 KiB of output is kept, and the JUnit report path is checked for symlinks before and after every run. It uses only the Go standard library. Tested with 41 Go test functions (57 with subtests) under the race detector at 82.5% statement coverage, using fake test scripts and temporary git repositories; reviews found real defects, including bisect running tests in copies without `.git` (breaking any suite that calls git), git checkout hooks left running after Ctrl-C, and cleanup changing permissions on a file outside the workspace through a hard link, each fixed with a test. Released as v0.1.4 through a GoReleaser pipeline that builds Linux, macOS and Windows binaries (amd64 and arm64) and `.deb` packages, signs every artifact with GitHub build attestations and verifies them in the release job, which fails unless a tampered checksum file is rejected, and publishes to a Homebrew tap and a GPG-signed apt repository, alongside a `curl` installer that verifies a SHA-256 checksum. Go, GoReleaser, GitHub Actions.
Games4 projects
TypeScript / JavaScript / BashClub LionAgentic experiment · Work in progress
Work in progressReactWeb AudioPWAPlaywrightMulti-agent orchestration
A work-in-progress Club Penguin–style browser world for children and an experiment in coordinating coding agents. Players explore 23 illustrated rooms, play 25 minigames from a walk-in arcade, pick up toys and hand them to neighbours, hunt a daily collectible pin and fill a 56-stamp book, with progress saved locally in an installable PWA. The development workflow uses isolated worktrees and a serial integration queue rather than having agents edit master together, and every branch passes a GitHub Actions gate before it merges.
Technical details
Agent roles and integration:The orchestrator breaks work into scoped tasks and creates isolated worktrees. Implementers write code and tests; reviewers audit candidates and return substantial issues for fixes. A verifier rebases candidates and runs the verification gate before serial integration. Commit trailers and a task tracker preserve responsibility across agent handoffs.
Browser-native mechanics:Declarative room manifests describe portals, walkable areas and interactive objects. Music and instruments use procedural Web Audio synthesis, and versioned localStorage saves support local progress, cross-tab synchronization and export/import backups.
Living rooms:Room toys react in steps with read-aloud lines, carried props can be dragged anywhere, held by the player's doll or given to neighbours, and their positions persist in the validated save. Rooms and toys are SVG, layered with a shared library of see-through material patterns such as wood, brick, tile, sand and glass.
Verification boundaries:Pure game logic is tested independently of React with Node's test runner. Before a branch joins master, GitHub Actions runs the unit tests, typecheck, formatting check and build, a four-shard Playwright suite on desktop and phone viewports, and an offline install test of the PWA.
Scope & limitations
An ongoing agent-orchestration experiment, not a completed AI/ML model or entirely hand-written application.
Progress and social interactions are local-first; this entry does not claim a deployed multiplayer backend.
GoShellGo standard libraryGitGoReleaserGitHub Actions
CLIGitGameEducationGoReleaserGitHub Actions
An escape-room game in Go that teaches git in your own terminal. Each of the 12 levels is a real git repository with a short story and a broken or unfinished state, from a merge conflict to a commit rescued from the reflog; you solve it with ordinary `git` commands, and `gitquest check` grades the result with git plumbing against commit IDs recorded at setup and says what is still wrong. Levels build the same commit hashes on every machine, and the game only writes and deletes inside its own marked folder.
Full project overview
An escape-room game in Go that teaches git in your own terminal. Each of the 12 levels is a real git repository with a short story and a broken or unfinished state, from a first commit to a merge conflict, a commit lost to `reset --hard` and rescued from the reflog, cherry-pick, `rebase --onto`, soft versus hard reset and `.gitignore`; you solve it with ordinary `git` commands, and `gitquest check` grades the result and says what is still wrong, with three progressive hints per level. Levels are built deterministically: each one is a table of setup steps run through git with the host's `GIT_*` variables removed, system and global config disabled, a fixed author and a clock that advances 60 seconds per commit, so every machine builds the same commit hashes, which a test checks for all 12 levels. Checks use git plumbing only (`rev-parse`, `cat-file`, `merge-base --is-ancestor`, `rev-list`, `check-ignore`), never parsed `git status` or `git log` output, and compare against commit IDs recorded at setup, so a merge must have both original commits as parents and a rescued branch must contain the lost commit; a hostile global git config does not change a result. The game writes and deletes only inside its own folder: the root and every level carry marker files, and it refuses a non-empty folder without its marker, a level replaced by a symlink, a folder that resolves outside the root, or a marker for a different level; progress is saved atomically and a corrupt file is set aside rather than deleted. It uses only the Go standard library. Tested with 42 Go test functions (104 with subtests) under the race detector at 83% statement coverage across packages, with every level checked unsolved, after its intended solution and after a plausible wrong one; three independent reviews of the whole repository found real defects, including a broken `.git/config` reported as an unsolved puzzle instead of an error and a blanket `*` ignore rule accepted for the `.gitignore` level, each fixed with a regression test. Released as v0.1.3 with GoReleaser (static Linux and macOS binaries for amd64 and arm64, `.deb` packages, a Homebrew cask and `go install`) alongside a `curl` installer that verifies a SHA-256 checksum, on a CI pipeline with SHA-pinned Actions, golangci-lint, tests on Linux and macOS, Codecov over OIDC and Dependabot. Go, Git, GoReleaser, GitHub Actions.
Bubble TeaGitProcedural generationPure state machine
A terminal roguelike generated from the git repository it runs in. Directories become rooms, committed text files become monsters, and the most-changed file is the boss. A hand-written SplitMix64 generator seeded from the HEAD commit makes each dungeon reproducible; combat uses a separate stream so fights never shift the map. Repository scanning uses read-only git commands, and the game rules are a pure state machine tested with whole-game key sequences.
The project I’ve spent the most time on. The game ideas, plans and agent workflows are my own; I continually critique the results and develop new ideas. I source resources, including Mixamo animations, and set up the APIs. Claude turns my direction into specs and orchestrates implementation with Codex and Antigravity; the agents run automated tests. The multiplayer server is behind a flag and not yet deployed.
Work in progress
TypeScriptPythonJavaScriptGLSLSQLBashReactReact Three Fiberthree.jsBlenderMeshyCloudflare WorkersDurable ObjectsD1Web AudioPlaywright
React Three Fiberthree.jsBlenderCloudflare WorkersPlaywright
My 3D social game in development: original game ideas, ongoing design and critique, custom agent workflows, and a React Three Fiber world with Blender avatars and Cloudflare multiplayer.
Full project overview
A 3D multiplayer social hangout game in development: a streamed city with nine neighborhoods, drivable cars, rooms and scored games. A React and React Three Fiber client renders through three.js. Python scripts build Blender avatars with shape keys for face and body sliders and animation clips loaded on demand; Meshy contributes generated 3D props. A Cloudflare Workers server shares the client's pure, tested game rules, with a Durable Object per room copy and D1 for accounts. Renderer budgets are checked with Playwright tests that read live canvas statistics.
A small pet that lives in your zsh, bash or fish prompt, written in Go. It eats your own git commits, reacts to each command's exit code and gets hungry and sleepy as real time passes, with an optional Ebitengine desktop window of pets and mini-games. Prompt code runs after every command, so it never runs `git`: it watches `.git/logs/HEAD` with one `stat` and leaves all `git` work to a detached background process. Timing the release binaries showed the window library's package init had pushed the median prompt to 13.9 ms; moving the window into its own binary cut it to 2.1 ms, and CI now times the built binary.
Full project overview
A small pet that lives in your zsh, bash or fish prompt, written in Go. It eats your own git commits, reacts to each command's exit code (a failure startles it, Ctrl-C does not), gets hungry, bored and sleepy as real time passes, and goes on an adventure instead of dying; an optional Ebitengine desktop window adds 8 vector-drawn pets, 8 keyboard mini-games, synthesized 8-bit sound and water, stretch and eye-rest reminders that never stack. Prompt code runs after every command, so it never runs `git` or touches the network: it finds the repository with `os.Lstat` and reads `.git/logs/HEAD` directly, re-parsing it only when its size or mtime changes, which is enough to spot a new branch, a merge or every 5th commit of the day; all `git` work happens in a detached background process with a 5-second timeout that matches recent commits to your email and leaves meals in a log the next prompt reads from a saved byte offset. Many shells share one state file, so it is guarded by a non-blocking `flock` with a 5 ms budget (when the lock is busy the prompt renders read-only and saves nothing), written atomically, and set aside rather than deleted when corrupt. Timing the real release binaries with hyperfine showed that linking the Ebitengine window into the CLI had made every prompt run 12 ms of package init that the in-process benchmark could not see (a median 13.9 ms per prompt, over the 10 ms budget); found with `GODEBUG=inittrace=1`, it was fixed by moving the window into a separate `promptpet-gui` binary, cutting the median to 2.1 ms (1.5 ms on CI), with a test that fails if the prompt binary links Ebitengine again and a CI check that times the built binary. The hooks keep `$?` and `$status` intact, can be sourced twice, time commands without forking, and the prompt segment can never contain a character the shell would expand. The shell talks to the desktop window through an append-only JSON-lines file that rotates at 2 MB and is read once a second from a byte-offset cursor, so the shell never waits on the window. Tested with 150 Go test functions (163 with subtests) under the race detector on Linux and macOS at 76.8% statement coverage, including hook tests that drive real bash, zsh and fish and a pure rules package with an injected clock and random source; bugs fixed with regression tests include an old merge in another repository replaying as a new celebration after `cd` and a prompt that moved a corrupt state file aside while another shell held the lock. Released as v0.6.0 with GoReleaser (Linux and macOS binaries of both programs for amd64 and arm64, `.deb` and `.rpm` packages with shell completions, a Homebrew formula regenerated by the release workflow, and `go install`), on CI with SHA-pinned Actions, race-enabled tests, the latency check, Dependabot and gitleaks. Go, Ebitengine, GoReleaser, GitHub Actions.
A command-line tool in Go that plays a repository's git history as an animated ASCII garden in the terminal, prints the final frame, or exports a looping GIF for a README. Every contributor is a plant: its stem grows with the logarithm of their commits, its leaves with the square root of net lines added, deleted lines make leaves fall, and the month of each commit sets the season. It only reads (`rev-parse`, `log` and `check-mailmap`) and uses no randomness or clock, so the same repository and flags always give byte-identical output.
Full project overview
A command-line tool in Go that plays a repository's git history as an animated ASCII garden in the terminal, prints the final frame, or exports a looping GIF for a README. Every contributor is a plant: its stem grows with the logarithm of their commits, its leaves with the square root of net lines added, deleted lines make leaves fall, and the month of each commit sets the season (snow, blossoms, autumn colors, or southern-hemisphere seasons with `--southern`); contributors who do not fit on screen become wildflowers. It only reads (`rev-parse`, `log` and `check-mailmap`) and uses no randomness or clock, so the same repository and flags always give byte-identical output. History comes from one `git log -z --numstat` call with custom separator bytes, split only where a full commit hash follows and with the subject parsed last, so names and subjects containing spaces, newlines or the separators themselves parse correctly; co-authors from `Co-authored-by` trailers get their own plants after `.mailmap`, merges are skipped so no change counts twice, and commits over 1,000 lines are capped and labeled. Memory stays bounded: playback samples 600 evenly spaced snapshots and GIF export 300, each keeping only the 408 author ranks that can ever be drawn, and a streaming GIF encoder writes each frame as it is drawn instead of holding them all; on git/git (61,468 commits, 2,528 authors) nearly all run time is git's own diff computation. The terminal, clock and environment are injected through one struct, so the interactive player (pause, seek and speed keys, synchronized output with no flicker, the terminal restored on Ctrl-C) runs instantly in tests with a fake clock. Tested with 66 Go tests and golden frames against fixture git repositories with fixed dates, at 86.8% statement coverage with an 80% CI gate and the race detector on Linux, macOS and Windows; code reviews found real defects, including a separator byte in a commit subject that became a fake co-author, a speed-up key that could slow playback, and an invalid 1-byte GIF written when there were no frames, each fixed with a regression test. Released as v0.2.1 with GoReleaser (Linux, macOS and Windows binaries for amd64 and arm64, a Homebrew cask and `go install`) and `.deb` packages in a GPG-signed apt repository on GitHub Pages, on a CI pipeline with SHA-pinned Actions, golangci-lint, `govulncheck`, Codecov and Dependabot. Go, GoReleaser, GitHub Actions.
GoBashZshFishGo standard libraryGoReleaserGitHub Actions
CLIShellPrivacyGoReleaserGitHub Actions
Xbox-style achievements for your shell, written in Go. A small zsh, bash or fish hook reports each finished command to `term-achievements record`, which updates counters, unlocks any of 40 achievements and prints a one-line toast before the next prompt. Command lines never reach disk: only fixed counter keys and command names from a 130-tool allowlist are stored. `record` never waits more than 5 ms for its lock, always exits 0 and runs in about 1.7 ms in process.
Full project overview
Xbox-style achievements for your shell, written in Go. A small zsh, bash or fish hook reports each finished command (exit status, duration and the previous line) to `term-achievements record`, which updates counters in one JSON file, unlocks any of 40 achievements and prints a one-line toast before the next prompt, such as "Escaped Vim — exit vim 10 times"; `list` shows progress bars and `wrapped` prints a yearly recap card with the busiest hour, top commands and best daily streak. Each achievement is one row in a declarative table (a counter and a goal). Because it runs after every command, it is built so it cannot leak what you type or slow down or break your prompt. Command lines, arguments and the working directory path are used in memory for one run and never written anywhere: a command name is stored only if it is on a fixed allowlist of 130 well-known tools, and counter keys are a fixed set never built from input, so a password typed at the prompt by mistake only raises generic counters, which a test checks by recording lines with secrets and scanning every file the tool wrote. `record` takes a non-blocking `flock` retried every 500 µs for at most 5 ms and drops the event rather than delay the prompt, saves atomically by temporary file and rename, recovers from panics, never prints to stderr and always exits 0; it runs in about 1.7 ms in process, and a test keeps the median under 10 ms on a 5,000-command history. Commands are found without a shell parser by skipping environment assignments, `sudo` and its option values, wrappers such as `nice -n N` and git's global options; `sudo !!` retries are detected against the previous line, and daily streaks survive a clock moving backwards. Bash has no preexec hook, so the bash hook reads the newest history entry instead. It uses only the Go standard library. Tested with 47 Go test functions and a benchmark under the race detector at 92.8% statement coverage with an 85% CI gate, with the hooks run in real bash, zsh and fish; reviews found real defects, including `nice -n 10 make` recorded as a command named `10`, concurrent loads of a corrupt stats file failing once another process had moved it aside, and a corrupt stats file reset without a warning because the prompt hook found it first, each fixed with a regression test. Released as v0.1.5 with GoReleaser (static Linux and macOS binaries for amd64 and arm64, `.deb` and `.rpm` packages, a Homebrew formula and `go install`) and a GPG-signed apt repository on GitHub Pages, on a staged CI pipeline with SHA-pinned Actions, golangci-lint, `govulncheck`, tests on Linux and macOS, a GoReleaser snapshot build and Dependabot. Go, Bash, Zsh, Fish, GoReleaser, GitHub Actions.
Recently started2 projects
TypeScript / SQL / JavaScriptTagalingoRecently started · Work in progress
Language learningContent reviewSpeechWork in progress
An early Tagalog-learning web app for English speakers, with short mixed-exercise lessons, a skill path, practice, streaks and a weekly leaderboard. Next.js server actions connect pure learning rules to PostgreSQL through Prisma. A content Studio reviews exercise drafts generated from a word list by Claude or an offline template generator. Speech exercises use browser APIs, with optional Google Cloud text-to-speech; a conversation tutor also has Claude and offline modes.
Work in progress. The current build contains core libraries and tests; the supervisor, CLI, terminal dashboard, memory deduplication and workspace layers remain planned.
Recently started · Work in progress
C++20C ABILinux / WSL2cgroups v2LD_PRELOADPOSIX APIsMesonNinjaUnity test framework
Resource controlProcess isolationWork in progress
An early Linux and WSL resource-control prototype for heavy concurrent workloads. The C++20 core implements cgroups v2 limits, bounded admission, command spawning and post-run page-cache cleanup. An LD_PRELOAD library adjusts CPU and memory discovery and trims browser flags. Meson and Ninja build the core and its Unity-based unit tests.
Some projects in my full portfolio are hosted as unlisted GitHub Gists. They are shared for review by hiring teams and are not intended for redistribution.