Skip to content

Upgrade nuts-rs, unify sampling cleanup, and add experimental WALNUTS - #54

Draft
andytimm wants to merge 10 commits into
mainfrom
feat/nuts-rs-0.19
Draft

andytimm wants to merge 10 commits into
mainfrom
feat/nuts-rs-0.19

Conversation

@andytimm

@andytimm andytimm commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

TL;DR

Upgrade nuts-rs to 0.19.1, consolidate sampling cleanup, and add experimental opt-in WALNUTS.

  • Share the sampling lifecycle between Stan models and custom density kernels, including error/interrupt cleanup and reuse.
  • Fix per-chain initialization ordering; add gradient-work diagnostics.
  • Make cli progress fit narrow consoles and avoid premature spread/gradient hints.
  • Require Rust 1.88 for source builds; improve missing-toolchain errors.

Waiting on upstream

Keeping this in draft until nuts-rs 0.19.2 lands, then updating and rechecking before release. It includes Adrian’s WALNUTS warmup fix and other changes we should pick up together. No nutpieR version bump yet.

We reproduced the warmup failure independently in Python nutpie; an isolated test of the official four-line fix resolved it. Default WALNUTS still wasn’t generally more efficient across posteriorDB, so it remains experimental and off by default. No local WALNUTS algorithm changes.

Validation

  • Latest release install: 1,214 assertions passed, no failures/warnings; three skips. Lifecycle subprocesses cover failures, interrupts, cleanup, and reuse.
  • 112-case posteriorDB comparison against 1.9.2: 105 complete pairs, broadly comparable runtimes; targeted follow-ups for outliers.
  • Full WALNUTS comparisons in R and independent Python nutpie, including a clean rerun with the official upstream fix.
  • Warm-cache/saved-draw compatibility, existing kernel reattachment, and isolated binary installation with Rust blocked passed.
  • Rust checks passed. Package check: zero errors, one local macOS linker warning, zero notes.

Windows/Linux, the full 0.19.2 migration, and installation of the eventual bumped version from R-universe still need validation.

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