test(applied): value-pin mat_f64::determinant at n = 0..4; CI f64-rig lane (#296) - #366
Merged
Conversation
… lane (#296) Closes #296. A constant `Some(1.0)` passed every applied test binary at 625ecb1 (45/45). Pins now cover nalgebra's closed-form arms (n = 0, 1, 2, 3) and the LU arm (n = 4), each with a sign fixture, plus singular and block-diagonal cases; a `#[should_panic]` self-test pins the mismatch helper. The rustdoc and `examples/mat_operations.rs` lose the "via LU decomposition" claim, which nalgebra 0.35 does not satisfy below n = 4. CI gains the `f64-rig` test + clippy lane; `tests/mat_f64.rs` compiled to nothing in every existing lane. Production diff: 0 lines (rustdoc only in src/). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rse's LU gloss (#296) Delta-review findings: `(det - expected).abs() >= 1e-12` is false for NaN, so a NaN determinant passed every value pin (measured: 4/4 green); the predicate now records `diff.is_nan() || diff >= 1e-12` (NaN → 6/13 red). `examples/mat_operations.rs` still attributed the 3×3 inverse's error to LU; nalgebra 0.35 inverts n ≤ 4 in closed form. `should_panic` substring narrowed to the mismatch clause. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #296. Taskmap G3-T4 — closes G3.
Measured at
625ecb1:determinantreturning constantSome(1.0)passed 45/45 applied test binaries (--features f64-rig --no-fail-fast);tests/mat_f64.rs8/8 green. No CI lane compilestests/mat_f64.rs(rg 'f64-rig' .github/workflows/empty).Shipped (production diff 0 lines;
src/mat_f64.rschange is rustdoc only):tests/mat_f64.rs:check_determinantshelper (collects every mismatch, reports measured values) +#[should_panic]self-test; value pins at n = 0 (→1), 1 (7, −7), 2 (6, 0, −1), 3 (58, −1), 4 (4, −1, 0). Expected values hand-derived before running; the reviewer re-derived all independently (block-diag measured 4.000000000000011, LU error 1.1e-14).src/mat_f64.rs,examples/mat_operations.rs: every "LU" attribution deleted — nalgebra 0.35determinantis closed-form for n ≤ 3 andtry_inversefor n ≤ 4 (src/linalg/{determinant,inverse}.rs);rg LUover both files is empty.ci.yml:cargo test -p catgraph-applied --features f64-rig+ clippy--all-targets -D warnings. Unscoped, matching the serde lane at:122(226 lib + 448 integration + 7 doc tests).Falsification (
--test mat_f64, 13 tests):Some(1.0)Some(det.abs())Some(-det)!=→==Noneon every square fixtureassert!droppedcheck_determinants_reports_a_mismatchSome(f64::NAN)683e1ccthe fourcheck_determinantstests were green; only the identity pin and the self-test caught it)Nulls: transpose-then-det (det Aᵀ = det A); tolerance
>=→>(no fixture on the boundary);row1 = 2·row0underabs()and diagonal-product (0 → 0);determinant_0x0_is_1under constant-1 and diagonal-product (empty product = 1). Pre-existingdeterminant_of_identity_is_1is green under constant,abs, and diagonal-product — the hole this closes.Reviews: r1 executing adversarial (0 blocking / 3 important / 6 minor) → r2 executing delta on the applied edits (2 important / 1 minor: NaN-unsafe predicate, a surviving LU gloss on the inverse) → r3 executing on the fix commit
683e1cc(0/0/3 minor). All findings applied except one note-only item: theshould_panicsubstringmeasured 7would also accept7.5; the fixture is an exact 1×1, so no reachable value does.Out of scope, recorded:
examples/mat_operations.rsis self-checking (asserts det 58) but never run in CI — its later sections exceed 600 s in debug;try_inversealready has a value oracle (inverse_matmul_original_is_identity), not widened; #269 sequenced behind this PR.🤖 Generated with Claude Code