summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 23:04:05 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit8ce27cfdbab6d576db36403afbcef9659cb6dbdc (patch)
treed9c05dac053b17761e0d139cf14a192d49b4a46d /README.md
parent1b59d3e8eca0037d5c9fcb412e7c63cbe508f4ac (diff)
downloadsketchbook-8ce27cfdbab6d576db36403afbcef9659cb6dbdc.tar.gz
sketchbook-8ce27cfdbab6d576db36403afbcef9659cb6dbdc.zip
Load sketch libraries through a symlink and identify builds by stat
A load copied the whole library to $XDG_RUNTIME_DIR (a read/write loop across filesystems) and then hashed all of it for the build id: 40 ms for a 10 MB Debug library, 200 ms for drat-meout's 58 MB. dlopen only needs a fresh name, so the host links one to an fd open on the library, which also pins the file a build may rename over meanwhile. The build id recordings carry is a hash of the file's inode, size and modification time: Zig's own linker writes no build-id note in Debug.
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index 3a4384a..626a4e4 100644
--- a/README.md
+++ b/README.md
@@ -596,7 +596,8 @@ object.
## The host
- **Hot reload.** It watches the library file and loads each new build through
- a private copy.
+ a symlink with a fresh name (a build must replace the file, as `zig build`
+ does, not rewrite it in place).
- **State file.** `<name>.state` holds the live state plus 7 snapshot slots,
shared via `MAP_SHARED`. Its header carries the reflected layout, so a
layout change migrates every slot field by field, with enums matched by tag
@@ -619,9 +620,10 @@ object.
button and key state, and a recording begins with events that bring back
what was held when it started (a pointer move, a button or key down), so
a replay starts from the same input whatever the live pointer did since.
- A recording carries a hash of the build that made it; `play` warns when
- the running build differs (edited `update`, a new compiler), since the
- replay may then diverge.
+ A recording carries an identity of the build that made it (its file's
+ inode, size and modification time); `play` warns when the running build
+ differs (edited `update`, a new compiler), since the replay may then
+ diverge.
- **Console and overlays.** `get`/`set <field path>` (`get` of a vector,
array or struct shows its values, in memory order), snapshots, recordings and
the memory, scope and frame timing overlays come from the host; unknown lines go to the