Skip to content

perf(objective): compute linear_predictor distances with in-place NumPy operations - #345

Merged
seonghobae merged 3 commits into
mainfrom
claude/fast-mlsirm-pr-review-mt2e1z
Jul 31, 2026
Merged

perf(objective): compute linear_predictor distances with in-place NumPy operations#345
seonghobae merged 3 commits into
mainfrom
claude/fast-mlsirm-pr-review-mt2e1z

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

Clean recreation of #183 on the current main. The original branch's history was corrupted by a bad base merge that would have deleted several mainline modules (classification.rs, detect.rs, dif.rs, equating.rs, exposure.rs, gtheory.rs, utility.rs, classification.py, …) — verified with git merge-tree and documented on #183 before closing it.

Same two-file delta as the original Bolt optimization:

  • python/fast_mlsirm/objective.py — build the linear_predictor pairwise distance with in-place NumPy operations (+=, np.maximum(..., out=...), np.sqrt(..., out=...)), avoiding several N×J intermediate allocations per objective evaluation. Numerical results are unchanged; the NumPy path stays the parity reference for the Rust core.
  • .jules/bolt.md — records the in-place-operations learning per the journal convention.

Verification

  • tests/test_objective.py + tests/test_math.py: 16 passed, 5 skipped (no Rust core locally; parity tests skip by design).
  • The changed block matches the algebra of the previous implementation term-for-term (max(d², 0) + eps before the square root, identical clamping semantics).

Developer experience: removes redundant allocations from the hottest NumPy-path loop without touching the numeric contract shared with mlsirm-core.

User experience: identical outputs; lower peak memory on large N×J problems when running on the NumPy fallback backend.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f


Generated by Claude Code

…Py operations

Recreates PR #183 on a clean base: the original branch history was corrupted by a bad base merge that would have deleted several mainline modules. Same two-file delta: build dist_sq via in-place += and out= kernels, avoiding several N x J intermediate allocations per objective evaluation; numerical results unchanged (objective/math tests pass).
@coderabbitai

coderabbitai Bot commented Jul 29, 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: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 45d2185d-3a79-4b77-95ac-abefa23675de

📥 Commits

Reviewing files that changed from the base of the PR and between 52677b5 and c397d6c.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • python/fast_mlsirm/objective.py

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@seonghobae: I’ll review the changes in #345.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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