Skip to content

fix(rasch-cml): harden native dispatch controls - #906

Merged
seonghobae merged 3 commits into
mainfrom
fix/rasch-cml-control-boundary-905
Aug 16, 2026
Merged

fix(rasch-cml): harden native dispatch controls#906
seonghobae merged 3 commits into
mainfrom
fix/rasch-cml-control-boundary-905

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Scope

Fix #905 at the public Rasch CML/Andersen LR validation boundary without changing psychometric computation.

Test-first lineage

  • RED 906d62edad1e0efe992381b05ad10c4587cb16a9 requires malformed responses/groups and hostile scalar subclasses to fail before compiled-core discovery or coercion callbacks, while genuine NumPy controls still reach the native-dispatch boundary.
  • GREEN 75a52d536a3bee6b191dd078b4909aaaa58a4455 adds exact-type iteration/tolerance admission, bounds iteration work with the repository cap, validates all public inputs before _core_module(), and passes only trusted built-in scalars into PyO3.
  • 5d72dc72557c04ffe4eb7783bc19e5d05dc5cb0e records release evidence.

Preserved boundary

  • Rasch conditional likelihood, CML estimation, information/SE, Andersen LR statistic, degrees of freedom, p-value, retained-person accounting, and all result-affecting arithmetic remain Rust-owned and unchanged.
  • Existing binary response and group-label semantics remain unchanged.
  • Exact built-in and genuine supported NumPy integer/floating scalar controls remain supported; booleans/subclasses/arbitrary coercion providers fail before callbacks.
  • Valid requests still fail with the established RuntimeError when the compiled Rust core is unavailable.
  • No Python numerical fallback, dependency, provider, persistence, workflow, package-version, gate, or downstream-ownership change.

Lifecycle discipline

The source is Ready for review. Integration remains contingent on live exact-head CI/security/package/provenance evidence, zero operative unresolved review findings, and the repository's required independent non-author approval. Protected base, source head, reviews, threads, and checks must be refetched immediately before any integration action; predecessor evidence does not transfer.

Fixes #905.

@coderabbitai

coderabbitai Bot commented Aug 15, 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: b04e16ae-971f-41ae-8dc3-bd77f4f29fea

📥 Commits

Reviewing files that changed from the base of the PR and between fb67ced and 5d72dc7.

📒 Files selected for processing (3)
  • docs/changelog.d/905-rasch-cml-control-boundary.md
  • python/fast_mlsirm/rasch_cml.py
  • tests/test_rasch_cml_native_boundary.py

📝 Walkthrough

Walkthrough

Rasch CML and Andersen LR now validate input data and scalar controls before compiled-core discovery. The wrappers reject hostile coercion objects, accept supported NumPy scalars, enforce bounds, and add regression tests for validation order and native dispatch.

Changes

Rasch CML control boundary

Layer / File(s) Summary
Strict scalar validation
python/fast_mlsirm/rasch_cml.py
The module recognizes supported NumPy scalar types and validates iteration limits and tolerances without invoking caller-defined coercion.
Validated native dispatch and regression coverage
python/fast_mlsirm/rasch_cml.py, tests/test_rasch_cml_native_boundary.py, docs/changelog.d/905-rasch-cml-control-boundary.md
fit_rasch_cml and andersen_lr_test validate controls before Rust-core loading. Tests cover malformed inputs, hostile scalar subclasses, valid NumPy scalars, and loader behavior. The changelog records the boundary changes.

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

Merge Risk: ⚪ Minimal · up to 5d72d

The change hardens validation for Rasch CML and Andersen LR controls while preserving existing computations and supported inputs; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #905 by validating inputs and controls before native discovery while preserving computation and adding regression coverage.
Out of Scope Changes check ✅ Passed The code, tests, and changelog changes directly support the validation-hardening objectives in issue #905.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: hardening Rasch CML native dispatch controls.
✨ 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/rasch-cml-control-boundary-905

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 ready for review August 15, 2026 14:17
@seonghobae
seonghobae enabled auto-merge (squash) August 15, 2026 16:57
auto-merge was automatically disabled August 16, 2026 14:04

Base branch was modified

@seonghobae
seonghobae merged commit 9d18556 into main Aug 16, 2026
35 checks passed
@seonghobae
seonghobae deleted the fix/rasch-cml-control-boundary-905 branch August 16, 2026 14:22
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.

security: harden Rasch CML controls before native discovery

1 participant