Skip to content

vml: vserf (ONNX Erf); simd: blend_i32_scalar (ONNX Where with scalar Y) - #399

Merged
AdaWorldAPI merged 3 commits into
masterfrom
ccr-45a41fb4-0j3i0l
Oct 30, 2026
Merged

AdaWorldAPI merged 3 commits into
masterfrom
ccr-45a41fb4-0j3i0l

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

This adds the two ndarray functions that synergy-map R5 named for lance-graph's ONNX registry probe (H11, L18). It also adds R6 to .claude/knowledge/synergy-map-2026-10-29.md.

hpc::vml::vserf (ONNX Erf)

  • Three ranges, each computed by one 16-lane kernel:
    • |x| < 1: the Cephes erff polynomial.
    • 1 ≤ |x| < 4: 1 − exp(−x²)/x · P(1/x²).
    • |x| ≥ 4: exactly 1.0.
  • Accuracy: at most 2 ULP from the correctly rounded value (an f64 series reference). The tests cover six magnitude bands from 1e-38 to 100, both signs, and both the full 16-lane chunks and the remainder.
  • Special values: the function is exactly odd, erf(-0) = -0, ±inf gives ±1, and NaN stays NaN.
  • A strided array gives the same bits as a contiguous one.
  • Cephes uses a second erfc polynomial from 2. erf doesn't need it: a disable run that dropped it stayed green, and a prototype measured the same 2 ULP worst case with one polynomial. It was removed.

simd::blend_i32_scalar

  • dst[i] = mask bit i ? a[i] : b, for Where(C, X, y) with a scalar y, without filling a b vector first.
  • Pinned against blend_i32 with a filled vector over 131 lanes: two full words, one partial word, and stray bits past the end.
  • It uses a plain index loop for the same reason as blend_i32.

Evidence

  • Each guard was disabled in turn, then restored from the commit, and its test went red:
    • sign restore removed: 3 tests red;
    • NaN clamped by a < 4 select: special-values test red;
    • small branch computed on x instead of |x|: 2 tests red;
    • scalar ignored in blend_i32_scalar: red.
  • cargo fmt --check and cargo clippy --features std -- -D warnings are clean.
  • Both doctests pass, and the facet-stride guard is clean on the diff.

The lance-graph side follows separately: register Erf over vserf, and route a scalar-Y Where to blend_i32_scalar.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
…unneeded second erfc polynomial

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cef9242e-ea35-43a3-89c8-bdb627598e33
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 30, 2026 09:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T09:33:19.597284Z 3bbc7cc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit c96c1b9 into master Oct 30, 2026
30 checks passed
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.

2 participants