diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-23 09:33:05 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-23 10:04:29 -0300 |
| commit | 339ebde8df16f79197c2fd469eedba5edec750c4 (patch) | |
| tree | 6c481746eb1e8e9830b1e96192491ea3ce6bc1bd /core/walk.zig | |
| parent | 37cc3104fe589ec7cd2a8a5dd398f0f89f412837 (diff) | |
| download | pardes-339ebde8df16f79197c2fd469eedba5edec750c4.tar.gz pardes-339ebde8df16f79197c2fd469eedba5edec750c4.zip | |
jump, walk: two jump entries in a row are one when the digest sees them the same (`walk.eql`: the digest of each, so what the walk leaves out, a Buf's bytes past its length, a cache, decides nothing), not by std.meta.eql's every byte: core/Jump.zig:207 took the dedupe on a text entry's `place` bytes, undefined (`.place = .{}`), the same 0xAA on every Debug process and each process's own on a release build, so a session and its client kept different jump lists and the client parted (both release soaks of the base, the witness naming `views[3].jumps`, `views[0].jumps`); the test of the change before passes (Debug)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/walk.zig')
| -rw-r--r-- | core/walk.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/walk.zig b/core/walk.zig index d870052d..898a7cf7 100644 --- a/core/walk.zig +++ b/core/walk.zig @@ -89,6 +89,15 @@ pub fn digest(comptime T: type, v: *const T) u64 { return h.final(); } +/// Equal as the digest sees them: what the walk leaves out (a Buf's bytes +/// past its length, a cache) is not compared. std.meta.eql compares every +/// byte of an array, and those bytes are undefined: 0xAA on every Debug +/// process, each release process's own garbage; a decision of the core +/// taken on them agrees between a session and its clients in Debug alone. +pub fn eql(comptime T: type, a: *const T, b: *const T) bool { + return digest(T, a) == digest(T, b); +} + /// A digest of each field `hash` would walk, in order (what a divergence /// is narrowed down by); `names` are theirs. pub fn fieldDigests(comptime T: type, v: *const T, out: []u64) []u64 { |
