Working notes: 2026-11-08 afternoon and evening, the Witch slide's whole run compiled
Claude, 17:54 MST on 11-08, on Matthew's ask to bring the work-notes gallery up to date.
In short
hazel-jit now compiles the Witch slide's whole program, and in Node a slider's step runs in 2.3 to 2.5 ms against the interpreter's 684 ms, with every value the program binds the same both ways (^ticket(722)). Report 47's experiments were timed again, more carefully: building values as data would save the evaluator a couple of percent at most, so the run itself has to be compiled, and two numbers report 47 had published were corrected. None of this is in the app yet.
Matthew, today
Let's keeping working on each of these. Should we hazel-jit more of the evaluator?
When only the slider changes, there's no reason to do anything related to syntax. Somehow, we need to fix that gap.
Compiled run first
Yes, check then wire
"Each of these" were the three parts of a small edit on the Witch slide, about 1 to 1.8 s in all: the evaluator (half a second to a second), the page drawing the whole slide four times with the syntax worked out again six times (about half a second), and the answer's trip from the worker (about a tenth).
A restart, first
No crash: the laptop has been up since 11-07 14:12, and the app's main process ran all day. The working session (hazel-jit slice 3) finished its turn at 10:32, after publishing report 47's experiments 3 to 5. At 11:17 the app's idle timer (30 minutes) disconnected it and stopped every server it had started (main.log: Idle timeout reached, disconnecting, then Stopped servers for worktree). Matthew's launches at 10:47, 11:19 and 16:17 were handed to the running app. Nothing was pushed after 10:30. A new session began at 16:18; localhost:8000 was restarted, and no other server, per Matthew's call of 11-06.
What was done
- ^report(47), first-order data (^ticket(718)). Experiment 2's first slice: the Witch's picture built node by node as terms with fresh ids, as terms with none, and as data. Two runs timed in 25 ms batches disagreed past any reading (a garbage collection of the page's heap fills such a batch), so experiments 2 to 5 are now timed in batches of at least 300 ms, every batch kept (
e1967c3a40). Timed so: building as data costs about what terms without ids cost; an id with its tag, kept in a tree, 59 to 91 ns; a run's ids 1.0 to 2.5% of the evaluator. Corrected, dated: an id is 12 to 14 ns to mint, not 157; into JS is about the same from data as from the term, not 1.4 times quicker. Printing held, about 50 times quicker as data. Fumola's door into JS (its wasm build in Node): 0.8 ms in, 9.3 ms out, most of it writing the tagged JSON. Published. - ^ticket(722), the compiled run (current). A livelit use and a splice are now compiled as what they hold, as the interpreter steps through them, and
%splice_valuehas a JS version. In Node on the laptop, onwitch.hz(2,222 lines, 53 livelit uses):Checked: the program's last expression replaced by a tuple of every name its top-level lets bind, run both ways: the 124 that hold data are the same, before the step and after it, and the step changed exactly 8 of them (interpreter compiled the program's run, as the CLI elaborates it 502 to 529 ms 4.2 to 5.0 ms, the JS made anew each run with each livelit's view called in the run, as the app elaborates it 653 ms 7.2 ms a slider's step, the neck 28 to 30 684 ms, the program changed and run again 2.3 to 2.5 ms, compiled once, the new model a parameter, 53 views sampled neck_length,neck,neck_at,face_at,hair_at,hat,outfit,drawn); the other 70 are functions or modules. 52 holes, one quotation and oneundefinedare not compiled and never reached. ^report(45) has a section on it, "The whole run, compiled", and ^report(46)'s speculation now points there. - Tickets minted: ^ticket(720), draw the slide once per edit; ^ticket(721), a slider's step skips syntax and statics; ^ticket(722), the compiled run, first in the queue on Matthew's word.
Where things are
trial/694-view-jit(worktree~/hazel-694-jit):238144b4b8ande1967c3a40(report 47's experiments),0926a80c74(the whole run compiled),4299efd6d3(--check),ab4a41e587(models as parameters,--views,--step). CI's full tests run on the newest; each push cancels the last one's.- The CLI:
node --stack-size=65500 -r ./src/CLI/polyfill.js _build/default/src/CLI/cli.bc.js jit [--views] [--check] [--step LABEL] FILE, in the worktree; it builds in about 40 s. - Not ours, left alone:
docs/hazel-architecture-july-2024.tldris modified in that worktree. - Servers: localhost:8000 only.
Next
- Report 45: the step's numbers, and that the first table's runs had no views in them.
- Wire the compiled run into the app: on a slider's step, call the slide's compiled program with the new model, and draw each livelit whose answer changed straight from its JS (the route compiled views already take); the slow path (syntax, statics, the worker, four redraws) still runs after. Then measure it in Firefox on GitHub's machines.
- Then ^ticket(721) and ^ticket(720), the page's side of a step, which the compiled run leaves as the next wall.
- Report 47: time experiment 1 again in 300 ms batches; the plan for the group.