Skip to Main Content

Kernelworks

Built at Meta Global AI Developer Hackathon · Oct 26, 2026 · Remote

Demo video · www.loom.com/…

I work full time and build on the side, and Stateguard is the thing I've been building: a checker for one nasty class of bug in LLM inference engines, cache memory that gets reused before whatever was reading it is done. It's open source under Apache-2.0, and I shipped v0.1.0, v0.1.1, and v0.2.0 today. Here's the bug. Every serving engine keeps its KV cache in a pool. A block gets freed while an async copy is still reading it, the pool hands that same address to the next request, and that request quietly gets someone else's bytes. Nothing crashes. You just get a wrong answer. What Stateguard does: the engine records lifecycle events (allocate, submit, complete, retire, reclaim, publish, cancel) into a trace file, and stateguard-check runs them against twelve lifetime rules. You get one of three answers: clean, violation, or inconclusive when the evidence isn't there. That third one matters to me; a full capture buffer is not "probably fine". When it finds something it names the allocation and the exact event that broke the rule. stateguard-reduce then shrinks the failing trace by deleting events, never reordering them, so a 38-event trace becomes a 7-line witness you can actually read. A timeline tool shows how long cancelled memory stays around. Where Muse Spark comes in. First, the easy part: explain_trace.py hands the witness and the JSON report to the model and asks for the ordering edge and a fix in the producer's own terms. Second, the part I'm proud of: agent_fix.py. The model sees the buggy host code and the diagnostics and sends back one unified diff. I apply it to a scratch copy, rebuild, and run every completion order of that configuration, 15,982 of them for the shared-prefix scenario, up to 41,550 for others. The patch is accepted only if every single schedule comes back clean with intact bytes and the original failure is gone. The model never gets to declare victory. Only the harness does. First live runs on muse-spark-1.3-contributor: 5 of 5 planted bugs fixed on the first attempt, about 65,000 tokens total, $0.0113. The transcripts are in docs/agent-fix/. Evidence: CI on GCC 13, Clang 18 with sanitizers, AppleClang, and MSVC. On a Tesla T4 at the v0.1.0 tag: 52/52 tests, the CUDA copy demo caught the premature reclaim in 500 out of 500 runs per configuration, with real corruption of up to 64 MiB when the copy was delayed, and 6,000 generated histories checked in 33 seconds with every verdict as planted. To be straight about timing: the checker core and the harnesses existed before the event. What I built during it is the fix loop, the explore CLI, the explainer, the tested trace-format spec, JSON output, Windows CI, the release pipeline, and the GPU evidence. Stateguard is one of four open-source tools I'm building under Kernelworks, all on the same idea: a deterministic checker decides, the model explains and proposes. Next up is unplanted bugs and letting Muse draft adversarial scenarios for the checker to label.

Team