From 007972c0b5a13f1c1b8e2cd45cba76b7204e1c37 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Wed, 19 Aug 2026 01:22:37 -0500 Subject: [PATCH] slice_sync: "-" actor = network-wide collection slice (used for the retrieval benchmarks) Co-Authored-By: Claude Fable 5 --- examples/slice_sync.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/slice_sync.zig b/examples/slice_sync.zig index 8a2a1f3..4e984b4 100644 --- a/examples/slice_sync.zig +++ b/examples/slice_sync.zig @@ -45,8 +45,11 @@ pub fn main(init: std.process.Init) !void { return error.MissingActor; } + // "-" as the actor means no DID filter: a network-wide collection slice var did: []const u8 = args[1]; - if (!std.mem.startsWith(u8, did, "did:")) { + if (std.mem.eql(u8, did, "-")) { + did = ""; + } else if (!std.mem.startsWith(u8, did, "did:")) { var resolver = zat.HandleResolver.init(init.io, allocator); defer resolver.deinit(); const resolved = try resolver.resolve(zat.Handle.parse(args[1]) orelse return error.InvalidHandle); @@ -63,14 +66,14 @@ pub fn main(init: std.process.Init) !void { while (it.next()) |c| try collections.append(init.arena.allocator(), c); } - std.debug.print("slicing the archive for {s} ({d} collection filters)\n", .{ did, collections.items.len }); + std.debug.print("slicing the archive for {s} ({d} collection filters)\n", .{ if (did.len > 0) did else "the whole network", collections.items.len }); const started = std.Io.Timestamp.now(init.io, .awake).nanoseconds; var stats = SliceStats{ .arena = init.arena.allocator() }; const result = try jetstream_sdk.ArchiveBackfill.run(init.io, allocator, .{ .host = "https://stream.waow.tech", .after_seq = 0, - .dids = &.{did}, + .dids = if (did.len > 0) &.{did} else &.{}, .collections = collections.items, // jim's sparse-backfill recipe: kind=commit changes the PLAN, not // just client filtering — without it, marker/sentinel rows admit -- 2.51.2