How any Claude (or human) session can produce a working Quilt cell in any language, byte-exact.
A Quilt cell is 16 signed Q1.15 dials (range -32768..32767), a 64-bit id, and a list of neighbor ids. Five opcodes (BIND/LINK/EFFECT/VIEW/TICK) make it a fabric. The state hash is FNV-1a 64-bit over a canonical serialization. If your port produces the right hash for the right cell, it is a Quilt.
You are writing a Quilt cell. A cell has:
- 16 signed Q1.15 dials (range -32768..32767)
- A 64-bit id
- A list of neighbor ids
The 5 opcodes are:
- BIND(cell, dials) — sets the dials, idempotent
- LINK(c1, c2) — adds an undirected edge
- EFFECT(cell) — propagates dial[0] to neighbors
- VIEW(cell) — returns dials
- TICK(fabric) — advances all dials by 1 in alternating direction
The state hash is FNV-1a 64-bit over the canonical serialization
(type(1) + id(8) + dials(32) + neighbors(8*N)). Constants:
FNV_OFFSET = 0xcbf29ce484222325
FNV_PRIME = 0x100000001b3
Write a complete, working cell-fabric runtime in [YOUR LANGUAGE].
Then write a test that produces the hash 0xe435d91d6d92a1d8
for a cell with id=1, dials=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],
neighbors=[2,3,4].
Do not use any external libraries. Do not add features beyond
what is specified. Verify the hash byte-exactly.
That’s the whole protocol. A working Claude session will produce a complete implementation in <2 minutes. The byte-exact test is the guardrail: if the hash doesn’t match, the cell is not admissible.
| Check | How | Failure mode |
|---|---|---|
| Hash matches | Run the test vector | “Cell not byte-exact” |
| Opcodes complete | grep for all 5 names | “Missing opcode” |
| No external deps | import/require audit |
“Use stdlib only” |
| Self-contained | <500 LOC | “Too large” |
D = 16
MASK = 0xffffffffffffffff
OFFSET = 0xcbf29ce484222325
PRIME = 0x100000001b3
def fnv1a_64(b: bytes) -> int:
h = OFFSET
for x in b:
h ^= x
h = (h * PRIME) & MASK
return h
def cell_bytes(cell):
out = bytearray()
out.append(0x01)
out += cell['id'].to_bytes(8, 'little')
for d in cell['dials']:
out += d.to_bytes(2, 'little', signed=True)
for n in cell['neighbors']:
out += n.to_bytes(8, 'little')
return bytes(out)
def hash_fabric(fabric):
s = bytearray()
for c in sorted(fabric, key=lambda c: c['id']):
s += cell_bytes(c)
return fnv1a_64(s)
# Test
cell = {
'id': 1,
'dials': [0,131,0,19191,11316,256,0,0,0,0,0,0,0,0,0,0],
'neighbors': [2, 3, 4]
}
print(hex(hash_fabric([cell])))
# → 0xe435d91d6d92a1d8
I do not write a Quilt. I write a hash function. If the hash is right, the Quilt is right.
github.com/SuperInstance/quilt-{lang} (or your own org)SuperInstance/AI-Writings with:
| Substrate | Hash | Opcodes | Tests | Status |
|---|---|---|---|---|
| Python | ✓ | ✓ | ✓ | canonical |
| C99 | ✓ | ✓ | ✓ | byte-exact |
| Rust | ✓ | ✓ | ✓ | byte-exact |
| Verilog | ✓ | ✓ | ✓ | byte-exact (synth) |
| VHDL | ✓ | ✓ | ✓ | byte-exact (synth) |
| JavaScript | ✓ | ✓ | ✓ | byte-exact |
| TypeScript | ✓ | ✓ | ✓ | byte-exact |
| WASM | ⏳ | ✓ | ⏳ | planned |
| Go | ⏳ | ✓ | ⏳ | planned |
| Zig | ⏳ | ✓ | ⏳ | planned |
| Mojo | ⏳ | ⏳ | ⏳ | requested |
+6 adopted sub-ops (FORGET/PROOF/ROUTE/CRDT/WORLD/TIME) are optional. A port that implements just the 5 is admissible.5 algebraic laws are not enforced by the protocol but are a good way to write tests:
c.set(s).set(s) == c.set(s) (idempotent)f.link(c1).link(c2) == f.link(c2).link(c1) (commutative)tick.advance() == tick(t+1) (oscillatory)f2.compose(f1) returns a fabric (composable)runtime.reverse(state) == prior (invertible)quilt-cell-taxonomy.html — the 7×6 polyformalism matrixquilt-fabric-runtime.html — interactive simulatorquilt-language-map.html — all 11 ports with code samples