Graven

zidl v1: formalize, standardize and test (design)

Historical document. Written on 2026-11-12, when the project was called zidl (later Graven). It records the plan that produced the frozen v1 format; some details were refined later (for example, namespaces no longer carry versions, and the magic became GRVN). The normative text is the format specification.

Date: 2026-11-12 · Status: awaiting approval Based on: 2026-11-12-zerocopy-idl-design.md (the original design) and benchmarks/2026-11-12-round2.md (current performance).

1. Intent and why

The format will run inside other people's code, on versions we do not control, and data will stay on disk for years. The format and runtime already work and already beat the competitors in the benchmarks, but today:

The user wants to formalize, standardize and test before building more on top. This is not the time for new features.

2. Goals

  1. A normative v1 spec of the binary format + conformance test vectors.
  2. A standard envelope for disk and network: just to_bytes / from_bytes (with magic, version, schema id, CRC32C).
  3. Verified<T>: take unsafe out of the public API.
  4. A .zidl compiler (zidlc) with a lockfile that refuses incompatible changes, generating the Rust code that is written by hand today.
  5. Tests: fuzzing of the generated readers and of the envelope, an evolution matrix generated from real .zidl files, Miri, fixes for the review items.

3. Non-goals (for now)

4. Anti-goals (a failure even if it works)

5. Parts

The execution order is A → B → C → D → E. Verified<T> (C) comes before the compiler so that codegen is born with the right pattern.

A. Normative v1 spec + test vectors

B. Envelope (to_bytes / from_bytes)

An optional layer over the raw message; messages without an envelope remain valid. Layout (little-endian):

offset  size  field
0       4     magic = "ZIDL" (0x5A 0x49 0x44 0x4C)
4       1     format_version = 1
5       1     flags = 0 (reserved; a reader MUST reject unknown bits)
6       2     reserved = 0 (a reader MUST reject ≠ 0)
8       8     schema_id (u64)
16      4     payload_len (u32)
20      N     payload (raw zidl message, starting at the root table)
20+N    4     crc32c of bytes [0, 20+N)

C. Verified<T> and an API without unsafe

D. The zidlc compiler + lockfile

E. Tests and robustness

6. Constraints

7. Left to the builder

Module names and organization, the format of the vectors' expectation file, the lockfile format, the syntax of the warning-confirmation attribute, the parser (by hand or a crate), the name of the enveloped writing API, the CRC32C implementation.

8. The assistant's decisions (for the user's review)