Skip to content

feat(frozen): schema_ir_hash — canonical frozen-schema digest - #49

Merged
Kinflou merged 1 commit into
masterfrom
feat/schema-ir-hash
Sep 2, 2026
Merged

feat(frozen): schema_ir_hash — canonical frozen-schema digest#49
Kinflou merged 1 commit into
masterfrom
feat/schema-ir-hash

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 2, 2026

Copy link
Copy Markdown
Member

First of the IR_HASH chain — a canonical, cross-language frozen-schema digest.

schema_ir_hash(&[FrozenUnit]) -> u64 = BLAKE3 over the units' bincode encoding (the CAS's own blob serialization), folded to 64 bits for the connection handshake's ir_hash.

Today each generator hashes its own rendering — the Rust generator does FNV-1a over a Debug view of the frozen units, which is generator- and language-specific. This function is the one canonical identity: same frozen IR ⇒ same value on every target, so two ends of a connection generated from the same schema (Rust ⇆ Rust, later Rust ⇆ TS) agree.

  • comline_core::schema::ir::frozen::schema_ir_hash (re-export).
  • Tests: determinism, sensitivity to a semantic change, order-significance, empty-schema.

Downstream (comline-rust swaps its local ir_hash for this; the generation / cli core-pin bumps ride along) follows once this merges.

BLAKE3 over the `bincode` encoding of a schema's `&[FrozenUnit]` (the same
serialization the CAS stores blobs with), folded to `u64` for the connection
handshake's `ir_hash`.

Deterministic for a given frozen IR, independent of the generator and the
host — so every target language embeds the same value and two ends of a
connection generated from one schema agree. Replaces each generator hashing
its own language-specific rendering (FNV over a `Debug` view, in the Rust
generator today).

Re-exported as `comline_core::schema::ir::frozen::schema_ir_hash`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant