Add Urbit headers and start adding rounding modes.#1
Merged
Conversation
… add test Completes the per-call rounding-mode redesign: - _set_rounding(): restore the documented 'a' (round-away/near-maxMag) mode and make an unknown mode a no-op (leave SoftFloat's mode unchanged) rather than exit(1). - Add the `const uint_fast8_t rndMode` parameter and a leading _set_rounding(rndMode) call to every implementation whose header prototype already declared rndMode (all asum/axpy/copy/dot/nrm2/scal/swap/gemv/gemm variants, plus the not-yet-built complex and rotation routines, kept consistent with the header). i*amax and sdsdot/hsdot are left unchanged to match their prototypes (their headers do not take rndMode). - Update all test call sites to pass a rounding mode. - New test_saxpy_rounding: 1.0 + 2^-24 (exactly half a ULP) rounds to 1.0 under 'n' (ties-to-even) but up to the next float under 'u', proving the rndMode argument actually changes the result. Would fail if _set_rounding were a no-op. The built suite compiles against the header and passes 133/133. Note: this is a breaking API change for callers (every routine gains a trailing rndMode argument); Vere's lagoon jets are being updated in tandem. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mode # Conflicts: # README.md # include/softblas.h # src/blas/level1/caxpy.c # src/blas/level1/ccopy.c # src/blas/level1/scasum.c # src/blas/level1/scnrm2.c
…s_state.c The merge auto-took master's Makefile, which lists softblas_state.c (removed in this branch's per-call rounding redesign) and the WIP complex routines (scasum/ccopy don't compile yet). Restore this branch's intended BLAS_SRCS (the 40 built REAL routines) and remove the resurrected softblas_state.c. Builds and passes 140/140. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sigilante
added a commit
that referenced
this pull request
May 30, 2026
SoftBLAS routines operate in place on caller-provided buffers; the only heap allocation in the compiled library was qasum's accumulator (which also leaked). Replace it with a stack float128_t. The library now does zero heap allocation. The svec/dvec/hvec/qvec helpers (the only other malloc users) are test-only conveniences — never called by the library or by Vere/Lagoon. Move them, with float128_pair_t, out of the public header into the test header, and add NULL checks. With nothing in the library allocating, the Urbit-allocator coupling is unnecessary: remove the `#ifdef VERE` block (`#include "noun.h"`, `#define malloc u3a_malloc`) and delete the 20 vendored Urbit runtime headers that PR #1 copied into include/. `VERE` was defined nowhere (not in SoftBLAS's build, not in Vere's ext/softblas build), so the block was inert; and when SoftBLAS builds inside Vere, Vere's own headers are already on the include path, so the copies were only a staleness liability. include/ is now just softblas.h. If the host allocator is ever needed it can be supplied via a one-line host shim, not a vendored header tree. 143/143 tests pass; CI builds the same set. 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.
No description provided.