jets: +grab jet for the +sip lazy jam cursor - #1054
Draft
sigilante wants to merge 1 commit into
Draft
Conversation
Jets the hot path of +sip (urbit/urbit#7385): +grab, atom at axis in a jammed noun. Registered as an i-tier library jet under %non/%sip, mirroring lagoon/math. The jet subsumes +dive, +gaze, +fetch, and the +hop skips on the path -- one jet, one parity surface. pkg/noun/jets/i/sip.c: no C recursion (explicit pending-node skip counter), 64-bit bit-cursor arithmetic, bounds-checked against u3r_met. Malformed input, overrun, forward/self backref, out-of-range axis, and type mismatch all u3m_bail(c3__exit) exactly where the Hoon crashes -- crash parity. Registration in 135/tree.c (%non/sip/grab), decls in w.h/q.h, source wired into build.zig. Verified: jet binds and every +grab result matches +cue / +slot ground truth across the +sip parity suite; head-tag dispatch on a 1 MB jam is ~880x faster than +cue, flat across 1 KB -> 10 MB payloads. Companion to urbit/urbit#7385 (the +sip library and tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BlankCola
approved these changes
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft — companion to urbit/urbit#7385 (the
+siplibrary and tests). Merge that first; this is the jet for its hot path.Summary
+sipis a read-only cursor over a jammed noun (see urbit/urbit#7385). This jets its one hot entry point —+grab, atom at axis — as ani-tier library jet under%non/%sip, mirroringlagoon/math. The jet subsumes+dive,+gaze,+fetch, and the+hopskips on the path: one jet, one parity surface.pkg/noun/jets/i/sip.c—u3wi_sip_grab(wrapper) /u3qi_sip_grab(core). No C recursion — the subtree skip uses an explicit pending-node counter (O(1) space). 64-bit (c3_d) bit-cursor arithmetic; every read bounds-checked againstu3r_met(0, a).pkg/noun/jets/135/tree.c— register%non/sip/grab(k135; the running kernel is~% %k.135).pkg/noun/jets/w.h,q.h— declareu3wi_sip_grab/u3qi_sip_grab.pkg/noun/build.zig— wire injets/i/sip.c.Crash parity
Malformed input, buffer overrun, a forward or self backref, an out-of-range axis, axis-into-atom, and fetch-of-cell all
u3m_bail(c3__exit)— exactly where the Hoon spec crashes. Following a backref asserts a strictly-decreasing offset, so hostile backref chains terminate by construction.Verification
Built (
DEVELOPER_DIR=/nonexistent zig build -Dtarget=aarch64-macos) and booted on a fake ship with the+siplibrary from urbit/urbit#7385:+grabresult matched+cue/+slotground truth over the full suite — hand-computed USTJ vectors, 400 random DAG-shaped nouns (forced cell + atom backrefs), and hostile-input crash tests. Full%/teststree green.+grabon a[%tag …]head-tag lookup is flat at 1.27 µs across 1 KB → 10 MB jams (<1% spread) and ~880× faster than+cue+slot at 1 MB (~9000× at 10 MB); ~16× over the same walk un-jetted. Worst case (5000-deep right-spine, deepest axis, O(N)): jetted+grab303 µs vs 71 ms un-jetted (235×) and still beats cue+slot for a single lookup. Full table in lib: add +sip lazy jam cursor urbit#7385.No changes to
jam/cue/mat/rub; this is purely additive.🤖 Generated with Claude Code