Skip to content

lagoon/nockapp: jet hoon-138's rh/rs/rd/rq doors with sdfloat - #84

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

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

Conversation

@sigilante

@sigilante sigilante commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #83. Phase 6 of doc/nockapp-softfloat-rs-spec.md.

What

New crate lagoon/nockapp/crates/hoon-float-jets: NockVM jets for the ten hinted arms (add sub mul div sqt lth lte equ gte gth) of hoon-138's ++rh/++rs/++rd/++rq, computing with sdfloat. The doors already carry ~%/~/ hints, so they register at k.138/one/two/tri/<door>/<arm> with no Hoon change; every float operation on NockVM becomes bit-exact and fast, not just lagoon's. fma stays Nock (no fused multiply-add in sdfloat). lagoon_jets::hot_state() now composes the hoon-138 built-ins, these, and the lagoon jets.

Semantics follow ++ff/++fl: correctly rounded in the door's mode, canonical NaN, IEEE comparisons (-0 == +0, anything with NaN is false), sqt of -0 is -0, operands read as the low width bits as sea:ff does.

Verification

Check Result
lagoon suite, all 68 hints in NOCK_TEST_JETS 153 tests, the same single non-jet failure as #83 (nockchain#184)
float-tests.hoon, 320 rows, 40 float hints only add/sub/mul/div on the overflow-capable set in %u/%d/%z mismatch (48 rows)
float-diff.hoon, 6400 pairs, jets vs pure Hoon 592 differences, all ±MAX vs ±inf, 0 other

The one divergence is the known Hoon bug: ++fl overflows to infinity in every rounding mode where IEEE 754 saturates to the largest finite value under %z, %d (positive), %u (negative). Tracked in urbit/urbit#7426; the jets implement IEEE and those rows pass unchanged once the Hoon is fixed. scripts/float-diff-report.py is the check that nothing else differs.

The test-argmax crash in the suite is nockchain/nockchain#184 (the find jet compares with raw_equals).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TgBnKsUPYzkoPZonjePnaq

@sigilante
sigilante force-pushed the sigilante/nockapp-float-jets branch from 5b7be55 to c6112e3 Compare September 13, 2026 06:56
@sigilante
sigilante force-pushed the sigilante/nockapp-lagoon-jets branch from 691ab72 to b5ab2b4 Compare September 13, 2026 07:54
@sigilante
sigilante force-pushed the sigilante/nockapp-float-jets branch from c6112e3 to 3309f96 Compare September 13, 2026 07:54
…loat-jets)

Phase 6 of doc/nockapp-softfloat-rs-spec.md. New crate
lagoon/nockapp/crates/hoon-float-jets: NockVM jets for the ten hinted arms
(add sub mul div sqt lth lte equ gte gth) of hoon-138's own float doors,
registered at k.138/one/two/tri/<door>/<arm>; the doors already carry the
~% / ~/ hints, so no Hoon changes. fma stays Nock (sdfloat has no fused
multiply-add). lagoon_jets::hot_state() now composes URBIT_HOT_STATE, these,
and LAGOON_HOT.

Semantics follow ++ff/++fl: correctly rounded in the door's mode, canonical
NaN, IEEE comparisons (-0 == +0, NaN compares false), sqt of -0 is -0,
operands read as the low `width` bits like sea:ff.

Verification:
- lagoon suite under all 68 hints: unchanged, 153 tests, the same two
  non-jet failures.
- hoon/float-tests.hoon (scripts/gen-float-tests.py): 320 rows, one per
  (door, arm, value set, mode), under the 40 float hints: the only
  mismatches are add/sub/mul/div on the overflow-capable set in %u/%d/%z,
  where ++fl overflows to infinity and IEEE 754 saturates
  (urbit/urbit#7426).
- hoon/float-diff.hoon + scripts/float-diff-report.py: the same 6400
  input pairs with and without the jets differ 592 times, every one
  +-MAX against +-inf, never otherwise.

Also: lagoon-kick --raw now prints the whole product noun, and
HOON_FLOAT_JET_DISABLE / HOON_FLOAT_JET_TRACE diagnostics.

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