Skip to content

/lib/unum posit jets: hints, vere reference, valids appendix, benchmarks#65

Open
sigilante wants to merge 9 commits into
mainfrom
sigilante/posit-jets
Open

/lib/unum posit jets: hints, vere reference, valids appendix, benchmarks#65
sigilante wants to merge 9 commits into
mainfrom
sigilante/posit-jets

Conversation

@sigilante

Copy link
Copy Markdown
Collaborator

Jet-enables the pure-Hoon /lib/unum (2022 Posit Standard) and adds the
supporting reference + benchmarks. Pairs with the vere PR that vendors
SoftUnum (ext/softunum) and adds the non/unum jets.

What's here (numerics side)

  • libmath/desk/lib/unum.hoon — jet hints (~% %non ..part ~, ~/ %unum
    on ++pp, ~/ %<arm> on every jetted arm). rnd/flr/cel are
    eta-expanded into |= gates wrapping +round (behaviour-identical, now
    jettable); constants stay pure Hoon. All 54 arms hinted across
    posit8/16/32 (rpb/rph/rps).
  • libmath/vere/noun/jets/i/unum.c + libmath/vere/README.md — the
    reference (master) copy of the jet, hand-mirrored into vere, documenting the
    vere-side wiring. Only the hoon-135 (lowest/shippable kelvin) registration
    ships.
  • libmath/NEXT-STEPS.md — appendix assessing valids (Type-III interval
    unums): what they are, the directed-rounding primitive needed, open design
    questions, and the (harder) verification posture.
  • benchmark/lib/unum-cells + gen/bench-unum{,-grid} +
    tools/bench_unum_report.py, mirroring the bench-math protocol; results in
    benchmark/results/2026-06-28/unum/.

Verification

Every arm fires bit-exact on a live hoon-135 fakezod across posit8/16/32,
checked against the /lib/unum test vectors (test-round-rpb, test-convert-rpb,
test-ieee-*, test-quire-rpb, test-fdp-rpb, transcendental vectors).

Benchmarks (jetted vs interpreted)

arithmetic ~180–295×, transcendentals ~760–2000×, fused dot product ~760–2300×
faster jetted. Caveat: posit16/32 sqt/atan are slow even jetted (512-bit
wide_t bit-by-bit isqt) — a future optimization target.

🤖 Generated with Claude Code

sigilante and others added 8 commits June 28, 2026 08:21
…ndix

- libmath/desk/lib/unum.hoon: jet hints (~% %non ..part ~, ~/ %unum on ++pp,
  ~/ %add on the add arm) so the posit core registers for jetting, mirroring
  /lib/math.
- libmath/vere/noun/jets/i/unum.c: reference (master) copy of the posit add
  jet (bloq-dispatch on SoftUnum), hand-mirrored into urbit/vere; plus
  libmath/vere/README.md documenting the vere-side wiring (ext/softunum
  vendoring, w.h/q.h decls, 135/136/137 registration).
- libmath/NEXT-STEPS.md: appendix assessing valids (Type-III interval unums) --
  what they are, the directed-rounding primitive needed, open design questions
  (layout, projective-vs-bounded, set ops), and the harder verification posture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…only ship note

Sync the marker-free reference unum.c and document that add:rpb/rph/rps fire
bit-exact on a live hoon-135 fakezod.  Clarify that only the 135 dashboard
registration ships (we ship to the lowest/current kelvin); 136/137 edits are
local test-only scaffolding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/abs/sgn/sqt/fma)

Add ~/ jet hints to the scalar arms of /lib/unum (sub mul div, lth lte gth gte
equ neq, neg abs sgn, sqt, fma) and sync the reference unum.c (macro-based
bloq-dispatch wrappers).  Verified firing bit-exact on a hoon-135 fakezod
across posit8/16/32.  Only the 135 dashboard registration ships.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pow-n)

Hint the elementary/transcendental arms of /lib/unum and sync the reference
unum.c.  Verified firing bit-exact on a hoon-135 fakezod across posit8/16/32.
Constants remain pure Hoon.  Only the 135 dashboard ships.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ync reference

rnd/flr/cel eta-expanded to |= gates wrapping +round (behavior-identical, now
jettable); hint sun/san/toi/is-close.  Verified firing bit-exact on hoon-135
across posit8/32, matching the Hoon round/convert test vectors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d/rq)

Hint to-rh/rs/rd/rq and from-rh/rs/rd/rq; sync reference unum.c.  Verified
firing bit-exact on hoon-135 against the test-ieee vectors (cross-width + the
binary128 2-chub round-trip).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ce complete

Hint p-to-q/q-to-p/q-mul-add/q-mul-sub/q-add-p/q-sub-p/q-add-q/q-sub-q/q-negate/
fdp; sync reference unum.c.  Verified firing bit-exact on hoon-135
(test-quire-rpb / test-fdp-rpb).  All 54 /lib/unum arms now jetted across
posit8/16/32.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s jetted)

Mirror the bench-math protocol for posits: lib/unum-cells (per-(door,arm)
timing cell, one %*-specialized pp door covers posit8/16/32), gen/bench-unum +
gen/bench-unum-grid, and tools/bench_unum_report.py (scrapes the %bout grids,
adds a Python/SoftUnum ctypes column, prints per-call times + jet-vs-interp
speedup).  One jet binary, hint-toggle for jetted vs interpreted.

Results (results/2026-06-28/unum, hoon-135 fakezod): arithmetic ~180-295x,
transcendentals ~760-2000x, fdp ~760-2300x faster jetted than interpreted.
Noted caveat: posit16/32 sqt/atan are slow even jetted (512-bit wide_t
bit-by-bit isqt -- a future optimization target).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Record current status (SoftUnum + the full /lib/unum jet surface done, PRs
numerics #65 / vere #1046) and the prioritized roadmap: land PRs; posit
quire-GEMM for Lagoon/Saloon linear algebra (the high-value item); fix the
posit16/32 sqt/atan wide-isqt outlier; extend SoftUnum to posit64/128;
range-reduced/quire-accumulated transcendentals; alias layer; valids; Rust
SoftUnum; upstream to urbit/SoftUnum; decimal printer.  Mark old section 5
(Jets) done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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