Skip to content

fix(inference): preflight observed-information work budgets - #803

Merged
seonghobae merged 2 commits into
mainfrom
fix/observed-info-budget-green
Aug 12, 2026
Merged

fix(inference): preflight observed-information work budgets#803
seonghobae merged 2 commits into
mainfrom
fix/observed-info-budget-green

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Dense finite-difference observed_information preflights package-owned objective-call and fixed-width workspace budgets before the first objective evaluation.
  • Replaces dense identity workspace with a reusable trial vector.
  • Stacked on fitstats/docs fail-closed base for product CI.

Supersedes

Test plan

  • tests/test_observed_information_work_budget.py
  • tests/test_information_matrix_robustness.py
  • docs + fitstats fail-closed smoke

Summary by CodeRabbit

  • Bug Fixes

    • Added preflight checks for observed_information calculations, including objective-call and workspace limits.
    • Oversized or invalid parameter configurations are now rejected before expensive objective evaluation.
    • Reduced memory usage during finite-difference calculations, improving reliability for larger models.
    • Improved model-comparison error handling by hiding hostile conversion and iteration failures while preserving MemoryError reporting.
  • Documentation

    • Added changelog entries describing the new resource safeguards and error-handling improvements.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9bd6345-9b9f-4e3d-8818-20fe98e678ec

📥 Commits

Reviewing files that changed from the base of the PR and between 59fd9e7 and 783b7e5.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/changelog.d/781-observed-information-work-budget.md
  • python/fast_mlsirm/inference.py
  • tests/test_information_matrix_robustness.py
  • tests/test_observed_information_work_budget.py

📝 Walkthrough

Walkthrough

observed_information now preflights objective-call and workspace budgets, rejects unsupported parameter sizes before evaluation, and reuses one trial vector instead of a dense identity matrix. Tests cover resource accounting, early rejection, and workspace allocation.

Changes

Observed-information safeguards

Layer / File(s) Summary
Preflight limits and reusable workspace
python/fast_mlsirm/inference.py
The implementation estimates objective calls and workspace bytes before evaluation. It validates packed parameter counts and reuses one trial vector for finite-difference perturbations.
Budget and workspace validation
tests/test_observed_information_work_budget.py, tests/test_information_matrix_robustness.py
Tests cover work estimates, invalid dimensions, pre-evaluation budget failures, dense identity avoidance, and the updated error message.
Release-note documentation
CHANGELOG.md, docs/changelog.d/781-observed-information-work-budget.md
Changelog entries document observed-information budget checks, workspace reuse, and model-comparison callback error redaction.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant observed_information
  participant work_budget_preflight
  participant objective_callback
  participant trial_vector
  observed_information->>work_budget_preflight: validate parameter count and resource budgets
  work_budget_preflight-->>observed_information: allow or raise ValueError
  observed_information->>trial_vector: reuse perturbed parameter storage
  observed_information->>objective_callback: evaluate diagonal and pairwise finite differences
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding preflight work-budget checks for observed-information computation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/observed-info-budget-green

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.

@seonghobae
seonghobae marked this pull request as draft August 12, 2026 07:23
@seonghobae
seonghobae changed the base branch from main to fix/fitstats-m2-infit-docs-green August 12, 2026 07:23
@seonghobae
seonghobae marked this pull request as ready for review August 12, 2026 08:14
Base automatically changed from fix/fitstats-m2-infit-docs-green to main August 12, 2026 08:14
@seonghobae
seonghobae force-pushed the fix/observed-info-budget-green branch from 0ed52b8 to dcac34b Compare August 12, 2026 10:03
@seonghobae
seonghobae enabled auto-merge (squash) August 12, 2026 10:58
Preflight package-owned objective-call and workspace budgets before the
first objective evaluation; replace dense identity workspace with a
reusable trial vector. Rebuilt on current main.
@seonghobae
seonghobae force-pushed the fix/observed-info-budget-green branch from 855c28a to 12736b7 Compare August 12, 2026 11:22
@seonghobae
seonghobae merged commit 7245b83 into main Aug 12, 2026
35 checks passed
@seonghobae
seonghobae deleted the fix/observed-info-budget-green branch August 12, 2026 13:58
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