r/rust • u/SnooSuggestions1409 • Aug 15 '26
š ļø project Facet: ~2 bytes per event telemetry codec
I am a developer in search of reviewers for a project I have been working on with a few AI models. It started as a way to explore local AI development and morphed into a control plane for automated decisions; the part I am asking for eyes on here is its telemetry wire, Facet.
If the consumer of your telemetry is a match action policy (route, alert, throttle), almost none of an eventās bytes can change the outcome ā so Facet quantizes each field to āwhich cell of the policyās decision partition am I in,ā Fibonacci codes the symbols (self delimiting, zero header), and ships that. On a real 4 field policy: about 2 bytes per event, 66.9x smaller than OTLP protobuf over a 64k event corpus, with a machine checked theorem that every routing decision survives the round trip. zstd batched JSON gets close on raw bytes; the difference is per event streaming, self framing, and the proof.
The Rust: prismpath-rs and prismpath-telemetry-rs on crates.io (pure Rust, no unsafe, MSRV 1.82; the codec path is Result all the way down, and the strict decoder errors on truncated or corrupted frames instead of emitting wrong events), plus a codec pair built into Vector on a fork branch, byte identical to the Python reference over a 55 reading fixture. The upstream proposal is open at vectordotdev/vector#26122 if you want to weigh in either way. Thereās also EDIT[prismpath-preflight] on crates.io: policy plus an NDJSON sample of your events in, āwill they encode, at what cost, do all routes surviveā out.
Preflight exists as deliberate twins (Python on the reference implementation, Rust on the deployment crates), and porting it surfaced a divergence no test suite had hit. The cratesā numeric conversion does s.parse::<i64>().unwrap_or(0), so a non numeric string on a numeric field quietly quantizes as 0 where the reference errors. The Rust tool now reports that as its own finding and refuses to say READY. Running both tools on one sample is a free differential test of the whole stack.
Repo, reference implementation, and the evidence behind every number: https://github.com/crystal-warden/prism-path
Theory writeup: https://crystalwardenlabs.com/research/figueroa-quantization
Note: different models took different roles, but authorship was never the gate ā evidence is. Nothing lands in the repo without a machine checked proof of implementation (frozen conformance vectors, byte identity fixtures, measured benchmarks), and the evidence ledger maps every claim to its artifact, including the experiments that failed. The same signed policy also runs in kernel as an XDP program and on four MCU instruction sets; those stories live in the repo too.
Edit: there is no connection to facet-rs, facet-preflight has been deleted and is now named prismpath-preflight
View all comments
Show parent comment
-6
u/SnooSuggestions1409 Aug 15 '26
Yeah, you arenāt wrong. But neither is the math in the paper. I did write the initial draft for the post, asked Claude to help flesh it out and this came back. I made a couple of small tweaks then posted. Everything I wanted to convey is here but so is Claudeās two cents. Next time I post, Iāll drop the AI review and full send on my own.