grit-datatype
running grit-datatype@1.1.0 — the actual npm build, unmodified

The GRIT workbench

Build a real 64-byte descriptor, click any byte to corrupt it, and watch the O(1) check name the exact first failure. Nothing here is simulated: this page loads the compiled TypeScript implementation published to npm and calls it directly.

01 Build

The descriptor stays honest; the file claims one extra data byte. The size equations catch it.

02 The 64 bytes — click to corrupt

 
header/flags formats grouping note (unhashed) placements grade_id

Clicking XORs the byte with 0x01 — a single-bit flip, the smallest possible lie. Bytes 28–31 (note) are the only ones the fingerprint ignores; corrupt those and identity holds.

03 Identity & size equations

grade_id
gid (128-bit)
gid (crockford)
elements
groups L0 / L1
plane bytes

The gid hashes grade ‖ frame ‖ shape — computed identically by the C, C++, Rust, Python, and TypeScript implementations (CI proves 96/96 agreement on every push).

04 The O(1) check

GRIT_OK descriptor, shape, and plane bytes agree.

This is the same grit_check that costs 296 ns in C at a load boundary. It evaluates the normative rule order and reports the first failure — corrupt several bytes and it still names the earliest one.

05 Encode → planes → decode, round trip

Planes (hex)
Decoded values & max abs error