Skip to content

refactor(jmle): own Adam/L-BFGS optimizer loops in Rust - #760

Merged
seonghobae merged 1 commit into
mainfrom
fix/jmle-rust-optimizer-green
Aug 11, 2026
Merged

refactor(jmle): own Adam/L-BFGS optimizer loops in Rust#760
seonghobae merged 1 commit into
mainfrom
fix/jmle-rust-optimizer-green

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

Public JMLE with backend="rust" now runs Adam, L-BFGS, and adam_lbfgs sequencing in compiled mlsirm-core (jmle_optimize*). Python keeps validation, packing, restarts, and the objective callback only.

Supersedes intentional RED draft #751 (issue #626 lineage).

Evidence

  • Local: cargo test -p mlsirm-core --lib jmle_opt — 4 passed
  • Local: pytest tests/test_jmle_rust_optimizer_ownership.py tests/test_fit_pipeline.py tests/test_cov_f_fit.py — ownership + fit suites green
  • Ownership sentinel monkeypatches legacy _adam/_lbfgs and requires zero calls under backend="rust"

Doctoring

  • docs/doctoring/jmle_rust_optimizer_ownership.md (APA 7th: Kingma & Ba 2015; Liu & Nocedal 1989; Nocedal & Wright 2006)
  • Changelog fragment docs/changelog.d/751-jmle-rust-optimizer.md

Product gates

Merge only when python (aggregate + 3.12/3.14), rust, package, fuzz are green.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1edf871f-fa62-4f10-a486-c677046c60f9

📥 Commits

Reviewing files that changed from the base of the PR and between 692bb95 and e050b80.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • crates/fast-mlsirm-py/src/lib.rs
  • crates/mlsirm-core/src/jmle_opt.rs
  • crates/mlsirm-core/src/lib.rs
  • docs/changelog.d/751-jmle-rust-optimizer.md
  • docs/doctoring/jmle_rust_optimizer_ownership.md
  • python/fast_mlsirm/fit.py
  • tests/test_jmle_rust_optimizer_ownership.py

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.

Copy link
Copy Markdown
Contributor Author

Current Draft review note for the eventual current-main reconciliation: the PyO3 optimizer wrappers currently normalize callback failures with format!("jmle objective failed: {e}") and tuple-extraction failures with format!("jmle objective must return ...: {e}"). Those strings can reflect caller-controlled Python exception content into the package error surface, conflicting with the repository's stable non-reflective error policy used at other public boundaries. When #760 is reconciled after the active #755 writer lane clears, add a fail-first regression with an objective callback whose exception text contains a sentinel secret/content value, then map callback/extraction failures to fixed package-owned messages without echoing e. Preserve process-control semantics as applicable and do not widen into optimizer mathematics. This finding is against predecessor head cc291fe884b1118ae98f2ca8ef8f978f7d6cc7d3; revalidate after current-main reconciliation before treating it as current.

@seonghobae
seonghobae marked this pull request as ready for review August 11, 2026 18:50
seonghobae added a commit that referenced this pull request Aug 11, 2026
Route backend=rust JMLE through jmle_optimize so moment updates, L-BFGS
two-loop/line-search, and adam_lbfgs sequencing no longer execute Python
_adam/_lbfgs loops. Adds ownership sentinel, APA doctoring, and changelog.

Supersedes draft #751 once product gates pass.
@seonghobae
seonghobae force-pushed the fix/jmle-rust-optimizer-green branch from e050b80 to 55be683 Compare August 11, 2026 19:21
@seonghobae
seonghobae merged commit 3b297cd into main Aug 11, 2026
1 check passed
@seonghobae
seonghobae deleted the fix/jmle-rust-optimizer-green branch August 11, 2026 19:21
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