Skip to content

refactor: harden Rust release hygiene#153

Merged
acgetchell merged 2 commits into
mainfrom
refactor/release-hygiene
Jun 9, 2026
Merged

refactor: harden Rust release hygiene#153
acgetchell merged 2 commits into
mainfrom
refactor/release-hygiene

Conversation

@acgetchell

@acgetchell acgetchell commented Jun 9, 2026

Copy link
Copy Markdown
Owner
  • Promote missing documentation and dead code lints to deny-level checks.
  • Forbid unsafe code explicitly across Rust modules and benchmark targets.
  • Document the LU/LDLT empty-matrix convention for D=0.
  • Move exact benchmark input generation into typed helpers and consolidate exact benchmark operation dispatch.

Summary by CodeRabbit

  • Tests

    • Added property-based and unit tests for exact-arithmetic benchmarks, deterministic RNG behavior, and benchmark config validation.
  • Documentation

    • Clarified zero-dimension matrix behavior (determinant/solve) and updated benchmarking guidance and examples.
  • Chores

    • Centralized benchmark helpers; improved benchmark tooling to support suite-aware comparisons and added local comparison recipes.
    • Strengthened safety checks by forbidding unsafe code and enforcing documentation.

- Promote missing documentation and dead code lints to deny-level checks.
- Forbid unsafe code explicitly across Rust modules and benchmark targets.
- Document the LU/LDLT empty-matrix convention for D=0.
- Move exact benchmark input generation into typed helpers and consolidate exact benchmark operation dispatch.
@acgetchell acgetchell self-assigned this Jun 9, 2026
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.13%. Comparing base (57809b2) to head (d7c1487).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   98.14%   98.13%   -0.02%     
==========================================
  Files           7        7              
  Lines        3343     3323      -20     
==========================================
- Hits         3281     3261      -20     
  Misses         62       62              
Flag Coverage Δ
unittests 98.13% <100.00%> (-0.02%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Jun 9, 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1353f3e5-28e1-413b-b359-3dc12be28dac

📥 Commits

Reviewing files that changed from the base of the PR and between 8e12c93 and d7c1487.

📒 Files selected for processing (9)
  • docs/BENCHMARKING.md
  • justfile
  • scripts/README.md
  • scripts/archive_performance.py
  • scripts/tests/test_archive_performance.py
  • tests/semgrep/doctests/unwrap_expect.txt
  • tests/semgrep/src/project_rules/bench_example_usage.rs
  • tests/semgrep/src/project_rules/public_api_panic_paths.rs
  • tests/semgrep/src/project_rules/readme_doctest_mirrors.rs
✅ Files skipped from review due to trivial changes (2)
  • scripts/README.md
  • docs/BENCHMARKING.md

📝 Walkthrough

Walkthrough

Tighten linting (deny missing_docs/dead_code), forbid unsafe code across modules, extract benchmark config/PRNG to benches/common/exact.rs, refactor exact benchmarks to use a unified operation dispatch, add zero-dimension docs and tests, update benchmark tooling scripts/justfile, and add deterministic and property-based tests.

Changes

Code Quality & Testing Infrastructure

Layer / File(s) Summary
Lint policy and unsafe forbiddance
Cargo.toml, src/lib.rs, src/*, benches/*, tests/semgrep/*
Tightens missing_docs/dead_code to deny and adds #![forbid(unsafe_code)] across many source, benchmark, and test modules.
Benchmark configuration module with validation and PRNG
benches/common/exact.rs
Adds ExactBenchConfigError, I16Range (validated inclusive i16 ranges with cached sampling width), and SplitMix64 deterministic PRNG.
Benchmark harness refactoring and operation dispatch integration
benches/exact.rs
Migrates to shared common::exact, adds DetExactF64Result and DetExactRoundedF64 variants, introduces bench_exact_operation, and refactors percentile selection and per-dimension bench wiring.
Zero-dimension documentation and examples
src/lu.rs, src/ldlt.rs, src/matrix.rs
Documents D = 0 conventions: determinant is empty product 1.0 and solving with Vector<0> yields empty solution; adds illustrative examples.
Zero-dimension unit tests
src/ldlt.rs, src/lu.rs
Adds tests asserting Matrix::<0> factorizations return det() == 1.0 and solves produce empty vectors.
Benchmark configuration tests
tests/exact_bench_config.rs
Unit tests validate ExactBenchConfigError variants/messages, I16Range ordering/inclusive behavior, and deterministic SplitMix64 output.
Determinant error-bound property tests
tests/proptest_exact.rs
New proptest macro cross-checks det_errbound() against an exact Leibniz determinant oracle for D=2..=4.
Tooling and workflow updates
scripts/*, justfile, docs/BENCHMARKING.md
Adds suite-aware archive-performance support, new just recipes (bench-vs-linalg-latest-vs, performance-local-vs-linalg), test updates, and docs/README adjustments for faster non-exact comparisons.
Semgrep test fixtures and doctest updates
tests/semgrep/src/project_rules/*, tests/semgrep/doctests/*
Switches crate-level attributes to forbid unsafe and reworks fixture helpers and doctest visibility for unwrap/expect examples.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

Suggested Labels

rust, testing, documentation, enhancement

Poem

🐰 I hopped through lints and tightened locks,

forbid(unsafe) closed old shocks,
Benchmarks share a steady seed,
Tests and docs assert the creed.
A tiny rabbit cheers the builds — behold the polished rocks!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'refactor: harden Rust release hygiene' directly reflects the main objectives: promoting lints to deny-level, forbidding unsafe code, documenting conventions, and consolidating exact benchmark operations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/release-hygiene

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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

- Add local workflows for comparing current non-exact la-stack kernels against a release baseline without rerunning current nalgebra/faer or exact benchmarks.
- Route archive-performance baseline and current benchmark commands by suite, with legacy fallback support for older release worktrees.
- Document the faster release-signal workflow and expand Semgrep fixtures for benchmark, example, doctest, and public panic-path rules.
@acgetchell acgetchell enabled auto-merge June 9, 2026 05:16
@acgetchell acgetchell merged commit 45affa8 into main Jun 9, 2026
19 checks passed
@acgetchell acgetchell deleted the refactor/release-hygiene branch June 9, 2026 05:24
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