Skip to content

Patch ndarray to AdaWorldAPI fork for SIMD polyfill access - #2

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/ndarray-simd-tract-o3jfrn
Sep 4, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
claude/ndarray-simd-tract-o3jfrn

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Points ndarray at the AdaWorldAPI fork (git, master branch) via [patch.crates-io], so tract resolves against the fork instead of upstream crates.io ndarray 0.17.

The fork is API-compatible (same 0.17.2) but adds a simd/hpc module (crate::simd::F32x16 etc.) behind a LazyLock-cached AVX-512 → AVX2 → NEON → scalar dispatch tier. This PR only wires the dependency — it changes no runtime behavior, since none of tract's existing linalg kernels call into the new module yet. tract's own SIMD is two distinct layers: hand-written assembly GEMM microkernels (linalg/x86_64/**/*.S.j2), out of scope here, and intrinsics-based element-wise/reduce/activation kernels (linalg/src/frame/*, linalg/src/x86_64/*), which are the actual candidate for a follow-up that registers a second, non-overlapping kernel implementation calling ndarray::simd::* alongside (never replacing) the existing hand-tuned ones.

Verified with cargo check -p tract-data -p tract-core against the patched dependency; cargo fmt --all clean.

🍍

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht


Generated by Claude Code

…yfill

Adds a [patch.crates-io] entry pointing ndarray at the AdaWorldAPI fork
(git, master branch, so it resolves in any checkout including CI). The
fork is API-compatible (same 0.17.2) but carries an additional simd/hpc
module (crate::simd::F32x16, AVX-512/AVX2/NEON/scalar tier dispatch)
that tract's own linalg kernels can be wired to later. This patch alone
changes no behavior; tract's element-wise/reduce kernels still use their
existing intrinsics path until a follow-up adds a parallel,
non-overlapping kernel registration that calls into it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht
@cursor

cursor Bot commented Sep 4, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6306fdc6-ea06-4c80-84bd-8a3ae8756af9)

Copy link
Copy Markdown
Owner Author

CI is red on the 1.91 matrix jobs (tract-nnef, tract-hir, test-pulse-core), and this is genuinely this PR's failure, not a flake:

error: rustc 1.91.1 is not supported by the following packages:
  fractal@0.1.0 requires rustc 1.94
  ndarray@0.17.2 requires rustc 1.97
  p64@0.1.0 requires rustc 1.94

tract's workspace declares rust-version = "1.91" (Cargo.toml:127) and CI enforces it on that toolchain. The AdaWorldAPI ndarray fork this PR patches in has rust-toolchain.toml permanently pinned to 1.97.1 (workspace-wide alignment across the AdaWorldAPI stack), so the two MSRVs conflict directly.

I can't resolve this unilaterally in either direction: lowering the fork's MSRV is out of scope here (it's a deliberate cross-repo pin), and raising tract's declared MSRV to 1.97 changes its public support matrix — that's a call for a human maintainer, not something to slip in as a side effect of a dependency patch.

Leaving this PR in draft, blocked on that decision, until directed how to proceed (bump tract's MSRV to 1.97, or hold this patch until the fork exposes a lower-MSRV-compatible path).


Generated by Claude Code

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 4, 2026 07:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed00742961

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.toml Resolved
Comment thread Cargo.toml Resolved
CI was failing across the whole 1.91 matrix because the ndarray fork
patched in by the previous commit requires rustc 1.97 (its
rust-toolchain.toml is permanently pinned there for AdaWorldAPI-stack
alignment). CI derives its tested toolchain straight from
Cargo.toml's rust-version, so bumping that one field re-targets every
job at once; updated the README rustc badge to match per the comment
above that field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht
Both api/rs/deny.toml and cli/deny.toml gate git dependencies with an
allow-git list that only permitted rustformers/llm; the ndarray patch
resolves ndarray/fractal/p64 from AdaWorldAPI/ndarray, which the
cargo-deny CI job would otherwise reject. Also trimmed the
patch.crates-io comment to the current constraint (why the git pin
exists) instead of narrating a follow-up change that hasn't happened.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht
@AdaWorldAPI
AdaWorldAPI merged commit ad12007 into main Sep 4, 2026
52 of 60 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