summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 02:36:30 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit1a14192c65180397d8a2a3df898817768d371a94 (patch)
tree308ac51b056330d6daed4fdc798ee8d3509b65de /src
parent529cf5121e231f66ce5bc26e5618a4fec2c40913 (diff)
downloadpardes-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')
-rw-r--r--src/CHANGELOG.md11
-rw-r--r--src/wire.zig8
2 files changed, 11 insertions, 8 deletions
diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md
index 2fe5aa1c..1bece4b2 100644
--- a/src/CHANGELOG.md
+++ b/src/CHANGELOG.md
@@ -41,13 +41,14 @@
A column resizes by its box, left of its tag; a pane by its own box,
or in a window by the rule above it.
-- An edit to the core recompiles it about 1 s sooner again (`core-test`,
- 8 % fewer of the compiler's instructions, 4.4 MB less code in a Debug
+- An edit to the core recompiles it about 1.5 s sooner again (`core-test`,
+ 13 % fewer of the compiler's instructions, 4.4 MB less code in a Debug
test): a load's note on a field (another build's dump) is written from
the type's and the field's names at run time, where every type and
- field had its own copy of the code that writes one, and one byte
- dump's reader serves a session, a pane and the rest, where each had its
- own.
+ field had its own copy of the code that writes one; one byte dump's
+ reader serves a session, a pane and the rest, where each had its own;
+ and what tells a replica's build from another's (`wire.semantics`)
+ joins its two long parts on, where it formatted them, at every compile.
- An edit to the core recompiles it about 3 s sooner (`core-test`, 13 s to
10 s): the build keeps each grammar's highlight patterns that pardes
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.