<feed xmlns='http://www.w3.org/2005/Atom'>
<title>computeranim.git/build/agent.zig, branch main</title>
<subtitle>Tracing debugger and animations of running programs (ztrace, canim)</subtitle>
<id>https://git.0x4200.cafe/computeranim.git/atom?h=main</id>
<link rel='self' href='https://git.0x4200.cafe/computeranim.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/'/>
<updated>2026-11-10T18:15:21Z</updated>
<entry>
<title>build: the pass and the agent to preload are named lazy paths; canim uses them</title>
<updated>2026-11-10T18:15:21Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T18:14:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=1d54a3d3220706acfe704a0c1d6cda47cc0df43d'/>
<id>urn:sha1:1d54a3d3220706acfe704a0c1d6cda47cc0df43d</id>
<content type='text'>
A package that depends on ztrace no longer repeats the plugin's recipe or
searches the install step for the shared agent.
</content>
</entry>
<entry>
<title>agent: its handlers act with the thread's protection keys and float modes, not a handler's</title>
<updated>2026-11-10T16:00:24Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T15:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=8b28a0a5101a62fd55c2d55433e0fa899d4623f9'/>
<id>urn:sha1:8b28a0a5101a62fd55c2d55433e0fa899d4623f9</id>
<content type='text'>
The kernel starts a signal handler with default PKRU (key 0 only) and
default MXCSR and x87 control word, the thread's own saved in the frame.
The SIGSYS handler makes the thread's syscalls and clones its threads
from there, so under --syscalls:
- a pkey_alloc's new rights were undone when the handler returned;
- a thread was born with no right to keyed memory (V8's compiler
  threads fault reading the code space: d8 died of SEGV_PKUERR, and the
  35 seconds were its core dump, not a spin);
- a buffer in keyed memory was EFAULT to the kernel, and a fault to the
  agent reading it for the event;
- a thread started without its maker's float modes (flush-to-zero).
Both handlers now take the thread's PKRU and control words from the frame
first (signal.adopt), and the SIGSYS one writes PKRU back to the frame
after the syscall. Watched memory is read, and hooked code patched, with
every key open, so a key the thread itself cannot use hides nothing.

test-agent: agent_pkey (a keyed page read, given to syscalls, watched,
read by a later thread; skips itself without keys), and agent_sys's
thread checks its MXCSR. README: --alloc and programs with their own
malloc; the core dump.

Co-Authored-By: Claude Fable 5.2 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>the backends together: a ring under the debugger, strings that do not collide</title>
<updated>2026-11-10T15:15:20Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T15:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=a7504c6bb2ec9e906891e42bc3df28b276e67143'/>
<id>urn:sha1:a7504c6bb2ec9e906891e42bc3df28b276e67143</id>
<content type='text'>
ztrace record and dbg take --ring, --preload and --alloc: the target gets
the ring ztrace run gives it, and the debugger drains it while the target
runs (polling for the stop, so a full ring cannot hold both) and before it
reports a stop. A program compiled by ztrace cc, with the agent preloaded,
stopped at breakpoints, is one recording in order; test-together checks it.

Recording such a program showed the debugger's file names and the pass's
strings both counted from 1: event.stringId (a hash, top bit set) is now
what every producer without a table of its own uses.
</content>
</entry>
<entry>
<title>agent: bench-agent and its numbers, hooks with names, an archive cc can link</title>
<updated>2026-11-10T15:09:56Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T15:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=a10e1691dbe5b944812dc8761a450636bc247e3d'/>
<id>urn:sha1:a10e1691dbe5b944812dc8761a450636bc247e3d</id>
<content type='text'>
zig build bench-agent runs each capability against its native loop and
prints what it costs and writes; README has the table. ztrace run looks
at the ring a little longer before sleeping (a target that finds the
tracer asleep pays a futex wake an event). A hooked function's name is
defined as the string of its address, so the recorder's call stack reads
fib. A static link without libc's malloc says which -u to add. The
archive carries no stack probes, so cc links it in debug builds too.
Tests for --wrap (musl, zig cc) and for a recording that fills.

Co-Authored-By: Claude Fable 5.2 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>agent: the in-process backend, and ztrace run's options for it</title>
<updated>2026-11-10T15:09:34Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T14:44:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=ce7c0abf14e7ab056d5479adc3f05df9976e94e4'/>
<id>urn:sha1:ce7c0abf14e7ab056d5479adc3f05df9976e94e4</id>
<content type='text'>
libztrace-agent.so (preloaded) and libztrace-agent.a (linked in), one
source: map and thread_start at startup; alloc/free from the interposed
allocator; syscall_enter/exit through Syscall User Dispatch; call/ret
from int3 hooks; mem_write from watched regions diffed in-process; the
target-side API (include/ztrace.h, and the ztrace-agent module for Zig).
ztrace run turns each on (--alloc --syscalls --hook --watch), chooses the
moments (--cut), and stops the target at event kinds without ptrace
(--stop-at, --read, -i). test-agent records real targets and checks the
recordings.

Co-Authored-By: Claude Fable 5.2 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>ztrace: the event, the ring, the recording, a ptrace loop</title>
<updated>2026-11-10T14:08:49Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T14:08:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=0b29354e1ddf6cf75ac4c426a00dd3435ace5069'/>
<id>urn:sha1:0b29354e1ddf6cf75ac4c426a00dd3435ace5069</id>
<content type='text'>
One 64-byte Event for every backend; a shared-memory ring from target to
tracer with stop/resume; a Recorder that folds events into xitdb moments
(registers, memory in 64-byte chunks with known-byte masks, strings) and a
Trace that reads any moment back; a minimal ptrace Process; ztrace record,
run and dump. Per-area build files so the areas grow apart.
</content>
</entry>
</feed>
