Conversation
sigilante
force-pushed
the
sigilante/twoc
branch
from
June 29, 2026 16:16
50e35ba to
7d09c3e
Compare
sigilante
force-pushed
the
sigilante/unum
branch
from
June 29, 2026 16:17
93b7a7a to
d66526b
Compare
sigilante
force-pushed
the
sigilante/twoc
branch
from
June 29, 2026 18:36
7d09c3e to
6badaf2
Compare
Add lib/unum.hoon (numerics /lib/unum): Standard-2022 posit arithmetic (es=2 uniform across widths) -- encode/decode, the elementary ops and transcendentals, and quire support. Pure Hoon; depends on /+ twoc for two's-complement helpers. Add tests/lib/unum-core, unum-fns, unum-edge. Verified: arvo compiles and all three suites are green on a fresh %zuse-408 ship. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sigilante
force-pushed
the
sigilante/unum
branch
from
June 29, 2026 18:40
d66526b to
be7c45f
Compare
- H12: document ++fdp silent truncation behavior - M24-M25: doccord correctness fixes - L15: add per-arm doccords to seven quire op arms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t hints) This PR was cut from urbit/numerics before two changes landed there; this commit mirrors numerics main's lib/unum.hoon and its tests byte-for-byte, per numerics' merge guide (numerics Hoon is ground truth, mirrored to pkg/arvo/lib/). 1. Correctly rounded transcendentals (urbit/numerics#71). The series expansions this PR carried were one ulp off for several posit32 results. Measured on a ship, the previous head of this branch returned the left-hand column; numerics' exact-rational posit encoder (80-digit mpmath) gives the right-hand one, which is what the refreshed library returns: op before (series) correctly rounded (now) exp(0.5) 0x4530.94c8 0x4530.94c7 cos(0.5) 0x3e0a.9404 0x3e0a.9403 tan(0.5) 0x38bd.a7ad 0x38bd.a7ae log(2) 0x3b17.2180 0x3b17.217f #71 replaced them with range-reduced Chebyshev approximations and refreshed tests/lib/unum-edge and unum-fns to match; both come across here too (unum-core is unchanged). 2. Jet hints (urbit/numerics#65, #79). The library now carries its ~%/~/ hints, matching the registration in urbit/vere#1046, whose SoftUnum jets are already on the same Chebyshev basis -- so the Hoon and the jets agree bit-for-bit. Without #1046 the hints are inert. lib/math in #7372 ships its hints the same way. Nothing from this PR's previous commits is lost: every line of the audit-fix commit (d22c333) is present in numerics main. unum calls only the twoc door arms gth/lth/gte/lte/msb, all defined in #7373's lib/twoc, and nothing else in the tree references lib/unum. Verified on a fresh fakezod (hoon-135/zuse-408) with #7373's lib/twoc and this tree's lib/test: tests/lib/unum-core 12, unum-edge 28, unum-fns 15 -- all 55 green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgBnKsUPYzkoPZonjePnaq
sigilante
added a commit
that referenced
this pull request
Sep 22, 2026
Mirrors urbit/numerics main's lib/twoc.hoon byte-for-byte, per numerics' merge
guide (numerics Hoon is ground truth, mirrored to pkg/arvo/lib/). This PR was
cut before urbit/numerics 0955657 added the library's jet hints.
The change is hints only -- no arm's behavior changes:
~% %non ..part ~ jet registration, nested in %non like /lib/unum
and /lib/math
~/ %twid on the door
~/ %add %neg %sub %mul %abs %div %rem %pow %gth %lth %lte %gte
Without registered jets the hints are inert. lib/math in #7372 and lib/unum
in #7374 ship their hints the same way. tests/lib/twoc.hoon is already
identical to numerics main, and every line of this PR's audit-fix commit
(a25539f) is present there.
Verified on a fresh fakezod (hoon-135/zuse-408) with the whole stack built on
this twoc: twoc 13, and the dependents unum (#7374, 55) and fixed (#7375, 13)
all green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgBnKsUPYzkoPZonjePnaq
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.
Adds
lib/unum.hoon— Standard-2022 posit arithmetic (es=2 uniform acrosswidths): encode/decode, elementary ops, transcendentals, and quire support.
Pure Hoon.
Stacked on #7373 (
lib/twoc) — unum uses/+ twocfor two's-complementhelpers. Retarget to develop once #7373 merges.
tests/lib/unum-{core,fns,edge}.hoonincluded. Verified: arvo compiles and allthree suites are green on a fresh %zuse-408 ship.
Second of the numerics-library series (twoc → unum → fixed → complex).
🤖 Generated with Claude Code
Refreshed to numerics
main(2026-09-21)This PR was cut before two numerics changes landed. Commit
557459ee18mirrors numericsmain'slib/unum.hoonand its tests byte-for-byte:exp(0.5),cos(0.5),tan(0.5)andlog(2)at posit32 came back…94c8,…9404,…a7ad,…2180; the correctly rounded values, which the refreshed library returns, are…94c7,…9403,…a7ae,…217f.tests/lib/unum-edgeandunum-fnsare refreshed to match.Nothing from the earlier commits is lost — every line of the audit-fix commit is present in numerics
main.unumuses onlytwocdoor arms that #7373 defines.Re-verified on a fresh fakezod (hoon-135/zuse-408) against #7373's
lib/twoc:unum-core12,unum-edge28,unum-fns15 — all 55 green.