Skip to content

Avoid CRAN CPU notes from Stan smoke test and example (#91) - #92

Merged
csmith701 merged 1 commit into
mainfrom
fix/cran-smoke-cpu-note-91
Oct 8, 2026
Merged

csmith701 merged 1 commit into
mainfrom
fix/cran-smoke-cpu-note-91

Conversation

@WestonVoglesonger

Copy link
Copy Markdown
Contributor

Closes #91.

What changed

  • Skip only the live Stan fit in test-hestia-smoke.R when testthat identifies a CRAN check. The package/data smoke assertion still runs there.
  • Set NOT_CRAN=true in the coverage job so CI continues to execute the real one-chain fit and its draw assertions.
  • Guard the expensive run_model() example with @examplesIf interactive(), retaining its existing \\donttest{} block as required by AGENTS.md. This keeps the example available interactively and prevents noninteractive --run-donttest checks from fitting four default chains at 2,000 iterations.

No Stan model or numerical API changed.

Evidence

The October 6 Debian incoming pretest reports test CPU/elapsed near 30 s / 6 s (5.4×). On an isolated install of the exact candidate commit 3680e470 on macOS R 4.5.3, the smoke-sized fit used 3.35 CPU seconds / 0.62 elapsed seconds. Explicit STAN_NUM_THREADS=1, OPENBLAS_NUM_THREADS=1, RcppParallel::setThreadOptions(numThreads=1), and stan_options(threading=TRUE, max_cores=1) did not reduce that ratio locally.

A local --as-cran check after the smoke skip but before the example guard ran the default fit under --run-donttest, using 519 CPU seconds / 86 elapsed seconds. After the example guard, that step completed without a fit.

Validation

  • NOT_CRAN=false: targeted smoke test passed, with the live fit skipped and the cheap assertion active.
  • NOT_CRAN=true: targeted smoke test ran the live Stan fit and passed all draw assertions.
  • R CMD build .: passed.
  • macOS R CMD check --as-cran --no-manual: installation, examples, --run-donttest examples, and tests passed. Used _R_CHECK_FORCE_SUGGESTS_=false because patchwork is not installed here, and disabled remote incoming checks because sandbox DNS is unavailable. The remaining two warnings (missing checkbashisms, qpdf) and two notes (clock verification, macOS xcrun_db temp file) are environment findings unrelated to this patch.
  • air format . --check, lintr::lint_package(), and git diff --check: passed.

Still to verify: Debian's CPU/elapsed check on the patched package. The PR CI matrix and coverage job will provide the next Linux validation; a CRAN incoming pretest remains the authoritative confirmation.

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@WestonVoglesonger
WestonVoglesonger marked this pull request as ready for review October 7, 2026 22:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-07T22:55:27.502696Z c6bc897 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.

@csmith701
csmith701 merged commit 686f5f0 into main Oct 8, 2026
17 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.

Avoid CRAN CPU/elapsed NOTE from Stan smoke test and example

2 participants