Repository navigation
feat: add outward-rounded interval division and solve enclosures - #315
Conversation
- Add const reciprocal and direct division bounds for zero-free intervals, including subnormal quotients and typed finite-range failures. - Enclose fixed-dimension linear solutions with row pivoting and explicit inconclusive outcomes that preserve the caller's robust fallback. - Document the all-admitted-systems contract and add diagnostic solve corpora without changing the retained release benchmark catalog. - Refresh rustix and the contributor uv and cargo-nextest pins. Closes #307
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Outward-rounded interval arithmetic src/error.rs, src/rounding.rs, src/interval.rs, tests/interval_solve.rs, tests/proptest_interval.rs, docs/mathematical_basis.md |
Reciprocal and division calculate outward bounds for zero-free divisors. Zero-containing divisors and unavailable finite bounds return typed errors. Tests cover endpoint enclosures, sign combinations, subnormal values, and extreme magnitudes. |
Interval linear solve src/interval.rs, src/lib.rs, README.md, REFERENCES.md, docs/mathematical_basis.md, tests/common/interval_solve_oracle.rs, tests/interval_solve.rs |
IntervalMatrix::solve uses pivoted elimination and back substitution to return solution enclosures. It reports inconclusive pivots without asserting singularity and returns no partial bounds on range failure. Tests compare results with exact-rational solutions and check uncertain systems, dimensions, and failure cases. |
Benchmark corpora and validation Cargo.toml, benches/common/interval_solve.rs, benches/interval_solve.rs, tests/interval_solve.rs, docs/BENCHMARKING.md, docs/code_organization.md, pyproject.toml |
Adds deterministic solve fixtures and division and solve benchmarks. Fixture outcomes are checked before timing. Documentation describes the benchmark cases and commands; the tool versions are updated. |
Priority:
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Caller
participant IntervalMatrixSolve as IntervalMatrix::solve
participant Interval
Caller->>IntervalMatrixSolve: Provide interval matrix and right-hand side
IntervalMatrixSolve->>Interval: Perform outward-rounded elimination and back substitution operations
Interval-->>IntervalMatrixSolve: Return interval arithmetic results or a range error
IntervalMatrixSolve-->>Caller: Return solution enclosures or a typed solve error
Possibly related issues
acgetchell/la-stack#311— The PR adds the interval solve and division capabilities listed in the release scope, but does not complete publication or release verification.acgetchell/delaunay#656— The new solve API provides the capability referenced by the planned consumer migration, but this PR does not change the consumer’s local solver or fallback policy.
Merge Risk: 
Minimal · up to 1ce59
-
The interval arithmetic and solve changes appear ready to merge after normal checks; no actionable merge-blocking risk was identified.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 warning Passed checks: 3 passed-
Full details: Linked Issues check
-
Explanation
Directly linked issue
#307requires outward-rounded reciprocal and division, a small-system solve enclosure, explicit outcomes, rational-oracle tests, D=1 to D=6 coverage, and benchmarks. The supplied summary shows: (1) Interval::try_recip and Interval::try_div in src/interval.rs, with compare_quotient_with_rounded in src/rounding.rs for exact-comparison outward endpoints, IntervalZeroDivisor for zero-containing divisors, and IntervalRangeExhausted for missing finite enclosures; subnormal and tiny-ratio cases appear in tests and benchmark checks. (2) IntervalMatrix::solve uses row pivoting by separation from zero, outward-rounded elimination and back substitution, O(D^2) inline storage, and documented shape, dimension, and uncertainty contracts in src/lib.rs, src/interval.rs, and docs/mathematical_basis.md. Inconclusive pivots return IntervalSolveInconclusive and do not claim singularity, which matches the issue. (3) tests/common/interval_solve_oracle.rs provides an exact BigRational oracle, and tests/interval_solve.rs and tests/proptest_interval.rs cover extreme scales, uncertain systems, pivot selection, inconclusive results, range exhaustion, and rational comparison under the exact feature. The summary does not name a cancellation case explicitly; this is a minor coverage gap in the description, not a missing implementation. (4) Benchmark fixtures in benches/common/interval_solve.rs and benches/interval_solve.rs cover five 32-system corpora at D=1 to D=6 and report enclosure counts, and Cargo.toml adds the target. Evidence comes from the summary and PR description; no source inspection was run in this assessment.
-
Full details: Out of Scope Changes check
-
Explanation
Most changes map to
#307: interval arithmetic, solver, error variants, rounding helper, exact-oracle tests, benchmarks, and documentation. Two changes do not implement any#307objective. (a) pyproject.toml raises the required uv version from 0.13.5 to 0.13.6 and the pinned cargo-nextest version from 0.9.149 to 0.9.150. The PR description lists these as included updates. (b) The PR description also lists a rustix 1.1.6 update. It likely lives in Cargo.lock, which is an ignored file (rule '!**/*.lock'). Its contents were not inspected, so this part is unverified. The tool and dependency updates are unrelated to interval division or solving, and the PR does not link them to any requirement in#307.Resolution
Remove the uv 0.13.6 and cargo-nextest 0.9.150 version changes from pyproject.toml, and remove the rustix 1.1.6 lock update, from this PR. Deliver those updates in a separate dependency or tooling change. After removal, rerun the validation for the reduced configuration, including just ci, and update the PR description to remove the dependency and tool update claims.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #315 +/- ##
==========================================
+ Coverage 98.19% 98.32% +0.13%
==========================================
Files 15 15
Lines 7306 7462 +156
==========================================
+ Hits 7174 7337 +163
+ Misses 132 125 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Consumers assembling interval systems currently need their own reciprocal bounds and linear solver. This adds
Interval::try_recip,Interval::try_div, andIntervalMatrix<D>::solveto the default-feature API.Successful solves enclose the exact-real solution for every matrix and RHS admitted by the input intervals, and certify nonsingularity for every admitted matrix. Zero-containing divisors, inconclusive pivots, and finite-range exhaustion have distinct typed outcomes. Inconclusive elimination never claims singularity; consumers retain their robust fallback.
Validation:
just checkand fulljust cipassed: 1,113 Rust tests, 281 Python tests, default/exact doctests, documentation, static checks, benchmark compilation, and examples.just lint-config cargo-lock-check tools-checkandjust test-rust-cion the final dependency/tool configuration; all 1,113 Rust tests passed.Closes #307.
Summary by CodeRabbit
New Features
Documentation
Tests