From 8ce27cfdbab6d576db36403afbcef9659cb6dbdc Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 23:04:05 -0300 Subject: 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. --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'README.md') 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.** `.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 ` (`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 -- cgit v1.3