Writing
Arguments with artifacts underneath them.
I write about the places where a plausible abstraction stops matching the system underneath it: hardware, benchmarks, gradients, protocols, compatibility contracts, and physical prototypes. Research notes expose their evidence boundaries; older build/security pieces remain as dated engineering notes rather than being retroactively promoted to research.
Selected
-
Correctness under hidden failure modes
Real hardware, contaminated benchmarks, miscalibrated uncertainty, and physical prototype gates look unrelated. They are the same engineering problem: the abstraction becomes the thing being tested, and both can be wrong together.
-
197 passing tests, four real-hardware bugs
The unit suite was green. Then I gave the program an RDMA device. Real verbs and real sysfs state exposed four defects the 197 synthetic tests had not — and rejected the first attempted fix too.
-
A benchmark can measure its own metadata
I built a benchmark of real DeFi exploits, published a model score, then discovered that 13 of 24 prompts contained severe author-injected leakage. One Euler prompt literally contained the target label while the vulnerable function was absent from the committed source.
-
When uncertainty makes active learning worse
A pretrained materials surrogate found promising structures about five times as efficiently as random screening on a static benchmark. The mean prediction was useful. Its MC-dropout uncertainty was not: σ was anti-correlated with absolute error, and overweighting it pushed acquisition below random.
-
Autograd is part of the API
An activation can return the expected forward value and still be broken if its learnable parameter cannot move through the function it supposedly controls. A MatGL fix made gradient semantics part of the regression contract.
-
A default is executable policy
Three changed defaults in MLX-LM fixed a configuration that could turn “enable XTC” into “mask nearly the whole candidate distribution.” The sampler formula was not the bug; the default composition was.
-
Recursive types, finite values: an EIP-712 bug in alloy
EIP-712 explicitly supports recursive struct types — but alloy refused to canonicalize one. The fix turned on a distinction the spec makes and the code didn't: a type definition can be recursive even though every concrete value of it must be a finite tree.
-
Date and time bugs are systems bugs
Four merged uutils fixes—timezone re-zoning, negative epoch flooring, AM/PM grammar, and a two-letter timezone alias—show why date/time correctness is compatibility engineering, not parsing trivia.
-
Upstream is a different kind of test
Eight merged patches across MatGL, MLX-LM, Alloy, coreutils, and parse_datetime changed the unit of correctness from “works for my project” to “what may downstream callers safely assume after this lands?”
-
Delete the science-fiction parts first
The first useful prototype of an airborne drone carrier is not a smaller carrier. It is the cheapest machine that can falsify the riskiest interaction in the architecture: repeated recovery onto a moving dock.
Archive
every post · old URLs preserved-
A new turbine inside a 1965 power plantinfrastructure case study
Darkhan did not convert a 1965 generator into a modern one. It added a fifth 35 MW turbine-generator to a 48 MW legacy plant—and the control-room screen shows why brownfield engineering is mostly interface work.
-
Delete the science-fiction parts firstdesign note
The first useful prototype of an airborne drone carrier is not a smaller carrier. It is the cheapest machine that can falsify the riskiest interaction in the architecture: repeated recovery onto a moving dock.
-
Upstream is a different kind of testopen-source synthesis
Eight merged patches across MatGL, MLX-LM, Alloy, coreutils, and parse_datetime changed the unit of correctness from “works for my project” to “what may downstream callers safely assume after this lands?”
-
Date and time bugs are systems bugssystems synthesis
Four merged uutils fixes—timezone re-zoning, negative epoch flooring, AM/PM grammar, and a two-letter timezone alias—show why date/time correctness is compatibility engineering, not parsing trivia.
-
A default is executable policyinference correctness
Three changed defaults in MLX-LM fixed a configuration that could turn “enable XTC” into “mask nearly the whole candidate distribution.” The sampler formula was not the bug; the default composition was.
-
Autograd is part of the APInumerical correctness
An activation can return the expected forward value and still be broken if its learnable parameter cannot move through the function it supposedly controls. A MatGL fix made gradient semantics part of the regression contract.
-
A research primitive should outlive the result that motivated itopen-source case study
I needed MC-dropout uncertainty for one active-learning experiment. The more durable result was upstreaming the mechanism into MatGL so it remained useful even after the motivating uncertainty result became a negative result.
-
Correctness under hidden failure modesresearch synthesis
Real hardware, contaminated benchmarks, miscalibrated uncertainty, and physical prototype gates look unrelated. They are the same engineering problem: the abstraction becomes the thing being tested, and both can be wrong together.
-
197 passing tests, four real-hardware bugssystems postmortem
The unit suite was green. Then I gave the program an RDMA device. Real verbs and real sysfs state exposed four defects the 197 synthetic tests had not — and rejected the first attempted fix too.
-
Who audits the auditor?security note
I built a Solidity static-analysis tool with an agent fleet. The phase that mattered wasn't writing the detectors — it was pointing a separate model at them and saying: lie detector, prove you lie.
-
An arbitrage bot with no slippage is a sandwichsecurity note
I rebuilt a 2021 flash-loan hackathon contract into a real Aave v3 arbitrage. The contract got the hard security right — and left the door open on the thing arb bots exist to exploit.
-
Running an OP Stack L2 with rethsystems note
An OP Stack rollup is four processes and a shared secret. I finalized an old deployment of mine into something reproducible — and the part that actually caught bugs wasn't me, it was CI.
-
Rebuilding a perps DEX from its docsbuild note
An old repo of mine had a perps-DEX frontend and nothing else — the protocol was gone. So I rebuilt it from the documentation of what it became. The interesting part is what the docs gave away: who the house is.
-
A social-good protocol, built by an agent fleetbuild note
I had an empty repo and pointed a multi-agent workflow at it. The result was a tested rewards protocol — but the part worth writing down is which model sat in which seat, and the bug the auditor caught that the builder wrote.
-
The index fund that held the wrong assetsecurity note
A Sui Move 'crypto index fund' lets you deposit SUI for exposure to a BTC/ETH/XRP/ADA/MATIC basket. The problem: it never buys any of them. It holds SUI and pays out basket gains it doesn't have — insolvent by construction, a bank run wa...
-
Anatomy of a memecoin honeypotsecurity note
A token contract I found trades perfectly and looks like every other ERC-20. It also lets the deployer freeze your bag with one call. Here's the line that does it, proven against the real contract — and what an un-ruggable token looks li...
-
The bridge that paid twicesecurity note
A token bridge whose relayer calls release() on every Deposit event. That sounds fine until you remember event delivery isn't exactly-once — and a reorg, a reconnect, or a restart makes the destination pay the same lock again. Here's the...
-
Anatomy of a fake dice gamesecurity note
I dug up a dice-game contract from 2018. It's 48 lines, and it's two bugs in a trenchcoat: its randomness is always zero, and it never uses the roll anyway — every bet just loses half. Here's the autopsy, and the provably-fair version it...
-
Building ZK dark chess: real fog of war on a public chainengineering note
My on-chain chess engine has a fog-of-war mode that hides nothing — the board is plaintext. So I built the real version: the board lives off-chain behind a Poseidon commitment, and every move ships a zk-SNARK that it was legal without re...
-
What a ZK proof proves (and what it doesn't)cryptography explainer
My on-chain chess engine had a zk settlement path you could forge to steal any in-progress game — not by breaking the proof, but by proving the wrong thing. That bug, and a fog-of-war variant that hides nothing, are the two halves of ZK:...
-
Verifiable isn't trustless: a coin flip on Suisecurity explainer
A house-signed coin flip lets anyone verify the result — and still lets the house win. The signature is honest; the choice of which games to settle isn't. Here's the gap, and the trustless fix that has its own sharp edge.
-
The other side of the wall: FHE where ZK stopsengineering note
My ZK fog-of-war chess hit a wall: it could prove a move legal against your own board, but not the things that depend on the opponent's hidden pieces — captures, blocked sliders, check. Those are joint predicates over two secret boards. ...
-
The on-chain randomness landscape, or: how to pick a chess position fairlyprotocol explainer
Fischer-random chess needs one of 960 starting positions, drawn so neither player can rig or foresee it. On a deterministic chain that's surprisingly hard — and the way you solve it is the whole map of on-chain randomness: commit-reveal,...
-
How CoW Protocol settles a trade (and what my TWAP router got wrong)protocol explainer
My TWAP router for CoW Protocol compiled, passed its tests, and called two functions that don't exist on mainnet. Fixing it meant actually learning how CoW settles: intents not swaps, why you approve the relayer and not the settlement co...
-
An invariant is not an end-to-end proofrevised security note
Supply≤collateral is the right local invariant for a lock-and-mint bridge. The important lesson was learning what that invariant does not prove: an attestation gate can make operator coordination enforceable on-chain without independentl...
-
The post-quantum proof that Shor breaks anywaycryptography note
A bridge verifies a lattice signature inside a zero-knowledge proof and calls itself post-quantum. The signature is post-quantum. The proof isn't — and a quantum adversary attacks the proof, not the signature. Here's where the claim snaps.
-
Recursive types, finite values: an EIP-712 bug in alloymerged upstream
EIP-712 explicitly supports recursive struct types — but alloy refused to canonicalize one. The fix turned on a distinction the spec makes and the code didn't: a type definition can be recursive even though every concrete value of it mus...
-
A benchmark can measure its own metadatarevised evaluation postmortem
I built a benchmark of real DeFi exploits, published a model score, then discovered that 13 of 24 prompts contained severe author-injected leakage. One Euler prompt literally contained the target label while the vulnerable function was a...
-
When uncertainty makes active learning worserevised research note
A pretrained materials surrogate found promising structures about five times as efficiently as random screening on a static benchmark. The mean prediction was useful. Its MC-dropout uncertainty was not: σ was anti-correlated with absolut...
-
The model reads "not" — it just can't use itreplication note
Ask GPT-2 to complete "Paris is not the capital of" and it still says France. The interesting part isn't that it fails — it's that the model clearly attends to the word "not" and then can't make that signal change its answer. Here's wher...
-
When it can't explain what it sees, it asksengineering note
I built a predictive-coding engine that runs a hierarchy of beliefs on a laptop GPU, minimizing prediction error layer by layer. The part I like most: when a layer can't explain away its own surprise, it doesn't just shrug and update — i...
-
An AMM built to be attackedengineering note
Most AMM code is written to look safe. I wrote one to be a teaching specimen — where the exploits are tests in the repo, some of them passing, and the real lesson is which 'attacks' are contract bugs, which are economic facts of life, an...
Browse by series or tag. Current research programs and evidence boundaries live on the research page.