Skip to content

lagoon: NockVM jets for /lib/lagoon over sdfloat/sdblas (lagoon/nockapp) - #83

Open
sigilante wants to merge 1 commit into
mainfrom
sigilante/nockapp-lagoon-jets
Open

sigilante wants to merge 1 commit into
mainfrom
sigilante/nockapp-lagoon-jets

Conversation

@sigilante

@sigilante sigilante commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces #17. Phase 5 of doc/nockapp-softfloat-rs-spec.md: /lib/lagoon on NockVM, as a generated Hoon copy plus Rust jets.

What

  • lagoon/nockapp/crates/lagoon-jets: Rust jets for all 28 hinted arms of the +la door on %i754 rays, computing with sdfloat/sdblas (sigilante/RustFloat) so a NockApp returns exactly the bits the Hoon returns. Anything a jet does not handle punts to the Nock. hot_state() composes the hoon-138 built-ins with LAGOON_HOT for boot::setup.
  • lagoon/nockapp/hoon/: generated by scripts/sync-hoon.sh from lagoon/desk and libmath/desk, with the jet parent ..part rewritten to ..ut (hoonc compiles against bare hoon-138, which has no part). That one token is the only difference from the desk, so the copy is generated rather than maintained by hand. hoonc handles /- and /+ as-is; no sur move needed.
  • lagoon-kick: driver that fires a hoonc --arbitrary trap under the jets and runs each of the 153 lagoon tests as its own trap, with NOCK_TEST_JETS (NockVM's built-in jet-vs-Nock differential mode), a test filter, per-jet tracing and a sabotage self-check.
  • Desk fix: +argmax/+argmin indexed the boxed extreme with ~[0 0], so any rank but 2 crashed in pure Hoon; the vere jet was masking it. Now (reap (lent shape) 0). Needs a ship build check before a vere release.

Verification

Whole suite, all 28 hints in NOCK_TEST_JETS: 153 tests, 1 failed, no jet mismatch, 1.5 s. The failure is non-jet:

%mod follows the semantics #78 reconciled (quotient rounded in the door mode via +toi, crash on a non-finite quotient); the jet punts on a non-finite quotient so the Nock crashes, and all ten mod tests pass under test mode. Rebased onto main after #78–#81.

Divergences between the Hoon and the vere C jets that the run surfaced (the Rust follows the Hoon; see PORTING.md): +abs keeps -0 and canonicalizes NaN; +range/+linspace iterate where the C counts up front; +dot/+cumsum fold right to left; the ~/ %ravel hint is commented out so that jet cannot fire.

Not in this PR

%int2 and the other kinds the C jets cover; jets for hoon-138's own rs/rd/rh/rq doors (next).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TgBnKsUPYzkoPZonjePnaq

Phase 5 of doc/nockapp-softfloat-rs-spec.md. Adds lagoon/nockapp/, a Cargo
workspace with crates/lagoon-jets: Rust jets for all 28 hinted arms of the
+la door on %i754 rays, computing with sdfloat/sdblas (sigilante/RustFloat)
so a NockApp returns the bits the Hoon returns. Any input a jet does not
handle punts to the Nock.

Also:
- hoon/: generated copy of the desk (scripts/sync-hoon.sh) with the jet
  parent `..part` rewritten to `..ut` for bare hoon-138, plus the test
  files and a runner exposing each test as its own trap. This replaces
  the hand-maintained copy proposed in PR #17.
- lagoon-kick: driver that fires a hoonc --arbitrary trap under the jets,
  with NOCK_TEST_JETS (NockVM's jet-vs-Nock differential mode), a test
  filter, per-jet tracing and a sabotage self-check.
- desk: +argmax/+argmin indexed the boxed extreme with ~[0 0], crashing on
  any rank but 2 in pure Hoon (the vere jet masked it); index with
  (reap (lent shape) 0).
- doc/: the sdfloat spec with its implementation errata.

Whole suite (153 tests) under test mode for all 28 jets: 1 failure, non-jet
-- test-argmax hits a NockVM bug (the built-in `find` jet compares elements
with raw_equals, missing equal indirect atoms; nockchain/nockchain#184).
%mod follows the semantics reconciled in #78 (quotient rounded in the door
mode, crash on a non-finite quotient): the jet punts there so the Nock
crashes. Divergences
between the Hoon and the vere C jets that the run surfaced (abs on -0/NaN,
range/linspace element count, dot/cumsum fold order, commented-out ravel
hint) are recorded in lagoon/nockapp/PORTING.md; the Rust follows the Hoon.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgBnKsUPYzkoPZonjePnaq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant