Repository navigation
lance-graph-onnx: Tanh and Exp as ULP-bounded aliases (onnx::bounded) - #1758
Conversation
…xed it vml_vsneg_is_not_onnx_neg_on_positive_zero pinned vsneg(+0) == +0 so it would fail once ndarray fixed the sign of zero. ndarray #368 did, and the test fails on main (Rust Tests run 40047762268). The replacement pins that vsneg and Neg both give -0.0 for +0.0 in the SIMD body and the tail. Neg stays inline: vsneg is f32-only and writes into a view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
ndarray #368 and #369 bring vml::vsexp and vml::vstanh within 1 ULP of the correctly rounded result with exact special values. They are re-exported under onnx::bounded, not at the crate root, so the root stays exact-only and a caller cannot pick up a bounded operator by accident. The crate doc's exact-versus-approximate note now says that, and names Log and Sigmoid as still unexported. Conformance adds: alias identity for both, special values and every tail length 0..70 (bit-exact where the result is a zero, infinity or NaN, else <= 2 ULP of f64 rounded once), a log-spaced tanh sweep from 1e-44 to 1e4 with oddness and the [-1, 1] bound, and exp across [-104, 90] including subnormal results and overflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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. |
…marked shipped - PR_ARC_INVENTORY: compact entries for #1742–#1758, recorded from each merge commit and its changed-file list. - LATEST_STATE: "main after #1758" section. - STATUS_BOARD: D-ONNX-NATIVE-0 (#1754), D-DRF-1 (#1756), D-NFR-6 (#1755), D-MPF-1 (#1752) and D-ONNX-0 (#1744) were still "In PR" / "this branch"; now point at their merge commits. - INTEGRATION_PLANS: index row for six plans merged without one (#1745–#1749, #1751). - d-onnx-relalg-cap-v1 (#1744's S0): owner supersession note adopting D-NFC §1/§2 by reference (D-NFC §6 step 1); OP-ONNX-1 marked answered by D-NFC §4 + lance-graph-onnx. Which S0 draft carries the adapter layer stays open for the three owners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
What
onnx::bounded::tanh_f32re-exportsndarray::hpc::vml::vstanh, andonnx::bounded::exp_f32re-exportsvml::vsexp. Both are aliases: the symbols are the native functions (pinned byaliases_are_the_native_symbols).boundedmodule, not at the crate root. The root stays exact-only, so a caller cannot pick up a bounded operator by accident. That is the separation the plan's crosswalk asked for.LogandSigmoidas still unexported.d-onnx-native-v1.mdgets a dated note under the crosswalk.This PR carries the
vsnegtripwire fix from #1757 (c5d8ef216), becausemainis red on that test since ndarray #368. It becomes a no-op once #1757 merges.Why it is safe now
AdaWorldAPI/ndarray#368 and #369 have merged. Measured against
f64evaluated and rounded once:vstanhis within 1 ULP on all 2³² inputs, odd and monotone, and keeps ±0.vsexpis within 1 ULP on [−104, 89], subnormal results included; ±inf and overflow are exact.Tests
The conformance tests add:
Results:
cargo test --release -p lance-graph-onnx: 13 conformance tests plus the doctest pass.-D warningsand fmt are clean.a9dd1e0(before feat(sprint-9): close PR #355 Tier-A deferred backlog (4 items) + correct misdiagnosed hpc-extras issue #369), both new tests fail:Tanh(-0) = +0, andTanh(1e-44) = 0, 7 ULP off.Not done here: graph fusion, and an ONNX Runtime comparison (offline; manifest item D5 in #1757).
Generated by Claude Code