noun: migrate lagoon jet to stateless SoftBLAS#1021
Open
sigilante wants to merge 4 commits into
Open
Conversation
Bump ext/softblas to urbit/SoftBLAS 40ff4fa (allocation-free; dropped the global softblas_roundingMode for a per-call rndMode arg; B1-B5 correctness fixes) and drop the now-deleted src/softblas_state.c from the wrapper. Update the lagoon jet for the new API: thread the active rounding mode through all 32 BLAS calls via a file-static _la_rnd (replacing the removed global), and rename the local _set_rounding -> _set_rounding_la to avoid colliding with softblas.h's new inline _set_rounding. The jet source matches numerics canonical (lagoon/vere). Built with zig 0.15.2; add/dot/mmul/mod verified correct on a fake ~hex. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump the vendored SoftBLAS dependency from 40ff4fa to 4e70272
(urbit/SoftBLAS HEAD). Notable upstream changes:
- macOS SoftFloat SIGBUS fix (use GCC platform.h for the Darwin build)
-- directly relevant to building vere on macOS.
- drotmg NaN/Inf hang fix; C1-C8 NaN/Inf/stride determinism coverage.
- new complex/integer/quad Level-1 routines and a qrot signature fix
(float16->float128); not compiled here and not called by the lagoon
jet, so no jet changes.
The lagoon jets call only {s,d,h,q}{dot,axpy,scal} + {s,d,h,q}gemm,
none of which changed (only their tests did), so jetted behavior is
identical. Updated build.zig.zon hash accordingly. Full vere build
verified (zig 0.15.2, aarch64-macos).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The %mod ray-op (u3qi_la_mod_i754) and mod-scalar (u3qi_la_mods_i754) jets rounded the quotient to nearest (IEEE remainder) and returned the dividend on a zero divisor, diverging from the Hoon +mod (C fmod: truncate toward zero; NaN on /0 or a non-finite operand). Truncate the quotient with softfloat_round_minMag, and on a non-finite quotient overwrite the result with the width's qNaN. Both functions, all four widths. The 64-bit variant of this fix (PR #1022) was verified on a live ship. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the 64-bit fix: introduce the n word-count constant (VERE64 ? 2 : 4) and use it everywhere instead of literal 4. No behavior change on the 32-bit build (n=4), but makes the file correct-by-construction if c3_w widens, and keeps it in sync with the vere64 rq.c sub fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Migrates the lagoon jet to the current SoftBLAS API.
ext/softblasto40ff4fa— the allocation-free / stateless rewrite that dropped the globalsoftblas_roundingModefor a per-callrndModeargument (plus B1–B5 correctness fixes, NaN canonicalization). Drop the now-deletedsrc/softblas_state.cfrom the wrapper's source list.pkg/noun/jets/i/lagoon.cfor the new API: thread the active rounding mode through all 32 BLAS calls via a file-static_la_rnd(replacing the removed global), and rename the local_set_rounding→_set_rounding_laso it doesn't collide withsoftblas.h's new inline_set_rounding.The jet source tracks numerics canonical (
lagoon/vere); see urbit/numerics#37.Testing
Built with zig 0.15.2;
add/dot/mmul/modverified correct on a fake~hex, and the full lagoon test suite passes (run against the matching 64-bitml/64build).🤖 Generated with Claude Code