refactor(cat): move ability estimation arithmetic to Rust - #628
refactor(cat): move ability estimation arithmetic to Rust#628seonghobae wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@opencode-agent address Exact bounded implementation handoff for issue #624 / Draft #628. Before any write, refetch the PR source head and independently resolve protected Fail-first proof is complete: CI run Implement the minimum GREEN only:
If source or main moves, stop writing, reconcile fresh state non-destructively, and preserve the fail-first evidence as predecessor history rather than overwriting it. |
|
@opencode-agent address Superseding bounded implementation handoff after protected Preserve the exact fail-first proof from predecessor integration: the three CAT ownership tests fail because Rust entrypoints are called zero times; existing CAT behavior is otherwise green. First reconcile current protected main non-destructively, preserving accepted #630 CodeQL analyze pin and the fail-first test. Then implement the same minimum GREEN from issue #624: Rust CPU-f64 ownership for current public CAT MLE, fixed-grid EAP and ability SE; thin PyO3 Do not widen into item selection/ATA/directional CAT/GPU/provider/hosted persistence or canonical docs #604. Keep Draft. Stop after one coherent verified source update; fresh exact-head CI/Security/SAST/review belongs to the maintainer loop. |
|
@opencode-agent address Superseding CAT Rust-ownership handoff after #631 merged. Fresh pre-dispatch identities: Draft #628 head Preserve the exact fail-first evidence: the three public CAT ownership tests reach production and fail only because Rust entrypoints are called zero times. First reconcile current protected main non-destructively, preserving #630/#631 CodeQL Keep Draft. Do not widen to CAT item selection/ATA/directional CAT/GPU/provider/persistence/canonical docs #604/dependencies/workflows/version/release/Ready/approval/merge. Stop source writes after one coherent verified implementation update; fresh exact-head full CI/Security/SAST/review belongs to the maintainer loop. |
|
@opencode-agent address Superseding current-main implementation handoff. The earlier handoff Fresh compare is Then implement only #624's bounded minimum GREEN: Rust CPU-f64 ownership of public CAT MLE, fixed-grid EAP and information-based ability SE; thin PyO3 entrypoints Add APA 7 doctoring/changelog, render/check managed CHANGELOG after GREEN, and require focused plus complete Python/Rust/PyO3/package/GPU-existing/fuzz/Security/SAST/coverage/docstring evidence on one unchanged head. Keep Draft; current-head review/Ready/merge returns to the maintainer loop. Stop immediately if source/main/writer identity changes. |
|
@jules address Fallback sole branch writer for exact Draft #628 head Preserve the exact production-boundary RED: public CAT MLE, fixed-grid EAP, and ability-SE ownership tests fail only because package-owned Rust entrypoints receive zero calls; existing CAT behavior is predecessor-GREEN evidence. Reconcile the two accepted CodeQL 4.37.6 protected-main commits non-destructively, then implement issue #624's minimum GREEN only: CPU-f64 Rust ownership of the existing MLE/EAP/SE estimands, thin PyO3 Keep Draft and stop source writes after one coherent verified update. Do not widen into item selection/test assembly (#629), directional CAT, GPU, provider/hosted state, dependencies/workflows/version/release, canonical docs #604, Ready/approval/merge, or create another PR. Fresh unchanged-head full CI/Security/SAST/current-head review belongs to the maintainer loop. |
5f8ab14 to
0d3ba94
Compare
0d3ba94 to
5f8ab14
Compare
|
Superseded by merged PR #709. Fresh protected-main evidence now contains merge commit |
Buyer-visible architecture gap
Issue #624 identifies a production numerical-ownership violation: the public CAT MLE, EAP, and ability-standard-error paths still compute psychometric estimates and uncertainty in Python/NumPy. This Draft begins the bounded test-first migration to one Rust/PyO3 numerical authority without changing the public CAT semantics.
Exact fail-first RED evidence
Fail-first source head:
5f8ab14d8e2f83c9caaac9d64e906fd5e9111074Protected
mainused by the run:f43a466b1441b27bd2ac4a71be8aa3e4f08c8e8fSynthetic merge checked out by CI:
55b53d8be097fee6e0283d4658584470c87fd4f4CI run:
31351541489; Python job:93343213036.The full suite reached the intended production boundary and completed with exactly 3 failed, 2948 passed, 2 skipped. The only failures were:
test_public_mle_delegates_numerical_result_to_rust;test_public_eap_delegates_numerical_result_to_rust; andtest_public_standard_error_delegates_numerical_result_to_rust.Each fails because the proposed Rust entrypoint receives zero calls (
assert len(calls) == 1, actual0), proving the current public Python CAT layer still owns the numerical result. The existing CAT behavioral suite is GREEN. Package/reinstall/release-acceptance and explicit GPU-no-skip jobs are GREEN on the same fail-first integration; SAST Semgrep is GREEN. The separately trackedmarginal.py::_log_sigmoidRuntimeWarning belongs to #583/#564 and is not a #628 defect.Planned minimum GREEN
Keep Python responsible for bounded validation, immutable marshalling, and
AbilityEstimateresult construction only. Move the existing CAT arithmetic intomlsirm-coreand expose thin PyO3 entrypoints namedcat_ability_mle,cat_ability_eap, andcat_ability_standard_error.The Rust implementation must preserve the current public semantics exactly:
max_iter,tol, and[-bound, bound]clipping;finite=Falsewith infinite MLE SE;linspace(-quad_range, quad_range, n_quad) + prior_meancontract and population-mean bank latent-space position;1/sqrt(sum item information)by trait dimension;Reuse existing Rust scoring/bank-information primitives where they preserve the exact public CAT estimand. Do not widen this PR into item-selection/test-assembly ownership, directional multidimensional CAT, a new estimator, GPU work, hosted state, providers, or a new canonical documentation line. This per-administration kernel remains CPU-f64 unless a separately reviewed benchmark demonstrates material GPU value.
Scientific basis and validation
Preserve the current CAT contract grounded in Bock & Mislevy (1982), Lord (1980), and van der Linden & Pashley (2010). This migration changes implementation ownership, not the estimand or interpretation. Add direct Python↔Rust field parity over ordinary, multidimensional simple-structure, no-item/prior, all-correct, all-incorrect, extreme-logit and malformed cases, plus realistic true-theta recovery using bias/MAE/RMSE, finite/convergence behavior, and SE/interval calibration where identified. Correlation alone is insufficient.
Remaining Draft gate
Keep Draft until all gates are complete. Advances #624.