Skip to content

Migrate lagoon jet to stateless SoftBLAS; add 64-bit variant#37

Merged
sigilante merged 1 commit into
mainfrom
sigilante/lagoon-softblas-migration
May 31, 2026
Merged

Migrate lagoon jet to stateless SoftBLAS; add 64-bit variant#37
sigilante merged 1 commit into
mainfrom
sigilante/lagoon-softblas-migration

Conversation

@sigilante
Copy link
Copy Markdown
Collaborator

Summary

Updates the lagoon jet to the current SoftBLAS API and reconciles the mirrors. SoftBLAS 40ff4fa made the library allocation-free/stateless: it dropped the global softblas_roundingMode and now takes a per-call rndMode argument 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 with softblas.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/vere ml/64). Preserves the 64-bit-specific bits — the braced u3r_mean {sample, &ptr} calling convention and syz_x+1 byte handling.
  • maroon: replace the drifted full copy of lagoon.c with a symlink to the canonical 32-bit jet, and roadmap the %real%i754 Hoon migration it still needs.
  • tests: fix test-mod-nearest-6r to use mod:(lake %n) instead of mod:la. la's default rounding is %z (matching Hoon's @rd default), so mod:la(5,3)=2 (toward-zero); the test wanted the round-nearest / IEEE remainder result (-1), which requires %n explicitly.

Testing

Built both 32-bit and 64-bit vere with the migrated jets (zig 0.15.2). Booted fake ships on each (~hex 32-bit, ~tex 64-bit) and verified add/dot/mmul/mod produce 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/softblas pin bump + jet sync (32-bit → develop, 64-bit → ml/64).

🤖 Generated with Claude Code

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>
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