summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 18:23:20 -0300
committerGabriel Schneider <[email protected]>2026-11-06 20:00:43 -0300
commit1b38ca0aa0bfae1177f80a6713ec6d787d2f77d4 (patch)
tree9c656ca528561286e07c099a8d770af89417100a /src/dump.zig
parenteeb59b92295e74b956d32e66c3c318e105a391db (diff)
downloadpardes-1b38ca0aa0bfae1177f80a6713ec6d787d2f77d4.tar.gz
pardes-1b38ca0aa0bfae1177f80a6713ec6d787d2f77d4.zip
kinds #39, paint writes nothing a step reads and the digest is every Slot field a step reads (§17.2 B 2-3): the Slot says what is the kind's own or a frame's (its code and memory, its jobs' inputs, a placeholder's record, the place its kind says, the thumb, the pointer, whether a frame was drawn) and the walker digests the rest, `placed` and the prefix leave the Shadow's frame (the pointer its one byte), the dump carries the cancelled tokens a replica's job answers are dropped by, and a pane test dumps a session with a PDF and a picture, loads it on another core and compares every Slot field the walk does not leave out, so a field added and not dumped fails a test, not a soak
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dump.zig b/src/dump.zig
index 2f52d1d9..b1711cf3 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -927,6 +927,8 @@ const SlotRecord = struct {
next_tick: u64 = 0,
views: [views.max]u64 = @splat(0),
focused: bool = false,
+ /// The jobs whose answers it dropped (api.cancel): a replica's drop them too.
+ cancelled: [4]u32 = @splat(0),
/// Its tick's prefix: a replica's tag laid out as the session's.
prefix: []const u8 = "",
/// A placeholder's why (its file not here).
@@ -941,7 +943,7 @@ const SlotRecord = struct {
pub fn slotWrite(s: *const Kind.Slot, gpa: std.mem.Allocator, w: *std.Io.Writer) !void {
var place: [32]u8 = undefined;
- var r: SlotRecord = .{ .name = s.nameOf(), .version = s.version, .path = s.path, .art = s.art, .record = s.record, .where = s.where_text.slice(), .values = s.values.slice(), .live = s.live, .next_tick = s.next_tick, .views = s.views, .focused = s.focused, .prefix = s.prefix.slice(), .refused = s.refused.slice(), .tail = s.tail.slice(), .selection = s.selection };
+ var r: SlotRecord = .{ .name = s.nameOf(), .version = s.version, .path = s.path, .art = s.art, .record = s.record, .where = s.where_text.slice(), .values = s.values.slice(), .live = s.live, .next_tick = s.next_tick, .views = s.views, .focused = s.focused, .cancelled = s.cancelled, .prefix = s.prefix.slice(), .refused = s.refused.slice(), .tail = s.tail.slice(), .selection = s.selection };
var owned: ?[]u8 = null;
defer if (owned) |o| s.gpa.free(o);
if (s.ops != null) {
@@ -973,7 +975,7 @@ pub fn slotRead(out: *Kind.Slot, gpa: std.mem.Allocator, bytes: []const u8) !voi
var arena: std.heap.ArenaAllocator = .init(gpa);
defer arena.deinit();
const r = try walk.load(SlotRecord, arena.allocator(), bytes, null);
- out.* = .{ .gpa = gpa, .arena = .init(gpa), .version = r.version, .art = r.art, .live = r.live, .next_tick = r.next_tick, .views = r.views, .focused = r.focused };
+ out.* = .{ .gpa = gpa, .arena = .init(gpa), .version = r.version, .art = r.art, .live = r.live, .next_tick = r.next_tick, .views = r.views, .focused = r.focused, .cancelled = r.cancelled };
errdefer out.free();
@memcpy(out.name[0..@min(15, r.name.len)], r.name[0..@min(15, r.name.len)]);
out.path = try gpa.dupe(u8, r.path);