Migrate lagoon jet to stateless SoftBLAS; add 64-bit variant#37
Merged
Conversation
Update the lagoon jet to the current SoftBLAS API (urbit/SoftBLAS
40ff4fa, which dropped the global softblas_roundingMode in favor of a
per-call rndMode argument), and reconcile the mirrors.
- lagoon/vere (32-bit): thread the active rounding mode through all 32
BLAS calls via a file-static _la_rnd (replacing the removed global),
rename the local _set_rounding -> _set_rounding_la to avoid colliding
with softblas.h's new inline, and add #include "c3/motes.h".
- lagoon/vere64 (64-bit): same migration, formulated for the 64-bit vere
(urbit/vere ml/64) — preserves the braced u3r_mean {sample,&ptr} calling
convention and syz_x+1 byte handling. Built and the full test suite
passes on a fake ~tex booted from ml/64.
- maroon: replace the drifted full copy of lagoon.c with a symlink to the
canonical 32-bit jet, and note the %real->%i754 Hoon migration it still
needs in the README roadmap.
- tests: fix test-mod-nearest-6r to call mod:(lake %n) instead of mod:la.
la's default rounding is %z (matching Hoon's @rd default), so mod:la
yields the toward-zero result (5 mod 3 = 2); the test wanted the
round-nearest (IEEE remainder) result (-1), which requires %n explicitly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced May 31, 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.
Summary
Updates the lagoon jet to the current SoftBLAS API and reconciles the mirrors. SoftBLAS
40ff4famade the library allocation-free/stateless: it dropped the globalsoftblas_roundingModeand now takes a per-callrndModeargument on every routine (and fixed B1–B5 correctness bugs, NaN canonicalization, etc.).Changes
lagoon/vere(32-bit canonical): thread the active rounding mode through all 32 BLAS calls via a file-static_la_rnd(replacing the removed global), rename the local_set_rounding→_set_rounding_la(avoids colliding withsoftblas.h's new inline_set_rounding), and add#include "c3/motes.h".lagoon/vere64(64-bit): the same migration, formulated for the 64-bit vere (urbit/vereml/64). Preserves the 64-bit-specific bits — the bracedu3r_mean {sample, &ptr}calling convention andsyz_x+1byte handling.maroon: replace the drifted full copy oflagoon.cwith a symlink to the canonical 32-bit jet, and roadmap the%real→%i754Hoon migration it still needs.test-mod-nearest-6rto usemod:(lake %n)instead ofmod:la.la's default rounding is%z(matching Hoon's@rddefault), somod:la(5,3)=2(toward-zero); the test wanted the round-nearest / IEEEremainderresult (-1), which requires%nexplicitly.Testing
Built both 32-bit and 64-bit vere with the migrated jets (zig 0.15.2). Booted fake ships on each (
~hex32-bit,~tex64-bit) and verifiedadd/dot/mmul/modproduce correct values. The full lagoon test suite passes on the 64-bit~tex(all 9 suites,ok=%.y).Companion vere PRs carry the matching
ext/softblaspin bump + jet sync (32-bit →develop, 64-bit →ml/64).🤖 Generated with Claude Code