test(inference): prevent false zero uncertainty after Rust migration - #722
test(inference): prevent false zero uncertainty after Rust migration#722seonghobae 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 Draft #722. Before any write, refetch source head Exact CI run Implement the minimum GREEN only:
This correction must prevent false precision. Invalid or infinite uncertainty must never become an exact zero-SE signal. |
|
Superseded by GREEN #725 (preserve non-finite SE; reject non-finite Hessians). |
Post-integration scientific correction for #625
Protected
mainat branch creation and final pre-PR refetch:557a065350abcfb963d5d0a010e2ab79b7e9ff47, which contains merged PR #647.Fresh protected-main inspection found a consequential parity defect in the just-integrated Rust covariance/SE slice.
mlsirm_core::inference::standard_errors_from_vcov()currently converts every diagonal that is not both finite and positive to0.0. The protected Python contract before migration wassqrt(max(diag, 0)), under which finite negative values clamp to zero, butNaNremainsNaNand+Infremains+Inf. The current Rust behavior therefore turns undefined/infinite uncertainty into exact zero standard error—false precision.vcov_from_hessian()also lacks a finite-entry preflight, so NaN/Inf observed-information inputs can enter inversion/eigendecomposition instead of failing through a governed error surface.This Draft adds only the smallest intentional REDs:
2.0/0.0/0.0semantics;NaNdiagonal uncertainty remainsNaNand+Infremains+Inf, both through the public wrapper and direct Rust binding; andCurrent protected main is expected to fail because Rust returns zero for the non-finite SE cases and has no finite Hessian preflight. Setup/import/fixture failure is not valid RED.
Minimum GREEN
rcond, ordinary singular/near-singular behavior and caller immutability.Do not widen into observed-information Hessian construction, second-order eigenanalysis, dependencies/workflows/version/release, or canonical #604 docs. Keep Draft through RED→GREEN. Advances #625.