mirror of
https://github.com/zap-proto/rust.git
synced 2026-10-30 15:04:23 +00:00
Two wire formats ship under the ZAP name. This runtime carries the one with a segment table and tagged word pointers; zap-proto/go and zap-proto/cpp carry a 16-byte header over byte-offset fields. Neither reads the other, in either direction. Over the 544 ZAP-framed vectors of the Lux chain differential corpus this runtime reads none, always with the same error: a Go frame opens with the magic, and reading those four bytes as a segment count gives 5259611, which is 0x0050415A — "ZAP\0" little-endian — plus one. Nothing this runtime writes carries the magic the Go reader checks for. go_frame_conformance.rs keeps four of those frames, one per chain, and asserts what each runtime does with them, so the divergence stays measured rather than assumed. It deliberately translates nothing: which format is canonical is not a question a test can answer. reads_are_zero_copy.rs measures the other claim, which is easy to assert and easy to lose — zero allocations across 30,000 field reads, fields pointing inside the original buffer, readers small enough to be Copy. The counter is per-thread because the harness runs tests in parallel and a shared one attributes a sibling's allocations to the read loop.