Skip to content

fix: harden numerical and release evidence - #207

Merged
acgetchell merged 2 commits into
mainfrom
fix/review-graph-findings
Aug 10, 2026
Merged

fix: harden numerical and release evidence#207
acgetchell merged 2 commits into
mainfrom
fix/review-graph-findings

Conversation

@acgetchell

@acgetchell acgetchell commented Aug 10, 2026

Copy link
Copy Markdown
Owner
  • Surface determinant overflow even when error-bound terms underflow.
  • Measure complete benchmark operations symmetrically and bind retained reports to atomic, validated provenance.
  • Fail closed on inconsistent release metadata, tags, changelog sections, Semgrep annotations, and recorded CPU provenance.
  • Align docs.rs feature annotations, citation identifiers, all-target linting, and configurable property-test runs with documented contracts.

Summary by CodeRabbit

  • Bug Fixes

    • Improved determinant calculations to report overflow errors reliably in mixed overflow/underflow cases.
    • Strengthened validation for exact arithmetic scaling and benchmark compatibility.
  • Documentation

    • Clarified exact-solve scaling, benchmarking requirements, release procedures, CPU provenance, and contributor setup.
    • Updated roadmap milestones and release metadata, including the version-specific DOI.
  • Chores

    • Improved release, changelog, benchmark, and artifact workflows with stronger validation, safer publishing, streamed progress, and version consistency checks.
    • Updated development tools, package metadata, and documentation build configuration.

- Surface determinant overflow even when error-bound terms underflow.
- Measure complete benchmark operations symmetrically and bind retained reports to atomic, validated provenance.
- Fail closed on inconsistent release metadata, tags, changelog sections, Semgrep annotations, and recorded CPU provenance.
- Align docs.rs feature annotations, citation identifiers, all-target linting, and configurable property-test runs with documented contracts.
@acgetchell acgetchell self-assigned this Aug 10, 2026
@acgetchell
acgetchell enabled auto-merge August 10, 2026 18:05
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c6eb723-eadb-4cff-bab8-521a799a2e76

📥 Commits

Reviewing files that changed from the base of the PR and between c878701 and 260afb8.

📒 Files selected for processing (9)
  • REFERENCES.md
  • docs/mathematical_basis.md
  • scripts/archive_changelog.py
  • scripts/bench_compare.py
  • scripts/check_semgrep_fixtures.py
  • scripts/performance_artifacts.py
  • scripts/tests/test_archive_changelog.py
  • scripts/tests/test_check_semgrep_fixtures.py
  • scripts/tests/test_performance_artifacts.py
🚧 Files skipped from review as they are similar to previous changes (8)
  • docs/mathematical_basis.md
  • REFERENCES.md
  • scripts/tests/test_performance_artifacts.py
  • scripts/tests/test_archive_changelog.py
  • scripts/check_semgrep_fixtures.py
  • scripts/performance_artifacts.py
  • scripts/bench_compare.py
  • scripts/archive_changelog.py

📝 Walkthrough

Walkthrough

The PR updates release metadata and documentation, hardens benchmark and provenance workflows, adds atomic changelog publication, improves repository validation, exposes docs.rs APIs, and strengthens determinant and property-test validation.

Changes

Release, documentation, and Rust validation

Layer / File(s) Summary
Documentation and project contracts
CITATION.cff, CONTRIBUTING.md, Cargo.toml, README.md, REFERENCES.md, docs/*, justfile, pyproject.toml, scripts/README.md
Release metadata, CI instructions, benchmark provenance, exact-arithmetic documentation, package metadata, and release guidance were updated.
Rust documentation and determinant validation
src/lib.rs, src/matrix.rs, tests/common/*, tests/prelude_exports.rs, tests/proptest_*.rs, tests/regressions.rs
docs.rs configuration was added. Non-finite determinant results now return errors when error-bound computation is inconclusive. Property tests use shared case configuration and require determinant bounds where expected.

Benchmark and release tooling

Layer / File(s) Summary
Benchmark execution and environment
benches/vs_linalg.rs, scripts/archive_performance.py, scripts/criterion_dim_plot.py, scripts/subprocess_utils.py, scripts/tests/test_archive_performance.py, scripts/tests/test_criterion_dim_plot.py, scripts/tests/test_subprocess_utils.py
Benchmarks use direct Criterion iteration. Tool execution supports timeouts and streamed progress. CPU detection, tracked-diff application, output-path validation, repository-root discovery, and release preflight checks were added.
Provenance and artifact integrity
scripts/bench_compare.py, scripts/performance_artifacts.py, scripts/tests/test_bench_compare.py, scripts/tests/test_performance_artifacts.py
Provenance accepts generic mappings, stores immutable nested data, enforces compatibility and mode consistency, rejects unavailable recorded CPUs, and publishes artifacts atomically with rollback handling.
Changelog and release operations
scripts/archive_changelog.py, scripts/postprocess_changelog.py, scripts/tag_release.py, scripts/tests/test_archive_changelog.py, scripts/tests/test_postprocess_changelog.py, scripts/tests/test_tag_release.py
Changelog parsing now enforces SemVer and duplicate-heading rules. Archive publication is batched and rollback-capable. Changelog normalization is idempotent, and release tags must match the Cargo package version.
Repository validation checks
scripts/check_docs_version_sync.py, scripts/check_semgrep_fixtures.py, scripts/tests/test_check_docs_version_sync.py, scripts/tests/test_check_semgrep_fixtures.py
Release-date synchronization and Semgrep fixture validation now use structured, line-aware checks with expanded diagnostics and CLI validation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant archive_performance
  participant bench_compare
  participant ArtifactStore
  CLI->>archive_performance: validate options, version, CPU, and benchmark inputs
  archive_performance->>bench_compare: provide benchmark outputs and provenance
  bench_compare->>ArtifactStore: publish validated artifacts atomically
  ArtifactStore-->>bench_compare: restore prior outputs if publication fails
Loading

Possibly related issues

Possibly related PRs

Suggested labels: performance, testing, documentation, rust

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.91% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the PR's main changes to numerical error handling and release-evidence validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/review-graph-findings

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (5c004ad) to head (260afb8).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #207   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files           8        8           
  Lines        4969     4975    +6     
=======================================
+ Hits         4863     4869    +6     
  Misses        106      106           
Flag Coverage Δ
unittests 97.86% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
scripts/tests/test_performance_artifacts.py (1)

339-340: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert the frozen type directly.

assert isinstance(criterion, dict) is False only states what the nested value is not. Assert isinstance(criterion, MappingProxyType) so the test pins the immutability invariant it verifies.

♻️ Proposed change
     criterion = context.benchmark_provenance["criterion"]
-    assert isinstance(criterion, dict) is False
+    assert isinstance(criterion, MappingProxyType)

Add the import:

from types import MappingProxyType
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/tests/test_performance_artifacts.py` around lines 339 - 340, Update
the assertion for criterion in the relevant performance artifact test to verify
isinstance(criterion, MappingProxyType) directly, and import MappingProxyType
from types. Replace the existing negative dict assertion so the test pins the
frozen mapping type.
scripts/bench_compare.py (1)

425-438: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider importing the freeze helpers instead of duplicating them.

_freeze_json and _freeze_mapping here are identical to the helpers added in scripts/performance_artifacts.py lines 273-287. This file already imports several symbols from that module. Export the helpers from performance_artifacts and import them here, so the freezing contract has one definition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/bench_compare.py` around lines 425 - 438, Remove the local
_freeze_json and _freeze_mapping definitions from scripts/bench_compare.py,
export those helpers from performance_artifacts, and import and reuse them
alongside the existing imports. Preserve the current freezing behavior and
type-validation contract through the shared implementations.
REFERENCES.md (1)

53-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Express the scale-sharing threshold as a mathematical invariant.

The behavior depends on the exponent difference. State both branches explicitly: |e_rhs − e_matrix| ≤ 64 uses min(e_rhs, e_matrix) as the shared scale, while |e_rhs − e_matrix| > 64 keeps independent scales. This removes ambiguity at the boundary.

As per coding guidelines, **/*.md files must use readable Unicode mathematical notation and state invariants mathematically where possible.

Proposed wording
-Matrix and RHS scales start from their respective minimum
-exponents. When the scales differ by at most 64 bits, both sides use the lower scale to share
-common factors; larger gaps retain independent scales so one side is not inflated excessively.
+Matrix and RHS scales start from their respective minimum exponents, e_matrix and e_rhs.
+When |e_rhs − e_matrix| ≤ 64, both sides use min(e_rhs, e_matrix) as the shared scale.
+When |e_rhs − e_matrix| > 64, the sides retain independent scales so one side is not inflated
+excessively.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@REFERENCES.md` around lines 53 - 56, Update the scale-sharing description
near “Matrix and RHS scales” to state the invariant using readable Unicode
notation: when |e_rhs − e_matrix| ≤ 64, both sides use min(e_rhs, e_matrix) as
the shared scale; when |e_rhs − e_matrix| > 64, retain independent scales.
Preserve the surrounding explanation of Bareiss elimination.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/mathematical_basis.md`:
- Around line 153-155: Update the scaling discussion near “First-nonzero
pivoting” to define the matrix and right-hand-side scales mathematically,
including A = 2ˢᴬ·A_int and b = 2ˢᵇ·b_int, and explain that reconciling them
with the exact power-of-two factor preserves A x = b. Add the applicable
numbered citation from REFERENCES.md using the document’s existing citation
format.

In `@scripts/archive_changelog.py`:
- Around line 178-194: Update the Unreleased heading check in the changelog
parsing logic to require a valid closing-bracket boundary, rejecting variants
such as `## [Unreleased]invalid` instead of assigning them to unreleased.
Preserve valid `## [Unreleased]` handling and ensure malformed headings use the
existing unrecognized-heading failure path; add a test covering this rejection.

In `@scripts/check_semgrep_fixtures.py`:
- Around line 146-157: Update the matching logic around unmatched_actual so it
selects the matching finding with the earliest end_line, rather than the first
Semgrep result; preserve the existing rule_id and line-range constraints and
remove only the selected match. Add a regression test covering overlapping spans
returned in reversed order, ensuring all expected findings match.

In `@scripts/subprocess_utils.py`:
- Around line 175-179: Update the exception handler in _darwin_cpu_model to use
valid tuple syntax for all listed exception types, preserving the existing
empty-string fallback for command failures.

---

Nitpick comments:
In `@REFERENCES.md`:
- Around line 53-56: Update the scale-sharing description near “Matrix and RHS
scales” to state the invariant using readable Unicode notation: when |e_rhs −
e_matrix| ≤ 64, both sides use min(e_rhs, e_matrix) as the shared scale; when
|e_rhs − e_matrix| > 64, retain independent scales. Preserve the surrounding
explanation of Bareiss elimination.

In `@scripts/bench_compare.py`:
- Around line 425-438: Remove the local _freeze_json and _freeze_mapping
definitions from scripts/bench_compare.py, export those helpers from
performance_artifacts, and import and reuse them alongside the existing imports.
Preserve the current freezing behavior and type-validation contract through the
shared implementations.

In `@scripts/tests/test_performance_artifacts.py`:
- Around line 339-340: Update the assertion for criterion in the relevant
performance artifact test to verify isinstance(criterion, MappingProxyType)
directly, and import MappingProxyType from types. Replace the existing negative
dict assertion so the test pins the frozen mapping type.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3e2b6836-f790-4484-b219-889b04d0b0b8

📥 Commits

Reviewing files that changed from the base of the PR and between 5c004ad and c878701.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (44)
  • CITATION.cff
  • CONTRIBUTING.md
  • Cargo.toml
  • README.md
  • REFERENCES.md
  • benches/vs_linalg.rs
  • docs/BENCHMARKING.md
  • docs/PERFORMANCE.md
  • docs/RELEASING.md
  • docs/assets/bench/vs_linalg_lu_solve_median.provenance.json
  • docs/mathematical_basis.md
  • docs/roadmap.md
  • justfile
  • pyproject.toml
  • scripts/README.md
  • scripts/archive_changelog.py
  • scripts/archive_performance.py
  • scripts/bench_compare.py
  • scripts/check_docs_version_sync.py
  • scripts/check_semgrep_fixtures.py
  • scripts/criterion_dim_plot.py
  • scripts/performance_artifacts.py
  • scripts/postprocess_changelog.py
  • scripts/subprocess_utils.py
  • scripts/tag_release.py
  • scripts/tests/test_archive_changelog.py
  • scripts/tests/test_archive_performance.py
  • scripts/tests/test_bench_compare.py
  • scripts/tests/test_check_docs_version_sync.py
  • scripts/tests/test_check_semgrep_fixtures.py
  • scripts/tests/test_criterion_dim_plot.py
  • scripts/tests/test_performance_artifacts.py
  • scripts/tests/test_postprocess_changelog.py
  • scripts/tests/test_subprocess_utils.py
  • scripts/tests/test_tag_release.py
  • src/lib.rs
  • src/matrix.rs
  • tests/common/proptest_config.rs
  • tests/prelude_exports.rs
  • tests/proptest_exact.rs
  • tests/proptest_factorizations.rs
  • tests/proptest_matrix.rs
  • tests/proptest_vector.rs
  • tests/regressions.rs

Comment thread docs/mathematical_basis.md Outdated
Comment thread scripts/archive_changelog.py Outdated
Comment thread scripts/check_semgrep_fixtures.py Outdated
Comment thread scripts/subprocess_utils.py
- Preserve archived changelog bytes during rollback and reject malformed Unreleased headings.
- Match overlapping Semgrep fixture spans deterministically and centralize immutable benchmark provenance handling.
- Document exact matrix/RHS scaling and the power-of-two factor that preserves linear systems.
@acgetchell
acgetchell merged commit 32e67d4 into main Aug 10, 2026
21 checks passed
@acgetchell
acgetchell deleted the fix/review-graph-findings branch August 10, 2026 19:53
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