Engineering notes

Short notes on how I think about systems, evaluation, and code, with a few facts I like.

Failure modes I plan for

Memory before speed

Estimate before you allocate. In INDRA the manager checks VRAM before a load, because an out-of-memory crash is worse than a short queue.

Degrade, do not die

Hosts differ. The code sandbox has a fallback mode for machines that cannot run gVisor, so the system still starts.

Noisy input is the norm

On the license-plate work, geometry correction, adaptive filtering and contrast normalisation cut failures on degraded images more than a bigger model would have.

Believe the interval, not the average

Raw win rates mislead. Paired significance tests and full-benchmark runs decide which differences I report.

Programming and DSA

Practice

100+ LeetCode problems in C++ and Python and the 100 Days Badge 2026. Coursework in algorithms, theory of computation, operating systems and networks.

The LRU cache is real

A hash map plus a doubly linked list gives O(1) get and put. The same idea decides which model leaves GPU memory in INDRA.

Complexity as a tool

The randomised SVD path in Ro-SVD takes the cost from O(Thd²) to O(Thr log r), which is what made online compression affordable.

Working with AI coding tools

I build with Claude, Codex, Cursor, Antigravity, Lovable and Bolt, and treat their output as code to be tested like any other.

Cool facts from my work

A KV cache is surprisingly big

For Qwen2.5-7B (28 layers, 4 KV heads, head size 128) in fp16, each token costs 2 x 28 x 4 x 128 x 2 bytes, about 56 KiB. A 32,000-token context holds about 1.75 GiB of cache, per sequence.

Truncated SVD is provably best

The Eckart-Young theorem says keeping the top r singular values gives the best rank-r approximation in both the Frobenius and spectral norms. That is why compressing along singular directions is principled.

RoPE and relative position

Rotary embeddings rotate queries and keys so their dot product depends on relative distance. Compressing keys before the rotation is a design choice, and a reason position-aware handling matters.

McNemar only looks at disagreements

When two models answer the same questions, only the questions where exactly one is right carry information. 15 against 5 gives p of about 0.04, and 60 against 50 gives about 0.5.