diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 02:36:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 1a14192c65180397d8a2a3df898817768d371a94 (patch) | |
| tree | 308ac51b056330d6daed4fdc798ee8d3509b65de /src/wire.zig | |
| parent | 529cf5121e231f66ce5bc26e5618a4fec2c40913 (diff) | |
| download | pardes-1a14192c65180397d8a2a3df898817768d371a94.tar.gz pardes-1a14192c65180397d8a2a3df898817768d371a94.zip | |
wire: semantics joins the dependencies and the tape's shape on, not formats them: the string it hashes ended in config.deps (2.5 KB) and tape.shape (11 KB) given to comptimePrint as {s}, and comptimePrint (an inline function: never memoized) formatting 13.5 KB at comptime was about 5 % of a compile of the core (a lone comptimePrint of the shape alone: 4.8e9 of the compiler's instructions); they are joined on with ++, so the string, and its hash, are the same bytes; core-test's forced full recompile (Debug, one filter) 110.75e9 to 104.95e9 instructions (-4.8 % of the base's 120.12e9), the Debug test's text unchanged (81.48 MB); semantics 05b2cba8834b1d7c before and after, the tape's shape the same 10,960 bytes, a session's byte dump, its image and a closed pane's save the same bytes (but the clock's) and each build loads the other's; core-test 984 of 984; the changelog says so
Diffstat (limited to 'src/wire.zig')
| -rw-r--r-- | src/wire.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wire.zig b/src/wire.zig index 3dd08b29..69cf5be3 100644 --- a/src/wire.zig +++ b/src/wire.zig @@ -61,16 +61,18 @@ const family = switch (config.platform) { /// their options and dependencies; -Dstamp-commit stamps one. pub const semantics: u64 = blk: { @setEvalBranchQuota(1_000_000); + // The two long ones (the dependencies, 2.5 KB, and the tape's shape, + // 11 KB) joined on, not formatted: formatting them at comptime was 5 % + // of a compile of the core. break :blk std.hash.Wyhash.hash(0, std.fmt.comptimePrint( - "wire {d}\npardes {s} {s}\n{s} grammars {} {} {} {} workspace_tag {} sources {}\nusize {d} {t}\n{s}\n{s}", + "wire {d}\npardes {s} {s}\n{s} grammars {} {} {} {} workspace_tag {} sources {}\nusize {d} {t}\n", .{ version, config.version, config.commit orelse "unstamped", family, config.syntax_highlighting, config.syntax_zig_grammar, config.syntax_minimal_grammars, config.syntax_full_grammars, config.workspace_tag, config.embed_sources, @sizeOf(usize), builtin.cpu.arch.endian(), - config.deps, pardes.tape.shape, }, - )); + ) ++ config.deps ++ "\n" ++ pardes.tape.shape); }; /// EndOfStream: the message ends early; WriteFailed: no room for it. |
