Repository navigation
ndarray::simd re-exports + checked i64 arithmetic for ONNX shape ops - #401
Merged
Merged
Conversation
…darray::simd Plain pub use re-exports of hpc::vml (vsexp, vsln, vssqrt, vsabs, vsadd, vsmul, vsdiv, vssin, vscos, vspow, vstanh, vserf, vsfloor, vsceil, vsround, vsneg, vstrunc), hpc::activations (sigmoid_f32, softmax_f32, log_softmax_f32, softmax_axis_f32, log_softmax_axis_f32) and, under the same target_arch = "x86_64" gate as its module, hpc::amx_matmul's matmul_f32_batched and MatmulError. No wrappers. matmul_f32 is not re-exported because under runtime-dispatch that simd:: name is the simd_runtime trampoline. tests/simd_facade_reexports.rs checks each simd:: path gives bit-identical output to its hpc:: home. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
hpc::checked_i64 has one policy for every operation: a result outside i64 is refused with the operation, output position and operands, never wrapped or saturated. Div truncates toward zero; a zero divisor and i64::MIN / -1 are refused. checked_binary_i64 takes flat slices where a length-1 operand broadcasts, refuses any other length, and leaves out unchanged on refusal. range_i64 follows ONNX Range, computes the length exactly in i128, refuses delta 0 and a range longer than out. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
AdaWorldAPI
marked this pull request as ready for review
October 30, 2026 11:26
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
AdaWorldAPI
pushed a commit
that referenced
this pull request
Oct 30, 2026
Records #402, plus the rows #400 and #401 moved. New dots N22-N26: the adders as facade words with no consumer yet, the exp speed-up reaching every exp-based word, AVX2 select mask packing as a second array-backed cost, NEON scalar fcmp/csel in simd_exp_f32, and the transactional Abacus against the non-transactional eager counter. Fruit L20, L21, H12, H13; PR C not planned. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
This was referenced Oct 30, 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.
Two independent commits.
1.
7257896— re-exports throughndarray::simdPlain
pub use, no wrappers, no behaviour change:hpc::vml:vsexp,vsln,vssqrt,vsabs,vsadd,vsmul,vsdiv,vssin,vscos,vspow,vstanh,vserf,vsfloor,vsceil,vsround,vsneg,vstrunchpc::activations:sigmoid_f32,softmax_f32,log_softmax_f32,softmax_axis_f32,log_softmax_axis_f32hpc::amx_matmul:matmul_f32_batched,MatmulError, gated#[cfg(target_arch = "x86_64")]like the modulematmul_f32itself is not re-exported: underruntime-dispatchthe namesimd::matmul_f32already belongs to thesimd_runtimetrampoline, which has a different signature.Tests:
tests/simd_facade_reexports.rs(4) checks eachsimd::path gives bit-identical output to itshpc::home. Disable run: droppingvserffrom the re-export fails the build withE0425.2.
df04b87—hpc::checked_i64(the Tract-requested int64 wishlist)Signatures:
Policy, shared by every operation through
checked_i64:i64is refused with the operation, output position and operands. Never wrapped, never saturated.Divtruncates toward zero (ORT integer division). Zero divisor →DivisionByZero;i64::MIN / -1→Overflow.LengthMismatch. N-d broadcasting stays in Tract's graph.outis unchanged: every element is checked beforeoutis written.Rangefollows ONNX:max(ceil((limit - start) / delta), 0)elements, computed exactly in i128. A range running the wrong way is empty.delta == 0→RangeZeroDelta. A range longer thanout→RangeExceedsCapacity(the bound is the caller's buffer). The fulli64::MIN..i64::MAXspan reportslen = u64::MAX.Negative fixtures (all in
negative_fixtures_refuse_with_their_informationand its neighbours):Add(i64::MAX, 1)Overflow { op: Add, position: 0, lhs: i64::MAX, rhs: 1 }Sub(i64::MIN, 1)Overflow { op: Sub, .. }Mul(3_037_000_500, 3_037_000_500)Overflow { op: Mul, .. }Mul(i64::MIN, -1)Overflow { op: Mul, .. }Div(i64::MIN, -1)Overflow { op: Div, .. }Div(5, 0)DivisionByZero { position: 0, lhs: 5 }Add([1, 2, i64::MAX, 4], [1])Overflow { position: 2, .. },outunchangedDiv([6, 6, 6, 6], [3, 2, 1, 0])DivisionByZero { position: 3, lhs: 6 },outunchangedLengthMismatch { lhs: 2, rhs: 4, out: 4 }Range(0, 10, 0)RangeZeroDeltaRange(0, 5, 1)into 4 slotsRangeExceedsCapacity { len: 5, capacity: 4 },outunchangedTests (7 unit + 3 doctests), all pass on x86_64 and i686:
i64::MIN,i64::MAX, ±√2⁶³ and ±2³²) × 4 ops against exact i128 arithmetic: each result either matches, or is refused exactly when the exact value does not fit;-7 / 2 = -3, not-4);start, limit ∈ [-9, 9]and 7 deltas, plus both ends ofi64.Disable runs, each red then restored:
Addwrapsslices_broadcast_…(out written on refusal)slices_broadcast_…unsupported_broadcasting_refusesdelta == 0acceptedrange_refuses_zero_delta_and_overlong_outputrange_refuses_zero_delta_and_overlong_outputNo shape graph, no ONNX interpreter, no new generic types. Not re-exported through
ndarray::simd: this is plain scalar arithmetic, not SIMD.Checks
cargo clippy --features std --all-targets -D warnings: clean.cargo check --tests: clean (commit 1).--features std,runtime-dispatch: clean, no name collision.Not merged automatically.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY