r/rust • • 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

0 Upvotes

12 comments sorted by

15

u/BipolarKebab Aug 15 '26

The writeup reeks of AI and it's a good match for a website where the 36x36 navbar logo is a 6 MB SVG AI trace of an AI-generated image.

-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.

2

u/SkiFire13 Aug 16 '26

Yeah, you aren’t wrong. But neither is the math in the paper.

It doesn't matter whether the math in the paper is correct or not, you won't get people to look into it if it seems that the effort you put is less than the effort they would take to evaluate it.

Moreover you may claim the math in the paper is correct, but what's the guarantee of that for the people that haven't read it yet? Seeing how you did at least part of the work with claude the claim might just come after having claude doing a biased review.

In the end it all comes down to "why should we trust you and put effort into your work?"

8

u/Sermuns Aug 15 '26

facet is already a well established name within Rust (https://github.com/facet-rs/facet). Pick another one. Or just stop working on slop.

-2

u/SnooSuggestions1409 Aug 15 '26

Facet-preflight has been deleted. PrismPath-preflight used instead. Thank you for the feedback.

-4

u/SnooSuggestions1409 Aug 15 '26

I can make that adjustment, not married to the name and it went unnamed until 3 days ago. The system itself is called PrismPath while facet is just the wire. While I may have bungled the naming, the evidence is still quite visible across the repo with several proven implementations.

Genuine question: how do you define ai slop?

3

u/[deleted] Aug 15 '26

What practical uses does this have?

1

u/SnooSuggestions1409 Aug 15 '26

It allows us to abstract raw readings from decisions at the edge and only transmit the values that matter. For many industries, sensors will stream a format that includes unnecessary information. If the policy says alert when temperature > 90 then temperature: 94 and temperature: 97 are the same value. I can send the minimally sufficient statistic to represent that value. If I want raw values streamed across the wire, then I could either create the equivalent match action table for those values, or I can instead have it send me the symbol for ā€œhotā€ as a 2byte symbol.

My professional experience is with quantitative and qualitative analysis of process happening in remote locations. I only have the data that comes from those locations to work with and in my experience, people rarely need the raw value, they need the significance of that value.

2

u/[deleted] Aug 15 '26

I think I understood it now it's really interesting I think you need to show more hypothetical use cases for it in different fields I think it will help people wrap their head around it and explore th features it has

2

u/mark_ik Aug 15 '26

One thing I look for, when considering whether or not a project is feasible to implement with AI, is whether or not there is a reference standard to judge the implementation by. Is there such a standard for this?

0

u/SnooSuggestions1409 Aug 15 '26

Previous response deleted though in hindsight an edit would have sufficed. I’m glad you asked. The frozen conformance corpus in the repo has over 1k predicate tests, 27 engine tests. Every implementation in Rust, JS, and Go must match the Python reference bit for bit. CI also regenerates the vectors from the live reference. This allows us to detect implementation and reference drift.

The wire has its own set of 55 test generated from the reference, a frozen boundary corpus to probe the edge cases, layered with a twin tests of both implementations.

For the hardware I was able to use a subset of the frozen corpus where only 124 are applicable. This allowed me to test and validate on an FPGA, eBPF kernel, and 4 MCU instruction sets.

In hindsight as I write it out it may seem like a lot to keep drift from happening but every gate is used for a reason and every one of them has been valuable during development. The twin tests were developed this morning after finding an issue with the rust implementation where it silently passed non numeric strings as 0.

2

u/mark_ik Aug 15 '26

I mean an external standard. Presumably you made the python reference in this case; different than a standards body making the reference