Skip to content

nutpie: Add version 0.16.11 - #2420

Merged
luhenry merged 4 commits into
mainfrom
nutpie
Sep 28, 2026
Merged

luhenry merged 4 commits into
mainfrom
nutpie

Conversation

@luhenry

@luhenry luhenry commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Compiles PyMC/Stan's Rust (pyo3/maturin) NUTS sampler, built on nuts-rs, which uses faer (pure Rust) for its linear algebra rather than a BLAS/LAPACK backend. Upstream publishes no riscv64 wheel.

Mirrors upstream's ci.yml build_linux job, using PyO3/maturin-action directly (as upstream does) rather than cibuildwheel.

Differs from upstream

  • Drops --zig - building natively on the riscv64 runner, not cross-compiling.

Matrix: cp312/cp313/cp314 - upstream doesn't build cp314t either (pyo3 0.29, no abi3 feature).

Testing

  • Upstream gates release on its stan pytest suite, but stanc3 ships no riscv64 binary. pymc/flow need numba (-> llvmlite, parked) or jax, also unavailable here.
  • Instead samples a standard normal through nutpie's own dependency-free compiled_pyfunc API on each interpreter, exercising the compiled sampler end to end.

License: OK

Built on cp312/cp313/cp314; toy-model sample passed on all three.

Rust/pyo3 maturin project; nuts-rs uses faer (pure Rust) for linear
algebra, no BLAS/LAPACK anywhere in the tree, and cargo metadata
--filter-platform riscv64gc-unknown-linux-gnu resolves the identical
340-crate set as x86_64 (minus cpufeatures). The optional tch
(libtorch) dependency is unused by any default feature.

Mirrors upstream's own PyO3/maturin-action-based CI. Testing drives
the compiled sampler through nutpie's dependency-free compiled_pyfunc
API instead of upstream's stan/pymc/flow pytest suites: stanc3 ships
no riscv64 binary, and pymc/flow need numba (-> llvmlite, parked) or
jax. All of nutpie's own core runtime deps (pyarrow, pandas,
arro3-core, obstore) already have riscv64 wheels on our registry.
luhenry added a commit that referenced this pull request Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-28 21:35 UTC

The v0.16.11 tag's committed Cargo.lock still lists the "nutpie" crate
itself as version 0.16.10 (a stale self-entry left by upstream's release
tooling ahead of the Cargo.toml bump), so cargo needs to update that one
line on every build. --locked forbids it: `cargo metadata` fails with
"cannot update the lock file ... because --locked was passed", which
maturin surfaces as "cargo metadata failed. Does your crate compile with
`cargo build`?".

Upstream's own ci.yml never passes --locked to maturin-action either, so
this also brings the build back in line with upstream's own build shape.
Verified locally: cloning the v0.16.11 tag and running
`cargo metadata --locked` reproduces the exact error, and the diff from a
plain `cargo metadata` (no --locked) touches only that one version line,
not the wider dependency graph.
…locked

A crate's own release tooling can tag before regenerating Cargo.lock, so
the lock's self-entry for the crate names the previous version. cargo
happily fixes that one line on an unlocked build, but --locked forbids it
outright, and this isn't the "floating deps" case of gotcha 10 (no lock
in the sdist at all) since here the whole tree stays pinned except that
one line. The fix is to drop --locked to match upstream's own build
workflow rather than patch or regenerate Cargo.lock (nutpie 0.16.11, PR
#2420).
uv pip install only honors UV_* env vars, not PIP_*. The step used
PIP_EXTRA_INDEX_URL, which uv silently ignored, so it resolved against
public PyPI only and source-built numpy/scipy/pandas/pyarrow instead of
using the riscv64 wheels already on the registry, then failed outright
on pyarrow's sdist (needs a system Arrow C++ install not present here).

Swap to UV_EXTRA_INDEX_URL, add UV_INDEX_STRATEGY=unsafe-best-match so
uv's default first-index strategy doesn't stop at PyPI before reaching
the registry, and add UV_ONLY_BINARY for the packages observed building
from source.
@luhenry
luhenry marked this pull request as ready for review September 28, 2026 21:09
@luhenry
luhenry merged commit 3ccfb53 into main Sep 28, 2026
9 checks passed
@luhenry
luhenry deleted the nutpie branch September 28, 2026 21:27
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.

1 participant