Skip to content

refactor(cat): route public item information through Rust - #735

Closed
seonghobae wants to merge 4 commits into
mainfrom
replacement/cat-selection-rust-main-20260811
Closed

refactor(cat): route public item information through Rust#735
seonghobae wants to merge 4 commits into
mainfrom
replacement/cat-selection-rust-main-20260811

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Controlled clean-lineage replacement for the item-information half of #721 / #629

Protected main at creation is 7b57f77747b9a9bd911660c76b1be0ca0dc2d145; this branch descends directly from that exact head. Old Draft #721 is ~197 protected-main commits stale and bundled both item-information and final next-item ranking ownership. This replacement preserves its non-duplicative fail-first intent while narrowing the first accepted slice to the part that already has an exact reusable Rust owner: mlsirm_core::scoring::bank_information_device exposed by _core.bank_information.

Test-first history

  1. 2757718968f160ea5d1aae9ec9a8a27cbd3c5958 adds public-boundary ownership/immutability tests. On pre-change code the sentinel _core.bank_information receives zero calls.
  2. ca50c0b544c08a61d4de0646e7b70294b1546eb0 removes Python probability/Fisher-information arithmetic from item_information() and delegates the exact simple-structure item-information vector to the compiled Rust scoring entrypoint used by serving.

Bounded behavior

  • Python retains factor/shape validation, person/theta selection, immutable contiguous marshalling and result-shape transport only.
  • Rust owns probability plus Fisher-information arithmetic for MIRT/MLS2PLM-family model semantics through the existing bank-information kernel.
  • theta/person_index and population-mean xi semantics are preserved through the existing _person_params contract.
  • Missing/incompatible compiled capability fails closed through the compiled-core call rather than selecting predict_proba plus a²P(1-P) in Python.
  • No new Rust formula or GPU path is introduced; the existing CPU-f64 / parity-verified bank-information device path is reused.

Deliberate remaining #629 work

select_cat_item() still owns the final global administered-item masking / deterministic argmax policy in Python. Existing Rust cat_next_item is not an exact substitute because it first performs EAP scoring and targets the dimension with largest posterior SD. Reusing that different policy would silently change the public estimand. Final global selection ownership and fixed-form assembly therefore remain explicit follow-up work under #629 and must be moved to an exact Rust policy kernel test-first.

Gates

Keep Draft until the intentional test-first history is followed by focused and full Python 3.12/3.14, Rust/PyO3, package/reinstall, existing GPU/fuzz, Security Scan, SAST and current-head review evidence on one unchanged head. Add authoritative changelog/doctoring only after the source slice is GREEN. No canonical #604 docs, dependency/workflow, version/release, hosted state or unrelated CAT ability changes belong here.

Supersedes the stale item-information portion of #721; does not close issue #629.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a1f46fc4-4954-43f5-9b08-b16836f629cc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@opencode-agent address

Bounded deterministic release-note handoff for exact Draft #735 head a26e03c321f6880f672bd74661feba11f0f615f0 over protected main 7b57f77747b9a9bd911660c76b1be0ca0dc2d145. Before writing, refetch PR head/live main/comments and abort if either ref moved or another writer targets this branch. The source slice was already GREEN on predecessor source head ca50c0b544c08a61d4de0646e7b70294b1546eb0; the current head adds only authoritative doctoring and docs/changelog.d/629-cat-item-information-rust.md.

Do only the deterministic managed changelog completion: run python scripts/render_changelog_fragments.py --update CHANGELOG.md, then python scripts/render_changelog_fragments.py --check CHANGELOG.md; run the focused CAT item-information ownership/immutability tests, changelog-fragment contract, and git diff --check; commit only the resulting managed CHANGELOG.md synchronization if all focused checks pass. Do not change test_design.py, tests, numerical semantics, dependencies/workflows, version/release, branch protection, reviewer credentials, canonical #604 docs, or Ready/merge state. After the renderer commit, stop writing this branch so the maintainer loop can require fresh exact-head full CI/Security/SAST and review.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Fresh bounded reconciliation/release-note handoff for Draft #735. The prior handoff 5254395680 is stale because protected main advanced from 7b57f77747b9a9bd911660c76b1be0ca0dc2d145 to 914127ba227d3e02d0564aeeb4f27d76137610f9; it explicitly required abort on base movement. Before writing, refetch source head/live main/comments and proceed only while source head is still a26e03c321f6880f672bd74661feba11f0f615f0, live main is still 914127ba227d3e02d0564aeeb4f27d76137610f9, and no other writer owns this branch.

First reconcile current protected main non-destructively, preserving all accepted #733 behavior and this PR's already-GREEN bounded CAT item-information ownership slice. Recreate focused ownership/immutability evidence on the reconciled exact head. If the source contract remains GREEN, perform only the deterministic release-note completion: render CHANGELOG.md from authoritative fragments with python scripts/render_changelog_fragments.py --update CHANGELOG.md, verify with --check, run focused CAT item-information tests, changelog-fragment contract, and git diff --check, then commit only the necessary reconciliation/managed changelog changes. Do not alter the item-information estimand, final select_cat_item() policy, dependencies/workflows/version/release, canonical #604 docs, review governance, or branch protection. Keep Draft and stop writing if head/base/writer state changes.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded by GREEN #741.

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