summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 11:14:38 -0300
committerGabriel Schneider <[email protected]>2026-10-29 14:30:01 -0300
commit3b793d1d349c01bf6046b0f87742f16755069115 (patch)
treeff1cefcb7ea757cd6bffef688387d25ba1dffdec /src/look.zig
parente91a3788752c63c2ed086c553f9861056172e8c0 (diff)
downloadpardes-3b793d1d349c01bf6046b0f87742f16755069115.tar.gz
pardes-3b793d1d349c01bf6046b0f87742f16755069115.zip
walk.zig: the reflective walker, one comptime @typeInfo walk that hashes a value (the replay digest) and encodes and decodes it (the tape's values)
Values, never addresses: a pointer is followed, a slice is its elements, an ArrayList its items, a hash map its entries in no order, a DynamicBitSet its bits; an allocator, an Io, a lock or a worker's future is machinery and walks to nothing. A type it cannot see into (a pointer to an opaque thing or a function, a many-pointer, an untagged union) is a compile error naming the struct and the field, until the struct says what the field is: pub const replica = .{ .local = .{...}, .derived = .{...}, .authority = .{...}, .len = .{ .{ "jumps", "njumps" } } }; local (this process's own: frames, animations, caches of the host's), derived (made again from the rest), authority (held by the session that performs effects alone) are in no digest; `len` hashes a fixed array only as far as its length field says, since the rest is undefined (0xAA in a safe build, and a slice in it faults). A name that is no field is a compile error, so a rename cannot put a field back in quietly. `fieldDigests`/`fieldNames` give a digest a field, which is how a divergence is narrowed down. encode/decode are native byte order and an error is its number in this build: for the process that wrote it, or one of the same build. Phase 2 is to make the complete dump on the same walk (docs/next-daemon.md); nothing uses it yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
0 files changed, 0 insertions, 0 deletions