Reed Yalouh — portfolio and thoughts
Biography
The most interesting problems live at the boundaries, between disciplines, cultures, and systems of thought.
Born in Morocco and raised in Abu Dhabi, I graduated from UC Berkeley with a degree in Computer Science and a minor in Jewish Studies. Growing up across cultures gave me an early sense that the most interesting problems don't stay inside their lane. They live at the edges of technology, institutions, and power.
My technical work spans reinforcement learning, game theory, and large-scale software systems. The thread running through it is decision-making under uncertainty: how algorithms, organizations, governments, and adversaries behave when information is incomplete and failure compounds. I'm drawn to the moments when a system has to act anyway.
Growing up in the Middle East made these questions concrete. The region doesn't let you believe that elegant ideas are enough. Coordination fails even when everyone can see it failing, and that gap between what systems should do and what they actually do is where I've always wanted to work.
What that looks like in practice is software for messy, high-stakes environments. Tools that connect fragmented data, AI reasoning, and human judgment so serious organizations can act with more clarity than they otherwise would. The engineering and the geopolitics feel, to me, like the same problem at different scales.
Projects
- slug
reedcode
- title
ReedCode
- category
ai
- kind
agent inference research · NVIDIA Dynamo
- area
ai systems
- outcome
A coding-agent harness and a GPU research project on how agents use inference servers. It uncovered two bugs in NVIDIA Dynamo: my fix for one is merged upstream, and my fix for the other cuts an agent session's prefill by up to 46%.
- stack
Python
Rust
NVIDIA Dynamo
vLLM
Docker
- links
- label
github
- href
https://github.com/reedyalouh2/ReedCode
- label
merged dynamo fix
- href
https://github.com/ai-dynamo/dynamo/pull/16608
- problem
Coding agents resend a long, growing context on every turn: the system prompt, the tool definitions, the whole conversation and each new tool result. Inference servers keep already-processed prefixes in a KV cache so they don't recompute them, and NVIDIA Dynamo goes further, warming the cache for an agent's next request while its tool is still running. Whether any of that actually saves work depends on what the server renders, computes and reuses, which almost nobody measures.
- approach
A minimal coding agent that reads files, edits code and runs commands in Docker workspaces, instrumented to record tokens, cache hits, timing and task results for every model call. I ran it against hosted models, direct vLLM and my own Dynamo deployment of Qwen3-8B on an A100, then replayed captured sessions under controlled conditions to see exactly what the server computed and what it reused. The traces exposed two bugs in Dynamo; I confirmed both on GPU, patched them in Dynamo's Rust code and took both upstream.
- how
- title
Instrumented agent
- body
The harness runs a read, edit and shell tool loop against hosted APIs, vLLM or Dynamo. Harbor builds each Docker workspace and scores the result with the task's verifier, and every call is logged with its tokens, cache hits and timing.
- title
Controlled replays
- body
Saved sessions replay against the GPU server with conditions interleaved and their order rotated: warmup off, stock and fixed, three times each. Prefill counts repeated exactly in every condition, so the differences belong to the server, not to noise. The whole 18-trial GPU study cost about $2.37.
- title
Wasted warmups
- body
Dynamo's speculative prefill built its warmup from the message text alone, dropping the tool definitions and template settings, so the warmup parted ways with the real request before most of the context. Sessions paid 62–85% more prefill and kept up to 2.4 GiB of cache that nothing read. The fix keeps those fields, making the warmup an exact prefix of the next request.
- title
Ignored thinking setting
- body
Dynamo's Anthropic-compatible endpoint dropped an explicit thinking: disabled, so Qwen3 kept reasoning anyway. My fix passes the caller's choice through to the chat template and is merged into Dynamo. Replaying four long Claude Code requests, it cut generated tokens by 74% and response time by 65%.
- hard
- title
Waste that looks like success
- body
Nothing errored. The warmups ran, the answers were right and the cache looked busy. The bug only shows when you compare what the server rendered with what it later reused, block by block.
- title
Every template is different
- body
Restoring the dropped fields gave exact prefixes for the Nemotron and GPT-OSS templates, but Qwen also needed an explicit tool-continuation boundary in the renderer before its warmups lined up.
- title
Hybrid models
- body
Models that mix attention with recurrent layers can't reuse a cached prefix the usual way. In one case stock routing credited a worker with 3,264 tokens it could not reuse; my prototype selector tracks both kinds of state and chose a worker with 2,720 usable ones.
- title
Measuring before building
- body
Across 42 tool continuations, a corrected warmup would have prepared a median of only 80 extra tokens, so I dropped a planned scheduling policy instead of optimizing a workload with little to win.
- slug
recursive-discovery
- title
Recursive Discovery
- category
research
- kind
autonomous math search · exact verification
- area
research tooling
- outcome
An autonomous search system for a problem open since 1956, the zero-error capacity of the 7-cycle. It hunts for large codes under a hard compute budget, checks every answer exactly, and can hand the search to an LLM whose programs run sandboxed with metered spending. Built at the Crusoe Recursive Agents Hackathon.
- stack
Python
ShinkaEvolve
Crusoe inference
macOS sandbox
- links
- label
github
- href
https://github.com/reedyalouh2/recursive-discovery-hackathon
- label
demo
- href
https://reedyalouh2.github.io/recursive-discovery-hackathon/
- problem
In 1956 Shannon asked how much information a noisy channel can carry with no chance of error. For a channel whose confusable symbols form a 7-cycle the answer is still unknown: it lies somewhere between 3.2578 and 3.3177. Lower bounds come from explicit constructions, sets of codewords where no two can be confused, and finding large ones is a huge combinatorial search. Handing that search to an autonomous agent only helps if every result can be checked and every dollar of compute is accounted for.
- approach
A search harness where every step is bounded and checkable. An iterated local search, after Andrade, Resende and Werneck, builds independent sets in strong powers of C7 under a fixed budget of neighbor-list scans, and an exact verifier checks every answer as data. Around that core: experiment history, deterministic replay, a tuning experiment judged on held-out seeds, and an adapter that lets ShinkaEvolve, an LLM-driven program-evolution framework, propose whole new search programs, each run in a locked-down sandbox with its spending reserved and capped before any model call.
- how
- title
The puzzle
- body
In d dimensions a point is a list of d digits from 0 to 6, and two points are confusable when every digit differs by at most 1 around the cycle. A set of k points with no confusable pair proves the capacity is at least the d-th root of k. In two dimensions at most 10 points fit; the artifact lets you try.
- title
Bounded local search
- body
(1,2)-swaps trade one chosen point for two, forced insertions knock the search out of local optima, and an acceptance rule sometimes keeps a worse set to keep exploring. Work is counted in neighbor-list scans, so every run has a hard, deterministic budget.
- title
Exact checking
- body
The verifier confirms with exact integers that every pair differs by 2 to 5 (mod 7) in some coordinate, rejects malformed or duplicate points, and never executes candidate code.
- title
Tuning, tested fairly
- body
Evolutionary and random search tuned the local search's five settings over 192 runs each on tuning seeds, then the winners were frozen and compared on 20 separate held-out seeds. Random-search settings beat the defaults on all 20, even when the defaults got 10.6× the scans per run.
- hard
- title
Running untrusted code
- body
LLM-written programs run under a deny-by-default macOS sandbox: no network, no child processes, writes only to a scratch folder, and limits on CPU, memory and time. An independent guardian kills and cleans up any candidate that outlives its evaluator.
- title
Capped spending
- body
Only a local metering proxy holds the API key. It reserves each request's worst-case cost before forwarding it, settles the real usage afterward, and stops at the run's budget or a shared $50 cap.
- title
Fair comparisons
- body
The protocol was frozen before any evaluation, tuning and held-out seeds never overlap, every arm gets the same scan budget, and results are paired by seed with exact sign tests. A stricter control also gives the defaults the tuning's compute.
- title
Results you can trust
- body
Every construction is re-checked by the verifier, every evaluation's certificate is kept, and offline runs replay exactly from their recorded configuration and seed.
- slug
nimbleprobe
- title
NimbleProbe
- category
security
- kind
agentic red-team simulation
- stack
Python · Containers · Local LLM
- summary
An agentic red-team simulation framework: a local LLM plans investigations from real host telemetry inside a containerized lab, then writes a remediation report.
- link
https://spuz.me/blog/zine/n4753c_h4ck47h0n_2
- title
AI Dialogue Mapping Platform
- category
ai
- kind
deployed AI system
- slug
ai-dialogue-mapping-platform
- area
ai systems
- outcome
A deployed platform that interviews each participant before a difficult group conversation, maps where they agree and disagree, and hands the facilitator a brief.
- stack
full-stack web
LLM prompting
structured synthesis
- problem
People walk into hard conversations with disagreements they haven't named. They use the same word to mean different things, hold different assumptions, and guess wrongly about what others think. Facilitators usually discover this halfway through the meeting.
- approach
Before the meeting, each participant has a short adaptive interview with an LLM that follows up on what they actually said. Answers are stored in a structured form, tagged by the concepts they touch, so participants can be compared concept by concept. The platform then pulls out shared ground, real tensions, and words people define differently, and writes a facilitator brief that keeps minority views visible.
- how
- title
Adaptive intake
- body
Each follow-up builds on the previous answer, so a vague reply gets a concrete second question instead of the next item on a script.
- title
Structured answers
- body
Every answer is stored with the concepts it touches and the participant's stance, not as a wall of text.
- title
Concept by concept
- body
Lining participants up on the same concept shows agreement, disagreement, and words that mean different things to different people.
- title
Facilitator brief
- body
Shared ground, tensions, definition gaps, and questions to open with, ready before the meeting starts.
- hard
- title
Uneven depth
- body
Some people write a paragraph and others a word, and the comparison can't favor whoever wrote more.
- title
Minority views
- body
A view held by one person can matter most in the room, so the synthesis must never average it away.
- title
Not flattening disagreement
- body
A summary that makes everyone sound aligned is worse than no summary at all.
- title
Usable fast
- body
The facilitator needs something readable minutes before the meeting, not a dashboard to study.
- title
Sanctions-Evasion Network Analysis
- category
data
- kind
intelligence workflow
- slug
sanctions-evasion-network-analysis
- area
data tools
- outcome
An entity-graph workflow that takes an analyst from a single name to the hidden relationships, risk indicators, and a briefing-ready explanation.
- stack
graph analysis
analyst UI
entity resolution
- problem
Sanctions evasion hides in relationships: a customer's vessel meets another at sea, that vessel's owner shares a director with a listed company. Analysts usually see these as disconnected tables, which makes the path hard to find and harder to explain to a reviewer.
- approach
A workflow that connects entity, trade, and financial relationships into one graph organized around the steps an investigation actually takes: search for a name, expand its connections, inspect each entity, triage the paths by their risk indicators, and summarize the finding as a brief. The demo runs on synthetic data so nothing sensitive is exposed.
- how
- title
One graph
- body
Companies, vessels, people, and banks become nodes; ownership, directorships, payments, and transfers become edges.
- title
Step-by-step expansion
- body
The graph grows outward one hop at a time, so it stays readable as the investigation widens.
- title
Risk indicators
- body
Shared addresses, transfers at sea, transponder gaps, and free-zone ownership are flagged where they occur.
- title
Briefing output
- body
The path, the evidence, and the open questions are summarized for a reviewer.
- hard
- title
Ambiguous names
- body
Entities with similar names have to be told apart before any path is trusted.
- title
Clutter
- body
Dense graphs bury the important path, so expansion is deliberate and paths are highlighted.
- title
False positives
- body
A path to a listed entity is a lead, not a verdict, and the brief has to say what still needs checking.
- title
Explainability
- body
Every conclusion has to trace back to specific relationships a reviewer can verify.
- slug
x-devrel-pulse
- title
X DevRel Pulse
- category
data
- kind
developer intelligence · signal classification
- area
data tools
- outcome
Turns public developer posts about the X API into ranked, explainable triage signals: what is broken, how badly, who should own it, and what to ask the developer next.
- stack
Python
X API
SQLite
xAI / Grok
- links
- label
github
- href
https://github.com/reedyalouh2/x-devrel-pulse
- problem
Developer posts mix production outages with tutorials, praise, and idle questions. A DevRel or platform team needs to find the few posts where someone is actually blocked, understand the problem, and route it to the right owner without reading everything.
- approach
A pipeline that pulls posts through X API Recent Search (or an offline set), classifies each one with a deterministic rule engine, stores the structured signals in SQLite, and ranks the highest-signal issues, with an optional Grok summary on top. The classifier scores topic, pain, and severity separately, so "love the new API" and "losing events in prod" can never land in the same bucket, and every decision carries the evidence that produced it.
- how
- title
Topic
- body
Weighted rules per category, from 5 for a defining phrase like next_token to 1 for shared vocabulary. Each rule fires once per post, so repeating a word cannot inflate a score.
- title
Pain and severity
- body
Separate rule sets detect whether the author is blocked (errors, regressions, confusion) and how bad it is (production impact, a blocked launch, lost data).
- title
Score and urgency
- body
Pain is 40% topic strength, 35% pain signals, and 25% severity, discounted when a topic is only mentioned or the post reads like promotion.
- title
Routing
- body
Each category maps to an owner (Docs, SDK, Platform, Support, or GTM), a fix to ship, an action, and a follow-up question; production impact escalates the action.
- hard
- title
'author' is not 'auth'
- body
Word-boundary rules keep substrings like author from triggering the auth category; the evaluation has a case for exactly this trap.
- title
Mentions are not pain
- body
A post that only mentions a topic is discounted, so tutorials and praise stay at low urgency.
- title
Posts with two problems
- body
A second category has to reach 35% of the primary's score and an absolute floor, so real secondary issues appear without noise.
- title
Explainability
- body
Every signal lists the evidence it matched and a rationale, so a reviewer can see why a post was routed where it was.
- title
Sequential Game Analysis Infrastructure
- category
research
- kind
research engineering
- slug
sequential-game-analysis-infrastructure
- area
research tooling
- outcome
Rust and Python infrastructure for solving adversarial, turn-based games by exhaustive search, and for making the results readable.
- stack
Rust
Python
state-space search
memoization
- problem
Solving a game means searching every position reachable from the start, and that space grows explosively. Raw solver output is also hard to read: knowing a position is a win says little about what a strategy looks like or why it works.
- approach
Compact state encodings so positions are cheap to store and compare, exhaustive search that classifies every position as a win, loss, or draw for the player to move, and caching so positions reached by different move orders are solved only once. Evaluation utilities and visualizations then turn the solved space into views of strategy, outcomes, and policy structure.
- how
- title
State encoding
- body
Each position is packed into a compact key, which makes caching and duplicate detection cheap.
- title
Exhaustive search
- body
Every reachable position is visited and labeled a win, loss, or draw under perfect play.
- title
Avoiding repeated work
- body
A cache of solved positions means a position reached by many move orders is solved once.
- title
Readable output
- body
Outcome classes and strategy comparisons are rendered as views instead of raw tables.
- hard
- title
State explosion
- body
Even modest games have far too many positions for naive search, so every redundancy matters.
- title
Duplicate positions
- body
Different move orders reach the same position, and symmetric positions behave identically.
- title
Interpretability
- body
A solved game is millions of labels; turning that into insight takes deliberate visualization.
- title
Very large trees
- body
Views have to summarize structure without trying to draw every node.
- title
Multilingual Review Classification System
- category
ai
- kind
applied ML system · multilingual classification · analyst triage
- slug
multilingual-review-classification-system
- area
ai systems
- outcome
A text classifier that sorts noisy, emoji-heavy social posts in English, Spanish, and Korean into homegoods, beauty, or other.
- stack
Python
scikit-learn
TF-IDF
SMOTE
linear SVM
- problem
Posts exported from Instagram and Reddit arrive messy: titles and bodies in separate columns, emoji that carry meaning, links and handles that add noise, labels named differently in every dataset, and far fewer beauty posts than anything else. A classifier trained on that as-is learns the noise and neglects the smallest class.
- approach
A pipeline that cleans the data before any modeling. It merges title and body into one input, turns emoji into words so they still count, strips links and handles, maps every dataset's labels onto three categories, and drops English and Spanish filler words. The text becomes TF-IDF features over single words and word pairs, SMOTE rebalances the classes, and a linear SVM is trained and evaluated on stratified splits for each language.
- how
- title
Emoji as words
- body
A lipstick or frying-pan emoji is often the clearest signal in a short post, so emoji become words instead of being thrown away.
- title
Words and pairs
- body
TF-IDF over single words and two-word pairs keeps phrases like "lip tint" together and down-weights words that appear everywhere.
- title
Rebalancing
- body
SMOTE synthesizes extra examples of the smaller classes so the model doesn't learn to ignore beauty posts.
- title
Linear SVM
- body
A linear separator suits sparse, high-dimensional text features and stays quick to retrain as data grows.
- hard
- title
Overlapping categories
- body
Homegoods shares everyday shopping language with both other categories: in Spanish it blurs with other, in Korean with beauty.
- title
A small beauty class
- body
With the fewest examples, beauty recall could suffer while overall accuracy still looked fine, so every class is scored on its own.
- title
Three languages, three schemas
- body
The Spanish and Korean exports used different columns and label names, so each needed its own cleanup before the shared pipeline.
- title
Platform shift
- body
Reddit posts are long and descriptive while Instagram captions are short and emoji-heavy, and one model has to handle both.
- title
2048 Game Logic Engine
- category
software
- kind
game logic · state transitions
- slug
2048-game-logic-engine
- area
software design
- outcome
The core logic of 2048 in Java: tilting the board, merging tiles, scoring, and detecting when the game is over.
- stack
Java
game logic
state transitions
- problem
2048 looks simple, but its rules are subtle. Tiles slide as far as they can, equal tiles merge, a tile created by a merge can't merge again in the same move, and the game has to know when no move is left.
- approach
Every tilt is broken into four independent lines, each read from the edge the tiles move toward. One short routine handles a line: drop the gaps, merge equal neighbors once, and pad with blanks. A direction mapping turns the same routine into all four moves, and separate checks find empty cells, the largest tile, and whether any move remains.
- how
- title
Lines, not tiles
- body
Treating a tilt as four one-dimensional lines keeps every rule in one place instead of spread across many cases.
- title
Merge once
- body
A merge consumes both tiles, so the new tile is never compared again in the same tilt.
- title
Direction mapping
- body
Each direction only changes which cell is the leading edge, so one routine serves all four.
- title
End of game
- body
The game ends when the board is full and no two neighbors are equal.
- hard
- title
Three in a row
- body
Three equal tiles merge into one doubled tile and one unchanged tile, not a single tile.
- title
Four in a row
- body
Four equal tiles make exactly two merges.
- title
Moves that change nothing
- body
A tilt that doesn't move anything shouldn't count as a move or add a tile.
- title
Scoring
- body
Each merge adds the new tile's value, and only once per merge.
- title
Deque Data Structure Library
- category
software
- kind
data structures
- slug
deque-data-structure-library
- area
software design
- outcome
A generic double-ended queue in Java, built twice: as a circular, resizing array and as a doubly linked list with a sentinel.
- stack
Java
generics
data structures
- problem
The same interface, add and remove at either end, can sit on very different memory layouts. Each has its own traps: an array has to wrap around and resize without losing order, and a linked list has to handle empty and one-item cases without special code everywhere.
- approach
Two implementations behind one generic interface. The array version keeps a front index and maps item i to slot (front + i) mod capacity, doubling when full and halving when a quarter or less is used. The linked version uses a circular sentinel so every add and remove rewires the same way. Both support iteration and equality by contents, and a max variant takes a comparator.
- how
- title
Circular indexing
- body
The front and back wrap around the array, so adding or removing at either end is one write.
- title
Geometric resizing
- body
Doubling when full and halving when sparse keeps every operation fast on average and memory proportional to size.
- title
Sentinel node
- body
A permanent node before the first item and after the last removes the special cases for empty lists.
- title
Equality by contents
- body
Two deques are equal when they hold the same items in order, whichever way they're stored.
- hard
- title
Wraparound
- body
Indices that run off either end of the array have to wrap correctly in both directions.
- title
Order across a resize
- body
Copying into a bigger or smaller array must keep the items in their logical order.
- title
Stale references
- body
Removed slots are cleared so the deque never keeps old objects alive.
- title
Removing to empty
- body
Going from one item to none has to leave both structures valid and reusable.
- title
Linguistic Analytics Engine
- category
data
- kind
time series + graph backend
- slug
linguistic-analytics-engine
- area
data tools
- outcome
A Java engine that combines word-usage history with a graph of word meanings to answer questions like “which kinds of animal were written about most between 1900 and 1950?”
- stack
Java
time series
directed graphs
HTTP
- problem
How often a word was used over time is a time series. How words relate in meaning, like a beagle being a kind of dog, is a graph. Interesting questions need both at once, without flattening either one.
- approach
Three layers. A time-series layer parses yearly word counts and normalizes them by the total words written each year. A graph layer builds a directed graph of synonym sets and their “is a kind of” links, handling words that appear in several sets. A query layer intersects the more specific terms under several words and ranks them by usage over a chosen range of years. A command-line tool and a small HTTP server built on the standard library sit on top.
- how
- title
Normalized history
- body
Raw counts are divided by the total words written each year, so years with more text don't drown out the rest.
- title
Graph of meanings
- body
Each synonym set is a node, and edges point from a general term to more specific ones.
- title
Shared terms
- body
Queries over several words keep only the terms that sit under every one of them.
- title
Ranking
- body
Results can be cut to the k most-used terms over a range of years, then listed alphabetically.
- hard
- title
Words with several meanings
- body
One word can belong to several synonym sets, and every one of them has to be searched.
- title
Duplicates
- body
Different paths through the graph can reach the same word, which must appear only once.
- title
Missing years
- body
Words absent in some years still need consistent sums and comparisons.
- title
Defensive copies
- body
Histories are returned as copies, so callers can't accidentally change the stored data.
- title
Procedural World Generation Engine
- category
software
- kind
game systems · large codebase
- slug
procedural-world-generation-engine
- area
software design
- outcome
A seeded tile-world engine in Java that generates explorable maps of rooms and hallways, with movement, collision, and save and load.
- stack
Java
procedural generation
seeded randomness
game state
- problem
A generated world should feel random, yet the same seed must rebuild exactly the same map, or nothing can be tested or reloaded. The layout also has to stay playable: rooms can't overlap, every room must connect, and walls have to enclose every walkable tile.
- approach
All randomness flows from one generator seeded from the input, so room sizes, placements, and hallway turns are fully determined by the seed. Rectangular rooms are placed without overlap, joined by width-one L-shaped hallways, and wrapped in walls. An avatar and target are placed on the floor, movement checks for collisions, and the game state saves and reloads into the same world.
- how
- title
One seeded source
- body
Every random decision draws from the same seeded generator, so a seed is a complete description of a world.
- title
Rooms and hallways
- body
Rooms are placed only where they don't overlap, then consecutive rooms are joined by L-shaped hallways.
- title
Walls
- body
Every walkable tile gets walls around it, so the world is always enclosed.
- title
Play and persistence
- body
Scripted inputs drive movement for repeatable testing, and saving stores just the seed and positions, enough to rebuild everything.
- hard
- title
Overlapping rooms
- body
Candidate rooms that collide with existing ones are rejected, which shapes how dense a map can get.
- title
Connectivity
- body
A validator confirms every floor tile is reachable, so no room is ever cut off.
- title
Exact replays
- body
Any extra or reordered random call changes the whole world, so the order of decisions is fixed.
- title
Movement
- body
Moves into walls are ignored, and the avatar can never leave the walkable area.
- title
Hog Strategy Simulator
- category
ai
- kind
simulation · decision strategy · higher-order functions
- slug
hog-strategy-simulator
- area
ai systems
- outcome
A simulator for a two-player dice race to 100, and strategies that read both scores to decide how many dice to roll, including when to roll none at all.
- stack
Python
Monte Carlo simulation
higher-order functions
- problem
Each turn a player chooses how many dice to roll, from zero to ten. More dice raise the total but risk a bust: a single 1 makes the whole turn worth 1 point. Rolling zero dice scores from the digits of both players' scores, and landing on certain numbers jumps a player ahead to the next prime. The rules interact, so the best move depends on both scores, not just the odds.
- approach
The rules as small functions that compose. Dice are zero-argument functions, so fair dice and scripted test dice are interchangeable, and a strategy is any function from the two scores to a number of dice. An averaging wrapper replays any function thousands of times to estimate its expected value, which drives the sweeps over dice counts and the win rates between strategies. The final strategy checks the zero-dice payoff first, including any prime jump, then plays safer while ahead and riskier while behind.
- how
- title
Turn rules
- body
Rolling scores the sum unless a 1 appears. Rolling zero dice scores three times the gap between the opponent's tens digit and your ones digit, and at least 1.
- title
Prime Jump
- body
After every turn, a score with exactly three or four factors jumps to the next prime.
- title
Strategies as functions
- body
Each strategy maps the two scores to a number of dice, so strategies can be built, wrapped, and compared like any other value.
- title
Monte Carlo evaluation
- body
An averaging wrapper replays a turn or a whole game thousands of times to estimate expected scores and win rates.
- hard
- title
Rules that interact
- body
A zero-dice payoff can land on a jump number, so a move's true value is only known after both rules apply.
- title
Risk versus average
- body
Six dice give the best average turn, but with a lead a smaller, safer gain can be the better move.
- title
Fair comparisons
- body
Going first is an advantage, so every match-up is played from both seats and averaged.
- title
Digit edge cases
- body
Equal digits make zero dice worth 1 rather than 0, and scores under 10 have a tens digit of 0.
- title
Typing Autocorrect & WPM Tool
- category
software
- kind
text processing · UX logic
- slug
typing-autocorrect-and-wpm-tool
- area
software design
- outcome
A typing-speed test with live accuracy and words-per-minute scoring, plus an autocorrect that fixes near-miss words without touching unrelated ones.
- stack
Python
string algorithms
recursion
- problem
A typing tool has to measure people fairly, counting speed and accuracy the same way every time, and its autocorrect has to fix obvious slips without “correcting” words that were typed on purpose.
- approach
Accuracy compares typed words position by position against the prompt, and speed counts every five characters as a word. Autocorrect measures how far a typed word is from each dictionary word using recursive difference functions, picks the closest, and leaves the word alone when even the closest is beyond a set limit. Progress reports support racing several typists at once.
- how
- title
Words per minute
- body
Every five typed characters count as one word, divided by the elapsed minutes.
- title
Accuracy
- body
Each typed word is compared with the prompt word in the same position.
- title
Edit distance
- body
The fewest single-letter swaps, insertions, and deletions that turn one word into another.
- title
Correction limit
- body
Only words within the limit are corrected; anything farther is left as typed.
- hard
- title
Pruning the search
- body
Recursive difference functions stop early once a word is already past the limit, instead of exploring every edit.
- title
Ties
- body
When two words are equally close, the earlier one in the word list wins, so results are predictable.
- title
Extra or missing words
- body
One skipped word shifts every later comparison, and the score has to handle that consistently.
- title
Case and punctuation
- body
Input is normalized so capitalization and stray symbols don't count as typos.
- title
Ants Tower Defense Engine
- category
software
- kind
object-oriented game system
- slug
ants-tower-defense-engine
- area
software design
- outcome
The game logic for a tower-defense game in Python, where ants defend a colony from bees, built as a set of interacting classes.
- stack
Python
object-oriented design
inheritance
game loops
- problem
The game's behavior comes from many kinds of objects acting on each other: places linked into tunnels, ants with different costs and abilities, bees that move and sting, food, and win and loss conditions. Adding a new kind of ant shouldn't mean rewriting the turn loop.
- approach
A class hierarchy where shared behavior lives once: every insect has health and a place, every ant has a cost and blocks bees in its place, and each specialized ant overrides only its action or its stats. Places form linked tunnels from the colony to the hive. A turn loop lets every ant act, then every bee, then checks whether the colony or the bees have won.
- how
- title
Linked places
- body
Each place knows the next one toward the colony, so movement and range checks walk the tunnel.
- title
Inheritance
- body
Subclasses change only what makes them different, such as a thrower's range or a wall's health.
- title
Targeting
- body
Throwers search outward from their place for the nearest bee within their range.
- title
Containers
- body
Some ants can hold another ant in the same place and protect it from stings.
- hard
- title
Several bees in one place
- body
Targeting and damage need consistent rules when bees share a place.
- title
Removing insects mid-turn
- body
An insect that dies during a turn must leave the board without breaking the loop that's iterating over it.
- title
Range limits
- body
Short- and long-range throwers ignore bees outside their range.
- title
Protection
- body
A container and the ant it holds must interact correctly when either one is hurt or removed.
- title
Scheme Interpreter
- category
systems
- kind
programming languages
- slug
scheme-interpreter
- area
low-level systems
- outcome
A Scheme interpreter in Python, built around the classic read, eval, apply loop, with lexical and dynamic scope, special forms, and a REPL.
- stack
Python
interpreters
parsing
environments
- problem
An interpreter has to turn text into data, then evaluate that data in the right environment. Procedure calls create new frames, special forms like if and define must not evaluate their arguments the normal way, and scope rules decide which binding a name refers to.
- approach
A tokenizer and parser that turn source into nested pairs, an environment model of chained frames, and a recursive eval/apply pair at the core. Eval looks up symbols, returns self-evaluating values, dispatches special forms, and otherwise evaluates the operator and operands before handing them to apply. Apply runs built-ins directly, and user procedures by creating a child frame and evaluating the body there.
- how
- title
Read
- body
Source becomes tokens, then nested pairs, so code and data share one representation.
- title
Eval
- body
Symbols are looked up through the chain of frames; combinations evaluate their operator and operands, then apply.
- title
Apply
- body
A user procedure gets a new frame binding its parameters, then its body is evaluated in that frame.
- title
Two kinds of scope
- body
A lambda's frame extends the frame where it was defined; a mu procedure's frame extends the frame it was called from.
- hard
- title
Special forms
- body
define, if, cond, let, and, or, and quote each control which parts get evaluated, so they bypass normal evaluation.
- title
Frame parents
- body
Which frame a new frame points to is the entire difference between lexical and dynamic scope.
- title
Arity and errors
- body
Calling a procedure with the wrong number of arguments, or an unknown name, must raise a clear error instead of crashing.
- title
Higher-order built-ins
- body
map, filter, and reduce call back into the interpreter's own apply for every element.
- title
Snake Engine in C
- category
systems
- kind
C systems · game engine
- slug
snake-engine-in-c
- area
low-level systems
- outcome
A C engine that rebuilds Snake games from plain-text boards, advances them one tick at a time, and never reads past the end of a row, even when every row is a different length.
- stack
C11
heap memory
file I/O
Make
- problem
A board is just text: walls, food, and snakes drawn with direction characters, and its rows can be different lengths. The engine has to rebuild the game's state from that text, update it in place every tick, and write it back out exactly. In C, a short row or a missed free is a silent memory bug, not an exception.
- approach
The board is held as a char** with every row allocated separately, so ragged boards need no padding. Snakes are never listed in the file: the engine finds each tail, follows the direction characters to the head, and records the result in a snake_t. Each tick moves every live snake, grows it on food, kills it on a wall, a body, or a cell past the end of a row, and advances the tail only when the snake didn't eat. One cleanup path frees every row, the row array, and the snake records.
- how
- title
Ragged rows
- body
Each row keeps its own length, and every read goes through a bounds check against that row, so a missing cell behaves like a wall.
- title
Snakes from characters
- body
A tail (w a s d) starts a walk; body characters (^ < v >) point to the next segment until the walk reaches the head (W A S D).
- title
One tick
- body
Read the head's direction, compute the target cell, classify it as empty, food, or collision, rewrite the old head as body, then place the new head or mark it dead with x.
- title
Ownership
- body
The engine owns every row buffer, the row array, and the snake array, including temporary rows during loading; game_free releases all of them.
- hard
- title
Reading past a short row
- body
Space beyond a row's end is not memory to read. The engine treats it as a collision, as the ragged run shows.
- title
Growth versus movement
- body
Eating has to leave the tail in place for exactly one tick, or the snake grows by the wrong amount.
- title
Several snakes
- body
Each snake keeps its own record, so moving one never corrupts another; a head-on meeting kills both.
- title
Exact round trips
- body
Saving must preserve every space and row length so a board reloads identically.
- title
RISC-V Handwritten Digit Classifier
- category
systems
- kind
assembly · ML systems
- slug
risc-v-handwritten-digit-classifier
- area
low-level systems
- outcome
A handwritten-digit classifier's inference pass written entirely in RISC-V assembly: matrix loading, multiplication, ReLU, and argmax, with every load, call, and allocation explicit.
- stack
RISC-V assembly
calling convention
heap memory
binary file I/O
- problem
In a high-level language, running a small neural network is a few lines. In assembly, every matrix has to be read from a file into memory you allocated, every function call has to save and restore the right registers, and every bad dimension or failed allocation needs a defined exit code.
- approach
A set of small kernels — absolute value, ReLU, argmax, a strided dot product, and matrix multiplication built on it — plus loaders and writers for binary matrix files. A top-level classify routine chains them: hidden = ReLU(m0 · input), scores = m1 · hidden, and the class is the argmax of the scores. Each function follows the RISC-V calling convention and validates its arguments.
- how
- title
Strided dot product
- body
One kernel walks two vectors with independent strides, so the same code reads a matrix row or a column.
- title
Matrix multiplication
- body
Built from the dot product: each output cell is a row of the left matrix dotted with a column of the right.
- title
Binary matrix files
- body
Matrices are read from files into heap memory sized from their header, and results are written back the same way.
- title
Classification
- body
ReLU zeroes negative hidden values in place, and argmax returns the first index of the highest score.
- hard
- title
Calling convention
- body
Nested calls must save exactly the registers the convention requires, or a caller's values are silently corrupted.
- title
Memory management
- body
Every matrix is heap-allocated, so failed allocations are caught and every buffer is freed on every path.
- title
Error paths
- body
Mismatched dimensions, bad lengths, and failed file reads each exit with their own defined code.
- title
Ties
- body
argmax has to return the first index when scores tie, which takes care in the comparison.
- title
RISC-V CPU Datapath
- category
systems
- kind
computer architecture
- slug
risc-v-cpu-datapath
- area
low-level systems
- outcome
A RISC-V CPU built gate by gate in Logisim that runs real programs: program counter, instruction memory, register file, ALU, immediate generation, branches and jumps, data memory, and control logic.
- stack
Logisim
RISC-V
digital logic
computer architecture
- problem
A processor has to turn 32 bits of instruction into the right actions: which registers to read, which immediate to build, what the ALU computes, whether memory is read or written, what gets written back, and where the program goes next. Every one of those choices is a wire and a control signal that has to be set correctly for every instruction.
- approach
A datapath of standard blocks connected through multiplexers, with control logic that decodes each instruction's opcode and function bits into the settings for every mux, the ALU, memory, and the register file. Branch comparison and jump targets feed the next-PC logic, and immediate generation handles each instruction format's scattered bits.
- how
- title
Fetch
- body
The program counter addresses instruction memory, and PC + 4 is ready as the default next address.
- title
Decode
- body
Register numbers are read from fixed bit positions, and the immediate generator reassembles each format's bits.
- title
Execute
- body
The ALU combines a register or the PC with a register or an immediate; branches compare two registers.
- title
Memory and write-back
- body
Loads and stores use the ALU's address, and a mux picks the ALU result, loaded data, or PC + 4 to write back.
- hard
- title
Immediates
- body
Branch and jump formats scatter their immediate bits across the instruction, and they have to be reassembled and sign-extended exactly.
- title
Branch targets
- body
Targets are relative to the current PC, so the ALU input has to switch between a register and the PC.
- title
Control conflicts
- body
Every control signal must have a defined value for every instruction, or two paths fight over a wire.
- title
Write-back source
- body
Choosing between the ALU result, memory, and PC + 4 is a common source of subtle bugs, especially for jumps.
- title
Vectorized C Matrix Library
- category
systems
- kind
performance engineering
- slug
vectorized-c-matrix-library
- area
low-level systems
- outcome
A NumPy-style matrix library in C, sped up with SIMD vector instructions, OpenMP threads, and smarter algorithms.
- stack
C
SIMD intrinsics
OpenMP
memory management
- problem
Matrix operations are easy to write and slow by default. Real speed depends on how the data is laid out in memory, how many elements each instruction handles, how work splits across cores, and whether the algorithm does more multiplications than it needs to. Slices add a memory question: several matrices can share one block of data.
- approach
Matrices stored row-major in a single allocation, with slices that point into their parent's data and a reference count so memory is freed exactly once. Element-wise operations, multiplication, and exponentiation were then optimized: vector instructions process several values per step with a scalar loop for the leftovers, outer loops are split across threads, and powers are computed by repeated squaring.
- how
- title
Row-major storage
- body
Element (i, j) lives at index i × columns + j in one flat array, so walking a row reads consecutive memory.
- title
Shared slices
- body
A slice points into its parent's data instead of copying it, and a reference count tracks how many matrices use that memory.
- title
Vectors and threads
- body
SIMD handles several elements per instruction, and OpenMP splits rows across cores.
- title
Fast powers
- body
Repeated squaring computes A^n with work proportional to the number of bits in n, not n itself.
- hard
- title
Leftover elements
- body
When a row's length isn't a multiple of the vector width, the remainder needs its own scalar loop.
- title
Slice lifetimes
- body
Freeing a parent while a slice still uses its data must not release the memory early.
- title
Allocation failures
- body
Every allocation can fail, so each operation checks and reports errors instead of crashing.
- title
Edge cases
- body
Invalid dimensions and powers of 0 and 1 all need defined results.
- title
Pacman Search Planner
- category
ai
- kind
graph search · path planning
- slug
pacman-search-planner
- area
ai systems
- outcome
Search agents that plan Pacman's route through a maze with depth-first, breadth-first, uniform-cost, and A* search, plus state designs for visiting every corner and eating every dot.
- stack
Python
graph search
heuristics
- problem
Getting Pacman to a goal is a search problem, but the right search depends on the question. The fewest moves, the cheapest route over costly ground, and a route that visits all four corners or eats every dot each call for a different algorithm or a different idea of what a state is.
- approach
One graph-search loop with a pluggable frontier: a stack for depth-first, a queue for breadth-first, and a priority queue for uniform-cost and A*. Each search keeps an explored set and rebuilds the path from parent links. Beyond reaching a single point, I designed search problems whose states carry memory, such as which corners have been visited or which food remains, and wrote heuristics that keep A* optimal while expanding far fewer states.
- how
- title
Frontiers
- body
The same loop becomes four algorithms by changing how the next state is chosen: newest, oldest, cheapest, or cheapest plus an estimate of what remains.
- title
Explored set
- body
Each state is expanded at most once, which turns tree search into graph search and stops cycles.
- title
Richer states
- body
For the corner and food problems a state is a position plus what has been collected, so the same search answers a harder question.
- title
Heuristics
- body
Manhattan and true maze distances estimate the remaining cost without ever overestimating it, which keeps A* optimal.
- hard
- title
Admissible and consistent
- body
A heuristic that overestimates even once can make A* return a worse path.
- title
State explosion
- body
Tracking the remaining food multiplies the number of states, so the heuristic has to do real work.
- title
Moves versus cost
- body
Breadth-first finds the fewest moves, which is not the cheapest route when some cells cost more.
- title
Repeated states
- body
Without an explored set the search can loop forever between neighbouring cells.
- title
Pacman Multi-Agent Planner
- category
ai
- kind
adversarial search · game-tree planning
- slug
pacman-multi-agent-planner
- area
ai systems
- outcome
Game-playing agents that choose Pacman's moves while the ghosts move too, using minimax, alpha-beta pruning, expectimax, and a hand-built evaluation function.
- stack
Python
minimax
alpha-beta
expectimax
- problem
Once the ghosts move too, Pacman's best move depends on what they will do. If a ghost plays perfectly, Pacman should guard against the worst case; if it moves at random, that caution throws away points. The search also has to stop somewhere, so an unfinished board still needs a score.
- approach
A multi-agent search that alternates between Pacman, who maximizes, and every ghost in turn, who minimizes, counting depth only after all agents have moved. Alpha-beta pruning cuts branches that cannot change the decision, and expectimax replaces the minimizing ghosts with chance nodes that average their moves. A feature-based evaluation function scores unfinished boards from food, capsules, and ghost distances.
- how
- title
Turn order
- body
Each ply cycles through Pacman and then every ghost; depth increases only when the cycle completes.
- title
Pruning
- body
Alpha-beta tracks the best value each side can already guarantee and stops exploring a move once it can't matter, without changing the result.
- title
Chance nodes
- body
Expectimax averages over the ghosts' moves, so Pacman takes sensible risks against ghosts that don't play perfectly.
- title
Evaluation
- body
A weighted score of nearby food, remaining food and capsules, active ghosts close by, and scared ghosts within reach.
- hard
- title
Depth with many agents
- body
Every ghost adds a layer to each ply, so each extra level of lookahead gets expensive quickly.
- title
Scared ghosts
- body
A ghost that is dangerous one moment is worth chasing the next, so the evaluation has to flip how it treats them.
- title
Standing still
- body
Stopping can look safe to the search, so it needs a small penalty.
- title
Wins and losses
- body
Terminal states end the search early and must outrank any ordinary evaluation.
- title
Reinforcement Learning Agents
- category
ai
- kind
MDPs · RL
- slug
reinforcement-learning-agents
- area
ai systems
- outcome
Agents that learn how to act in an uncertain grid world: planning with value iteration when the rules are known, and learning with Q-learning when they are not.
- stack
Python
MDPs
value iteration
Q-learning
- problem
When moves sometimes slip, the best action depends on long-term consequences, not just the next step. An agent that knows the rules can plan ahead; one that doesn't has to learn by trial and error, balancing trying new actions against using what it already knows.
- approach
A value-iteration agent that runs batch Bellman backups over every state, derives Q-values from the values, and extracts a greedy policy. A Q-learning agent that learns the same Q-values from sampled moves with epsilon-greedy exploration, and an approximate version that learns feature weights so it generalizes to states it has never seen. I also tuned discount, noise, and the reward per step to produce specific target behaviors.
- how
- title
Bellman backups
- body
Each sweep updates every state from the previous sweep's values, so value spreads one step further from the exits each time.
- title
Q from values
- body
An action's worth is the expected reward plus the discounted value of wherever it might land, slips included.
- title
Learning from experience
- body
Q-learning nudges each estimate toward the reward it just received plus the best estimate from the next state.
- title
Approximate Q-learning
- body
Describing states with weighted features lets what is learned in one state carry over to similar ones.
- hard
- title
Exploration
- body
Too little exploration locks in a bad habit; too much never makes use of what was learned.
- title
Shaping behavior
- body
Small changes to discount, noise, or the reward per step flip whether the agent takes a risky shortcut or plays safe.
- title
Unseen actions
- body
Untried actions start at zero, so tie-breaking decides how the agent behaves early on.
- title
Planning versus learning
- body
Learned values only approach what planning computes once there has been enough experience.
- title
Probabilistic Ghost Tracking
- category
ai
- kind
Bayes nets · HMM inference
- slug
probabilistic-ghost-tracking
- area
ai systems
- outcome
Inference agents that track invisible ghosts from noisy distance readings, using exact Bayesian updates over time and a particle filter that scales to several ghosts at once.
- stack
Python
Bayes nets
hidden Markov models
particle filtering
- problem
Pacman can't see the ghosts. Each turn it hears a noisy reading of how far away each one is, and the ghosts keep moving. Tracking them means keeping a belief over every possible position and updating it correctly as time passes and new evidence arrives.
- approach
Factor operations for Bayes nets (join, eliminate, normalize) and variable elimination for answering queries. For tracking over time, an exact filter that alternates a time step (where could the ghost have moved?) with an observation step (how likely is this reading from each position?), and a particle filter that represents the belief with samples so it scales to several ghosts.
- how
- title
Time passes
- body
Each position's probability spreads over the cells the ghost could move to next.
- title
A reading arrives
- body
Every position is weighted by how likely the reading would be from there, then the belief is renormalized.
- title
Particles
- body
Samples stand in for the belief: move them like the ghost, weight them by the reading, and resample.
- title
Variable elimination
- body
Queries on a Bayes net join and sum out factors in a good order instead of building the full joint table.
- hard
- title
Zero-weight collapse
- body
If every particle gets weight zero, the filter has to start over from a uniform belief instead of dividing by zero.
- title
Captured ghosts
- body
A ghost sent to jail has a known position, which has to override what the sensor says.
- title
Several ghosts
- body
Tracking ghosts jointly multiplies the number of states, which is where the particle filter earns its keep.
- title
Staying normalized
- body
The belief has to remain a valid probability distribution after every update.
- title
Neural Models for Classification
- category
ai
- kind
machine learning
- slug
neural-models-for-classification
- area
ai systems
- outcome
Neural networks built up from the basics in PyTorch: a perceptron, a regression network, digit and language classifiers, a hand-written convolution, and an attention layer.
- stack
Python
PyTorch
neural networks
- problem
Different tasks need different architectures. Classifying handwritten digits, fitting a smooth function, and telling which language a word comes from each need the right inputs, layers, loss, and training loop before a model learns anything useful.
- approach
A progression of models, each with its own training loop, loss, and validation: a perceptron that learns a linear boundary, a regression network that fits a continuous function, a multilayer digit classifier, a recurrent model that reads words character by character to identify their language, a convolutional digit model built on a convolution I implemented by hand, and an attention layer.
- how
- title
Perceptron
- body
Updates its weights only on mistakes, and converges whenever the classes can be split by a line.
- title
Deeper networks
- body
Stacked layers with nonlinearities learn curved boundaries that a single layer can't.
- title
Characters to language
- body
A recurrent model folds a word's characters into one hidden state, so words of any length get a fixed-size summary.
- title
Convolution and attention
- body
A hand-written convolution slides a small filter across an image; attention lets a model weigh which inputs matter most.
- hard
- title
Overfitting
- body
A network can memorize its training data, so validation accuracy decides when to stop.
- title
Learning rates
- body
Too high and training diverges; too low and it crawls.
- title
Variable-length input
- body
Words have different lengths, so batches have to be shaped with care.
- title
Imbalanced classes
- body
Rarer languages and digits pull less weight during training unless that is accounted for.
- title
Memory Safety Exploitation Lab
- category
security
- kind
binary exploitation · stack internals
- slug
memory-safety-exploitation-lab
- area
security
- outcome
A study of six classic memory-safety bug classes in C, each examined at the stack level and mapped to the defense that prevents it.
- stack
C
x86
GDB
stack internals
- problem
Memory-safety bugs remain among the most damaging flaws in C and C++ software, and each one comes down to a single wrong assumption: a length believed to be bounded, a buffer believed to be large enough, a string believed to be plain data. Understanding them well enough to prevent them means looking at the stack directly, not just reading about it.
- approach
Six deliberately vulnerable teaching programs, each isolating one bug class. For each, I identified the assumption the code got wrong, confirmed the stack layout in a debugger, and matched the class to the mitigation that closes it. The work is defense-oriented: the goal is the intuition for writing and reviewing safe code.
- how
- title
Anatomy of a frame
- body
A function's local buffer sits just below the stack canary, the saved frame pointer, and the saved return address, the data a function needs to return safely.
- title
One class, one weak spot
- body
Each bug class puts a different part of the frame at risk, which is what decides the right fix.
- title
Secrets behind defenses
- body
A stack canary only works while its value stays secret, so a memory leak is itself a vulnerability.
- title
Defense in depth
- body
Bounds checks, canaries, address randomization, and a non-executable stack each block a different step, so no single bug is enough.
- hard
- title
Signed lengths
- body
A length check is only as strong as its type. Lengths should be unsigned and checked against both bounds.
- title
Off-by-one
- body
A single ≤ where < was meant is enough to corrupt saved state, which is the case for bounds-checked APIs over hand-written loops.
- title
Format strings
- body
User text must never be used as a format string. The fix is printf("%s", input), a two-character change.
- title
Leaks undo layers
- body
Canaries and address randomization both depend on secrets staying secret, so preventing leaks protects every other layer.
- title
Cryptographic File Sharing System
- category
security
- kind
secure storage · applied cryptography
- slug
cryptographic-file-sharing-system
- area
security
- outcome
An end-to-end encrypted file storage and sharing client that stays secure even when the server storing the data is malicious.
- stack
Go
AES
HMAC
RSA
digital signatures
Argon2
- problem
A storage service should keep files private and intact even if the server itself reads, alters, reorders, or deletes what it holds. Sharing makes it harder: people need to be able to re-share files, and someone whose access is revoked must be locked out for good, even though they once held valid keys.
- approach
A client built with a partner from basic cryptographic building blocks, with no trusted server logic. All keys descend from a password-derived root, every stored object is encrypted and then authenticated, and access control lives entirely in who holds which key. A layer of main file nodes, one per direct recipient, makes sharing and revocation simple, and files are stored as a backwards linked list so appends cost the same no matter how large the file grows.
- how
- title
Untrusted storage
- body
Every object is encrypted and authenticated, so the server sees only ciphertext and any change it makes is detected on read.
- title
One root key
- body
Argon2 turns the password into a root key; separate subkeys protect each kind of object, and logging in simply means the keys decrypt correctly.
- title
Sharing
- body
Invitations are encrypted to the recipient's public key and signed by the sender, and each direct recipient gets their own main file node.
- title
Revocation
- body
Revoking re-encrypts the file under a fresh key given only to people still allowed, and anyone the revoked user had shared with loses access too.
- hard
- title
A malicious server
- body
Tampering has to fail loudly with an error, never silently hand back altered data.
- title
Constant-cost appends
- body
Appending must not get slower with file size, the number of files, or the number of people a file is shared with.
- title
Revoked users keep old keys
- body
Someone who was revoked still holds their old keys, so the file has to move to keys they never saw.
- title
Edge cases in sharing
- body
Revoking before an invitation is accepted, sharing twice, and revoking as a non-owner all need clear, safe outcomes.
- title
Vulnerable Web Server Breach Lab
- category
security
- kind
web exploitation · trust boundary analysis
- slug
vulnerable-web-server-breach-lab
- area
security
- outcome
A security review of a deliberately vulnerable file-hosting web app: six flaws across injection, cross-site scripting, and file access, each traced to the trust boundary it crossed and the fix that closes it.
- stack
HTTP
SQL
JavaScript
web security
- problem
Web apps break where user input crosses a trust boundary without being checked: into a database query, into a page's HTML, or into a file path. A single missing check at any of those points can expose other users' data or the server's own files.
- approach
A defense-oriented analysis of a teaching application in a sandboxed lab. For each of six flaws I identified the boundary where untrusted input was treated as trusted, confirmed the issue, and mapped it to the control that enforces that boundary: parameterized queries, output encoding, CSRF tokens, strong password hashing, and path canonicalization.
- how
- title
Map the boundaries
- body
Browser to server, server to database, database back to the page, and server to the file system are each places where data must be checked.
- title
Injection
- body
Queries built by pasting in user text let that text act as SQL. Parameterized queries keep input as data.
- title
Cross-site scripting
- body
Text shown as raw HTML can run as code in another user's browser. Encoding output, plus a Content Security Policy, prevents it.
- title
Files and passwords
- body
Paths are resolved and confirmed to stay inside the files folder, and passwords are stored with a slow, salted hash.
- hard
- title
Filters aren't fixes
- body
Blocking suspicious characters never reliably stops injection; the fix has to be structural.
- title
Context matters
- body
The same text needs different encoding in HTML, attributes, and URLs, so output encoding depends on where data lands.
- title
Flaws compound
- body
Each issue was small, but together they reached from an anonymous visitor to admin access, which is why every boundary matters.
- title
Hashes leak
- body
A database can be exposed, so password storage has to stay safe even then. Fast, unsalted hashes don't.
- title
Traceroute Implementation
- category
networks
- kind
packet-level networking
- slug
traceroute-implementation
- area
networking
- outcome
A from-scratch traceroute that maps the routers between you and a host by reading raw IPv4, ICMP, and UDP headers byte by byte.
- stack
Python
raw sockets
IPv4
ICMP
UDP
- problem
The internet doesn't tell you the path your packets take. Traceroute uncovers it by sending probes that expire at each router in turn, but the replies arrive over a best-effort network: they get lost, duplicated, delayed, and mixed in with unrelated traffic.
- approach
Probes go out with increasing time-to-live values, up to three per hop, each on its own UDP port. Every response is parsed from raw bytes and checked before it's trusted: it must be the right kind of ICMP message, it must quote a probe sent to the target, and the quoted port must belong to a probe still waiting for an answer. The trace ends when the destination itself replies that the port is unreachable.
- how
- title
Expiring probes
- body
Each router lowers a packet's TTL by one; the router where it hits zero sends back a time-exceeded error, revealing its address.
- title
Parsing by hand
- body
IPv4, ICMP, and UDP headers are unpacked from bytes in network order, including the split nibbles and bit fields.
- title
Matching replies
- body
An error message quotes the header of the probe that caused it, so a unique port per probe ties every reply to its probe.
- title
Knowing when to stop
- body
The destination answers with port unreachable instead of time exceeded, which marks the end of the path.
- hard
- title
Loss
- body
A hop can stay silent, so each TTL is retried and a missing reply never stalls the trace.
- title
Unrelated traffic
- body
The raw socket sees every ICMP packet reaching the machine, so anything not tied to an outstanding probe is dropped.
- title
Duplicates
- body
Once a probe is matched it's removed from the waiting set, so a second reply for it is ignored.
- title
Malformed packets
- body
Short or truncated buffers are rejected before parsing, so bad input can't produce garbage reads or a crash.
- title
Distance-Vector Routing Protocol
- category
networks
- kind
distributed routing
- slug
distance-vector-routing-protocol
- area
networking
- outcome
A distance-vector router, the protocol family behind RIP, that builds its forwarding table purely from what its neighbors advertise.
- stack
Python
Bellman-Ford
routing protocols
- problem
No router sees the whole network. Each one only knows its own links and what its neighbors tell it, yet every router has to agree on shortest paths, and stay correct when links go up and down. The classic failure is count-to-infinity: after a link fails, routers keep each other's stale routes alive and the cost creeps upward for many rounds.
- approach
A router that keeps, for every destination, a next hop and a total cost. It advertises its table to its neighbors, adopts any strictly better route it hears, and always trusts updates from its current next hop. Routes expire when they stop being refreshed. On top of that sit the standard defenses, each switchable: split horizon, poison reverse, route poisoning, and triggered updates, plus incremental advertisements so a quiet network stays quiet.
- how
- title
Bellman-Ford, distributed
- body
Hearing “I reach D at cost c” over a link of cost l means D is reachable at c + l through that neighbor.
- title
Trusting the next hop
- body
An update from the neighbor you already route through always wins, even when the news is worse, because that neighbor is the authority on the path.
- title
Expiry
- body
A route that isn't refreshed within its time limit is removed, or advertised as unreachable so neighbors learn quickly.
- title
Loop defenses
- body
Split horizon and poison reverse stop a router from advertising a route back to where it came from, and triggered updates spread changes immediately.
- hard
- title
Count to infinity
- body
Without defenses, two routers can keep a dead route alive by trusting each other, with the cost climbing a little each round.
- title
Ties
- body
Equal-cost routes keep the incumbent, so paths don't flap back and forth between equally good choices.
- title
Links going up and down
- body
A new link triggers a full advertisement to the new neighbor; a failed one invalidates every route that used it.
- title
Quiet steady state
- body
Only routes that changed since the last advertisement are re-sent, so a stable network doesn't keep repeating itself.
- title
TCP-like Reliable Transport Layer
- category
networks
- kind
transport protocol
- slug
tcp-like-reliable-transport-layer
- area
networking
- outcome
The core of TCP: a reliable, ordered byte stream built on a network that drops, duplicates, reorders, and delays packets.
- stack
Python
TCP
RFC 793
RFC 6298
- problem
Applications expect a clean, ordered stream of bytes, but the network underneath only delivers individual packets, and not reliably. Bridging the two means naming every byte, noticing what's missing, re-sending it at the right time, and opening and closing connections cleanly.
- approach
A socket that implements TCP's connection state machine, 32-bit sequence numbers that compare correctly across wraparound, in-order delivery with buffering for early arrivals, acknowledgement processing with a retransmission queue, an adaptive retransmission timer from RFC 6298, and the full teardown handshake for both sides.
- how
- title
Sequence numbers
- body
Every byte has a number, and comparisons use modular arithmetic so they stay correct when the 32-bit space wraps around.
- title
In-order delivery
- body
Segments that arrive early are buffered, and the receiver keeps acknowledging the last in-order byte until the gap is filled.
- title
Retransmission queue
- body
Sent segments wait in a queue until acknowledged; each ACK releases everything it covers and feeds a round-trip sample to the timer.
- title
Adaptive timer
- body
The timeout tracks the smoothed round-trip time plus its variation, and doubles after each timeout.
- hard
- title
When is a packet lost?
- body
Re-sending too early floods the network; too late stalls the connection. The timer has to adapt to each connection.
- title
Wraparound
- body
Ordinary integer comparisons break when sequence numbers wrap, so every comparison goes through modular operators.
- title
Teardown
- body
A FIN takes up a sequence number and must itself be acknowledged and retransmitted, through several closing states.
- title
Duplicates
- body
Data that arrives twice, or partly overlaps what was already received, must be trimmed so the app never sees a byte twice.
My thinkers
- id
systems
- label
systems & computation
- cx
210
- cy
175
- nodes
- name
von Neumann
- take
the root layer of everything: computation, game theory, nuclear strategy, and machine intelligence as one continuous problem.
- wiki
https://en.wikipedia.org/wiki/John_von_Neumann
- name
Turing
- take
the origin of computation, AI, and codebreaking, and the question still unanswered: can machines think?
- wiki
https://en.wikipedia.org/wiki/Alan_Turing
- name
Shannon
- take
reduced communication to signal, noise, and entropy: that kind of clean reduction is rare.
- wiki
https://en.wikipedia.org/wiki/Claude_Shannon
- name
Gödel
- take
even the most rigorous systems contain truths they can't prove from inside themselves.
- wiki
https://en.wikipedia.org/wiki/Kurt_G%C3%B6del
- name
Bellman
- take
dynamic programming as a model of agency: every decision reshapes the state, the future built recursively from the present.
- wiki
https://en.wikipedia.org/wiki/Richard_E._Bellman
- name
Wiener
- take
cybernetics: feedback, control, biology, and machines as one framework, before 'intelligent systems' was even a category.
- wiki
https://en.wikipedia.org/wiki/Norbert_Wiener
- name
Simon
- take
intelligence under real constraints: bounded rationality, incomplete information, limited time.
- wiki
https://en.wikipedia.org/wiki/Herbert_A._Simon
- name
Kauffman
- take
how order emerges from chaos with no one designing it: that question shows up everywhere once you look.
- wiki
https://en.wikipedia.org/wiki/Stuart_Kauffman
- id
strategy
- label
strategy & conflict
- cx
790
- cy
175
- nodes
- name
Schelling
- take
the invisible mechanics of conflict: threats, signals, and credibility move people more than raw power does.
- wiki
https://en.wikipedia.org/wiki/Thomas_Schelling
- name
Clausewitz
- take
war as politics under uncertainty: friction, morale, and chance; conflict as fundamentally human.
- wiki
https://en.wikipedia.org/wiki/Carl_von_Clausewitz
- name
Luttwak
- take
strategy is paradoxical: strength breeds vulnerability, victory breeds complacency, the obvious move backfires.
- wiki
https://en.wikipedia.org/wiki/Edward_Luttwak
- name
Mackinder
- take
power at geographic scale: land, sea, chokepoints; the physical world outlasts any single leader.
- wiki
https://en.wikipedia.org/wiki/Halford_Mackinder
- name
Napoleon
- take
strategy, speed, and administrative genius fused with historical will: the org innovations mattered as much as the battles.
- wiki
https://en.wikipedia.org/wiki/Napoleon
- name
Kissinger
- take
diplomacy through history and tragedy: order is fragile, legitimacy matters, good intentions have limits.
- wiki
https://en.wikipedia.org/wiki/Henry_Kissinger
- id
institutions
- label
institutions & order
- cx
210
- cy
505
- nodes
- name
Hayek
- take
knowledge is scattered and local: no central planner can see what millions know individually.
- wiki
https://en.wikipedia.org/wiki/Friedrich_Hayek
- name
Scott
- take
states fail when they make society legible on paper but miss how things work on the ground.
- wiki
https://en.wikipedia.org/wiki/James_C._Scott
- name
Olson
- take
why groups stay stuck even when coordination would help everyone: the incentives are the logic, not a bug.
- wiki
https://en.wikipedia.org/wiki/Mancur_Olson
- name
Hirschman
- take
exit, voice, loyalty: how people and institutions respond when things start breaking down.
- wiki
https://en.wikipedia.org/wiki/Albert_O._Hirschman
- name
Lee Kuan Yew
- take
statecraft as execution: institutions, incentives, and discipline actually made real.
- wiki
https://en.wikipedia.org/wiki/Lee_Kuan_Yew
- id
nation
- label
nation & sovereignty
- cx
790
- cy
505
- nodes
- name
Pinsker
- take
cold and diagnostic: Jewish insecurity as a structural condition that needs power, not sympathy or patience.
- wiki
https://en.wikipedia.org/wiki/Leon_Pinsker
- name
Jabotinsky
- take
dignity and survival require power, not appeals: hard realism about what self-determination demands.
- wiki
https://en.wikipedia.org/wiki/Ze%27ev_Jabotinsky
- name
Ahad Ha'am
- take
national revival as a cultural and spiritual question: without that foundation the project hollows out.
- wiki
https://en.wikipedia.org/wiki/Ahad_Ha%27am
- name
Scholem
- take
rescued Jewish mysticism from folklore into a serious tradition with real historical weight.
- wiki
https://en.wikipedia.org/wiki/Gershom_Scholem
- name
Strauss
- take
philosophy as dangerous and layered: the real argument isn't always the surface one.
- wiki
https://en.wikipedia.org/wiki/Leo_Strauss
- id
builders
- label
builders & technology
- cx
500
- cy
150
- nodes
- name
Licklider
- take
imagined computers as partners in thought: augmentation, not just automation, before most knew what a computer was.
- wiki
https://en.wikipedia.org/wiki/J._C._R._Licklider
- name
Jobs
- take
technology wins through taste, narrative, and psychology: making complexity feel simple is its own engineering.
- wiki
https://en.wikipedia.org/wiki/Steve_Jobs
- name
Thiel
- take
secrets and monopolies: what hidden assumptions hold back progress, and what it takes to build something that lasts.
- wiki
https://en.wikipedia.org/wiki/Peter_Thiel
- name
Jensen Huang
- take
saw the infrastructure layer first: GPUs and accelerated computing as the foundation of the AI era.
- wiki
https://en.wikipedia.org/wiki/Jensen_Huang
- id
human
- label
history & the human
- cx
500
- cy
530
- nodes
- name
Hegel
- take
history driven by contradiction and struggle, not smooth progress: ideas evolve through conflict.
- wiki
https://en.wikipedia.org/wiki/Georg_Wilhelm_Friedrich_Hegel
- name
Ibn Khaldun
- take
civilization as a cycle: cohesion, conquest, luxury, decay, renewal; systems thinking in the 14th century.
- wiki
https://en.wikipedia.org/wiki/Ibn_Khaldun
- name
Feynman
- take
real technical depth plus the instinct to cut through fake complexity: he wanted things to actually make sense.
- wiki
https://en.wikipedia.org/wiki/Richard_Feynman
My reads — Reading Atlas
Book coordinates are interpretive placements, not objective measurements.
- id
plato-republic
- title
The Republic
- author
Plato
- published
-375
- concepts
justice
knowledge
political order
forms
education
- region
knowing
- note
every fight about how to run a society is really a fight about what people are.
- id
dostoevsky-crime-punishment
- title
Crime and Punishment
- author
Fyodor Dostoevsky
- published
1866
- concepts
guilt
morality
agency
conscience
alienation
- region
meaning
- note
you can talk yourself into almost anything on paper. living with it is the hard part.
- id
dostoevsky-brothers-karamazov
- title
The Brothers Karamazov
- author
Fyodor Dostoevsky
- published
1880
- concepts
faith
freedom
evil
responsibility
family
- region
meaning
- note
ivan makes the best case against god i've read, and dostoevsky never cheats to beat it.
- id
dostoevsky-underground
- title
Notes from Underground
- author
Fyodor Dostoevsky
- published
1864
- concepts
rationality
spite
freedom
self-consciousness
modernity
- region
meaning
- note
people will act against their own interest just to prove nobody controls them. i see it everywhere now.
- id
nietzsche-zarathustra
- title
Thus Spoke Zarathustra
- author
Friedrich Nietzsche
- published
1883
- concepts
values
self-overcoming
meaning
morality
nihilism
- region
meaning
- note
basically a dare to stop borrowing your values and build your own.
- id
nietzsche-beyond-good-evil
- title
Beyond Good and Evil
- author
Friedrich Nietzsche
- published
1886
- concepts
morality
perspectivism
power
truth
values
- region
meaning
- note
made me ask who benefits from a moral idea before asking if it's true.
- id
machiavelli-prince
- title
The Prince
- author
Niccolò Machiavelli
- published
1532
- concepts
power
statecraft
strategy
legitimacy
political action
- region
power
- note
the first book i read that talks about power the way people actually use it.
- id
hobbes-leviathan
- title
Leviathan
- author
Thomas Hobbes
- published
1651
- concepts
sovereignty
social contract
order
fear
state
- region
power
- note
order isn't the default. someone has to hold it together, and that costs something.
- id
marx-manuscripts
- title
Economic and Philosophic Manuscripts of 1844
- author
Karl Marx
- published
1844
- concepts
alienation
labor
materialism
human nature
capital
- region
power
- note
the part about work making people strangers to themselves hit harder than any of the economics.
- id
descartes-meditations
- title
Meditations on First Philosophy
- author
René Descartes
- published
1641
- concepts
certainty
skepticism
mind
knowledge
method
- region
knowing
- note
doubt everything until something won't move. great method, even if i don't buy where he lands.
- id
hume-enquiry
- title
An Enquiry Concerning Human Understanding
- author
David Hume
- published
1748
- concepts
causation
induction
skepticism
experience
knowledge
- region
knowing
- note
we never actually see one thing cause another. i still think about that more than i should.
- id
kant-pure-reason
- title
Critique of Pure Reason
- author
Immanuel Kant
- published
1781
- concepts
epistemology
categories
experience
reason
limits
- region
knowing
- note
your mind isn't a camera. it shapes what you see before you get a say.
- id
kuhn-structure
- title
The Structure of Scientific Revolutions
- author
Thomas S. Kuhn
- published
1962
- concepts
paradigm
science
model revision
institutions
progress
- region
knowing
- note
science doesn't just pile up facts. it swaps out whole frameworks, and people fight it every time.
- id
popper-conjectures
- title
Conjectures and Refutations
- author
Karl Popper
- published
1963
- concepts
falsification
science
criticism
knowledge
error correction
- region
knowing
- note
you can't prove you're right, only fail to prove you're wrong. so go looking for where you're wrong.
- id
wiener-cybernetics
- title
Cybernetics
- author
Norbert Wiener
- published
1948
- concepts
feedback
control
information
communication
systems
- region
knowing
- note
once you see feedback loops you see them everywhere, in thermostats, people, and governments.
- id
simon-sciences-artificial
- title
The Sciences of the Artificial
- author
Herbert A. Simon
- published
1969
- concepts
design
bounded rationality
systems
complexity
artificial
- region
knowing
- note
nobody actually optimizes. we settle for good enough, and that's how anything gets built.
- id
scott-seeing-state
- title
Seeing Like a State
- author
James C. Scott
- published
1998
- concepts
legibility
state
planning
local knowledge
institutions
- region
societies
- note
simplify a messy system to fit a spreadsheet and you usually break the part that made it work.
- id
anderson-imagined-communities
- title
Imagined Communities
- author
Benedict Anderson
- published
1983
- concepts
nationalism
identity
print
community
history
- region
societies
- note
a nation is millions of strangers who feel connected because they read the same news.
- id
fukuyama-origins-order
- title
The Origins of Political Order
- author
Francis Fukuyama
- published
2011
- concepts
institutions
state
law
accountability
political development
- region
societies
- note
a strong state, the rule of law, and leaders who answer to someone. you need all three, and they rarely show up together.
- id
hertzberg-zionist-idea
- title
The Zionist Idea
- author
Arthur Hertzberg
- published
1959
- concepts
zionism
nationhood
history
political thought
identity
- region
societies
- note
zionism was never one idea. it was a century of people arguing about what it should be.
- id
pinsker-auto-emancipation
- title
Auto-Emancipation
- author
Leon Pinsker
- published
1882
- concepts
emancipation
nationhood
agency
security
political action
- region
societies
- note
nobody is coming to save you, so build it yourself. cold, but hard to argue with.
- id
diamond-guns-germs-steel
- title
Guns, Germs, and Steel
- author
Jared Diamond
- published
1997
- concepts
geography
development
causation
civilization
history
- region
societies
- note
a lot of what looks like destiny is just geography. i don't buy all of it, but it changed my questions.
- id
harari-sapiens
- title
Sapiens
- author
Yuval Noah Harari
- published
2011
- concepts
humanity
institutions
myth
cooperation
history
- region
societies
- note
money, nations, and companies only work because millions of people believe the same story at once.
- id
sun-tzu-art-war
- title
The Art of War
- author
Sun Tzu
- published
-500
- concepts
strategy
uncertainty
deception
conflict
adaptation
- region
power
- note
most of the winning happens before anyone moves.
- id
homer-odyssey
- title
The Odyssey
- author
Homer
- published
-700
- concepts
homecoming
identity
cunning
fate
memory
- region
meaning
- note
getting home takes longer than winning the war, and you're not the same person when you get there.
- id
homer-iliad
- title
The Iliad
- author
Homer
- published
-750
- concepts
war
honor
fate
rage
mortality
- region
meaning
- note
everyone knows how it ends and they fight anyway. that's what stays with me.
- id
marquez-solitude
- title
One Hundred Years of Solitude
- author
Gabriel García Márquez
- published
1967
- concepts
memory
history
family
myth
time
- region
meaning
- note
a family makes the same mistakes for a hundred years and never remembers in time.
- id
wilde-dorian-gray
- title
The Picture of Dorian Gray
- author
Oscar Wilde
- published
1890
- concepts
beauty
morality
identity
corruption
self
- region
meaning
- note
what you hide doesn't go away. it just ends up somewhere you don't have to look at it.
- id
deutsch-beginning-infinity
- title
The Beginning of Infinity
- author
David Deutsch
- published
2011
- concepts
explanation
knowledge
progress
computation
possibility
- region
knowing
- note
every problem is solvable with the right knowledge. the most optimistic book i own.
- id
karp-technological-republic
- title
The Technological Republic
- author
Alexander C. Karp & Nicholas W. Zamiska
- published
2025
- concepts
technology
state capacity
institutions
purpose
sovereignty
- region
power
- note
engineers used to build for the country. he asks why we stopped and whether we should start again.
This is a text equivalent of the portfolio's content. Interactive simulations and visualizations require the JavaScript site.