Skip to content

test: add adversarial-input coverage for exact arithmetic (#80)#97

Merged
acgetchell merged 4 commits intomainfrom
perf/80-exact-bench-adversarial
Apr 21, 2026
Merged

test: add adversarial-input coverage for exact arithmetic (#80)#97
acgetchell merged 4 commits intomainfrom
perf/80-exact-bench-adversarial

Conversation

@acgetchell
Copy link
Copy Markdown
Owner

@acgetchell acgetchell commented Apr 21, 2026

Expand benchmark, unit-test, and proptest coverage of the exact-arithmetic APIs to catch tail cases that fixed well-conditioned inputs miss.

Benchmarks (benches/exact.rs):

  • Factor out bench_extreme_group helper running the same four benches (det_sign_exact, det_exact, solve_exact, solve_exact_f64) so adversarial groups are directly comparable.
  • Extend exact_near_singular_3x3 with the two solve benches (the primary motivating use case for exact solve was previously unmeasured).
  • Add exact_large_entries_3x3 (entries near f64::MAX / 2) to stress intermediate BigInt growth during Bareiss forward elimination.
  • Add exact_hilbert_4x4 / exact_hilbert_5x5 to stress the f64_decompose → BigInt scaling path on ill-conditioned inputs.
  • Tighten bench expect(...) messages to name the invariant each call relies on (e.g. "non-singular matrix with finite entries") so panics identify both where (Criterion bench name) and why.

Unit tests (src/exact.rs):

  • solve_exact_near_singular_3x3_integer_x0 — integer-x0 round-trip through the 2^-50-perturbed matrix.
  • solve_exact_large_entries_3x3_unit_vectorA·[1,0,0] = [big,1,1] round-trip with f64::MAX/2 diagonal.
  • det_sign_exact_large_entries_3x3_positive — asserts the fast filter falls through (det_direct is non-finite) and det_exact_f64 returns Overflow { index: None }.
  • det_sign_exact_hilbert_positive_{3,4,5}d — Hilbert is SPD, sign = 1.
  • solve_exact_hilbert_residual_{3,4,5}d — residual A·x - b is exactly zero in BigRational, stronger than integer round-trips since Hilbert entries are non-terminating in binary.

Proptests (tests/proptest_exact.rs):

  • solve_exact_integer_roundtrip_{2..5}d — random diagonally-dominant integer A and small-integer x0, verify solve(A, A·x0) == x0 exactly.
  • solve_exact_residual_{2..5}d — random A + small-integer b, verify A · solve(A, b) == b exactly (catches back-sub bugs on fractional solutions).
  • det_sign_exact_agrees_with_det_exact_{2..5}d — on full (non-diagonal) small-integer matrices, asserts det_sign_exact() == det_exact().sign() (exercises the filter/fallback boundary previously only diagonal-tested).

Prelude (src/lib.rs):

  • Re-export BigInt alongside BigRational (crate root + prelude).
  • Re-export FromPrimitive, Signed, ToPrimitive from num-traits in the prelude so the re-exported BigRational is actually usable for construction (from_f64, from_i64) and sign queries without forcing downstream users to add num-bigint / num-rational / num-traits to their own Cargo.toml. Additive; no public API breaks.

Tooling (scripts/bench_compare.py + test_bench_compare.py):

  • Register the three new adversarial groups in EXACT_GROUPS.
  • Extend _group_heading with human-readable titles ("Large entries 3x3", "Hilbert 4x4", "Hilbert 5x5").
  • Add group-heading unit tests for the new cases.

Test results (just ci):

  • cargo test --features exact: 368 lib + 20 proptest_exact + 40 other proptests + 34 doc-tests — all pass
  • cargo test (no features): 175 lib + 40 proptests + 29 doc-tests — all pass
  • Python: 104 tests pass (ty, mypy, ruff clean)
  • Clippy (pedantic + nursery + cargo, -D warnings): clean
  • fmt, taplo, yamllint, shellcheck, spell-check, bench-compile, examples: clean

Closes #80

Summary by CodeRabbit

  • New Features

    • Prelude now exposes additional exact-arithmetic types and conversion/sign helpers for easier exact-number workflows.
  • Tests

    • Added regression, unit, and property tests covering adversarial inputs (large entries, near‑singular, Hilbert) and exact round‑trip/residual checks for sizes 2–5.
  • Benchmarks

    • Expanded benchmark suite with new adversarial groups and grouped runs to compare multiple exact-arithmetic ops per input; clearer expectation messages.
  • Documentation

    • Updated README, benchmarking docs, and agent guidance to reflect exports and new benchmark coverage.
  • Chores

    • CI benchmark comparison made lenient when baselines are missing.

Expand benchmark, unit-test, and proptest coverage of the exact-arithmetic
APIs to catch tail cases that fixed well-conditioned inputs miss.

Benchmarks (benches/exact.rs):
- Factor out `bench_extreme_group` helper running the same four benches
  (`det_sign_exact`, `det_exact`, `solve_exact`, `solve_exact_f64`) so
  adversarial groups are directly comparable.
- Extend `exact_near_singular_3x3` with the two solve benches (the
  primary motivating use case for exact solve was previously unmeasured).
- Add `exact_large_entries_3x3` (entries near `f64::MAX / 2`) to stress
  intermediate BigInt growth during Bareiss forward elimination.
- Add `exact_hilbert_4x4` / `exact_hilbert_5x5` to stress the
  `f64_decompose → BigInt` scaling path on ill-conditioned inputs.
- Tighten bench `expect(...)` messages to name the invariant each call
  relies on (e.g. "non-singular matrix with finite entries") so panics
  identify both where (Criterion bench name) and why.

Unit tests (src/exact.rs):
- `solve_exact_near_singular_3x3_integer_x0` — integer-x0 round-trip
  through the 2^-50-perturbed matrix.
- `solve_exact_large_entries_3x3_unit_vector` — `A·[1,0,0] = [big,1,1]`
  round-trip with `f64::MAX/2` diagonal.
- `det_sign_exact_large_entries_3x3_positive` — asserts the fast filter
  falls through (`det_direct` is non-finite) and `det_exact_f64` returns
  `Overflow { index: None }`.
- `det_sign_exact_hilbert_positive_{3,4,5}d` — Hilbert is SPD, sign = 1.
- `solve_exact_hilbert_residual_{3,4,5}d` — residual `A·x - b` is exactly
  zero in `BigRational`, stronger than integer round-trips since Hilbert
  entries are non-terminating in binary.

Proptests (tests/proptest_exact.rs):
- `solve_exact_integer_roundtrip_{2..5}d` — random diagonally-dominant
  integer `A` and small-integer `x0`, verify `solve(A, A·x0) == x0` exactly.
- `solve_exact_residual_{2..5}d` — random `A` + small-integer `b`, verify
  `A · solve(A, b) == b` exactly (catches back-sub bugs on fractional
  solutions).
- `det_sign_exact_agrees_with_det_exact_{2..5}d` — on full (non-diagonal)
  small-integer matrices, asserts `det_sign_exact() == det_exact().sign()`
  (exercises the filter/fallback boundary previously only diagonal-tested).

Prelude (src/lib.rs):
- Re-export `BigInt` alongside `BigRational` (crate root + prelude).
- Re-export `FromPrimitive`, `Signed`, `ToPrimitive` from `num-traits` in
  the prelude so the re-exported `BigRational` is actually usable for
  construction (`from_f64`, `from_i64`) and sign queries without forcing
  downstream users to add `num-bigint` / `num-rational` / `num-traits` to
  their own Cargo.toml. Additive; no public API breaks.

Tooling (scripts/bench_compare.py + test_bench_compare.py):
- Register the three new adversarial groups in `EXACT_GROUPS`.
- Extend `_group_heading` with human-readable titles
  ("Large entries 3x3", "Hilbert 4x4", "Hilbert 5x5").
- Add group-heading unit tests for the new cases.

Test results (`just ci`):
- cargo test --features exact: 368 lib + 20 proptest_exact + 40 other
  proptests + 34 doc-tests — all pass
- cargo test (no features): 175 lib + 40 proptests + 29 doc-tests — all pass
- Python: 104 tests pass (ty, mypy, ruff clean)
- Clippy (pedantic + nursery + cargo, `-D warnings`): clean
- fmt, taplo, yamllint, shellcheck, spell-check, bench-compile, examples: clean

Closes #80

Co-Authored-By: Oz <oz-agent@warp.dev>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@acgetchell has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3de01529-d765-4849-99be-3f28501ba5e3

📥 Commits

Reviewing files that changed from the base of the PR and between 6357db3 and 1e0648d.

📒 Files selected for processing (1)
  • AGENTS.md
📝 Walkthrough

Walkthrough

Added adversarial exact-arithmetic benchmarks (near-singular, large-entry, Hilbert), a grouped benchmarking helper that runs four exact benches per input, matching benchmark-comparison script updates, expanded tests (unit, regression, and proptest) exercising exact solve/determinant codepaths, and broadened the exact feature prelude re-exports and documentation.

Changes

Cohort / File(s) Summary
Benchmarks
benches/exact.rs
Added adversarial input generators (large_entries_3x3, hilbert::<D>, expanded near_singular_3x3 docs), introduced bench_extreme_group::<D>() to run det_sign_exact, det_exact, solve_exact, solve_exact_f64 as a group, replaced individual near-singular bench functions with the grouped helper, improved expect messages, and extended Criterion imports.
Benchmark tooling & tests
scripts/bench_compare.py, scripts/tests/test_bench_compare.py
Added _EXTREME_BENCHES constant and three new EXACT_GROUPS entries (exact_large_entries_3x3, exact_hilbert_4x4, exact_hilbert_5x5) that use it; updated _group_heading formatting and added unit tests for the new headings.
Exact arithmetic unit tests
src/exact.rs
Added bigrational_matvec helper and regression tests: near-singular 3×3 solve, large-entry 3×3 solve and det-sign checks, and macro-generated Hilbert tests (D=2..=5) validating det/sign and exact solve residuals in BigRational.
Public API / Prelude
src/lib.rs
Under exact feature, re-exported num_bigint::BigInt and num_traits::{FromPrimitive, Signed, ToPrimitive} alongside BigRational; updated prelude exports and docs and added a gated test exercising these re-exports.
Property tests
tests/proptest_exact.rs
Expanded module docs, added proptest strategies and helpers, and macro-generated proptest suites (D=2..=5) for solve_exact round-trip, residual correctness in BigRational, and det_sign_exact vs det_exact sign agreement and boundary filters.
CI / Workflow
.github/workflows/benchmarks.yml
Changed PR-run Criterion invocation to use --baseline-lenient main when baseline artifacts are present to avoid aborting on missing per-benchmark entries.
Documentation
AGENTS.md, README.md, docs/BENCHMARKING.md
Updated exact feature docs to list BigInt and selected num-traits re-exports; documented the new adversarial benchmark groups and their stress properties in BENCHMARKING and AGENTS.md.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #80: perf: improve exact arithmetic benchmark coverage with diverse inputs — PR implements the requested near-singular, large-entry, and Hilbert benchmark groups and adds solve_exact benches.
  • acgetchell/la-stack#98: overlapping changes to bench grouping and heading logic in scripts/bench_compare.py; both adjust group mappings/headings for the exact suite.

Possibly related PRs

  • acgetchell/la-stack#70 — Adds/adjusts exact-bench groups and _group_heading logic in scripts/bench_compare.py (strongly related).
  • acgetchell/la-stack#73 — Refactors Bareiss / f64→BigInt paths that these new adversarial benches and tests exercise.
  • acgetchell/la-stack#48 — Introduced solve_exact/solve_exact_f64 implementations that the new tests/benches directly exercise.

Suggested labels

testing, documentation, rust, api, enhancement

Poem

🐰 I hopped through matrices, wide and sly,
Hilbert hills and giants reaching high,
Near-singular whispers I chased with flair,
BigInt blooms answered every snare—
Exact arithmetic, carrots in the sky!

🚥 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 title 'test: add adversarial-input coverage for exact arithmetic (#80)' accurately summarizes the main objective of adding new adversarial input tests and benchmarks for exact arithmetic operations.
Linked Issues check ✅ Passed All major coding objectives from issue #80 are met: near-singular solve benchmarks added [#80], adversarial BigInt growth inputs added [#80], ill-conditioned Hilbert matrices added [#80], and comparable benchmark groups with four shared operations implemented [#80].
Out of Scope Changes check ✅ Passed All changes directly support issue #80's objectives: benchmark additions, unit/proptest coverage, prelude re-exports for exact arithmetic (enabling better test/user APIs), and documentation updates are all in-scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/80-exact-bench-adversarial

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.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.40%. Comparing base (2d49d73) to head (1e0648d).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   93.16%   91.40%   -1.76%     
==========================================
  Files           5        5              
  Lines         512      512              
==========================================
- Hits          477      468       -9     
- Misses         35       44       +9     
Flag Coverage Δ
unittests 91.40% <ø> (-1.76%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/exact.rs`:
- Around line 2116-2118: The Hilbert test coverage is missing D=2; add the D=2
invocation for the macro gen_det_sign_exact_hilbert_positive_tests! so the
per-dimension tests cover 2..=5; specifically insert
gen_det_sign_exact_hilbert_positive_tests!(2); alongside the existing
invocations at the locations where
gen_det_sign_exact_hilbert_positive_tests!(3);
gen_det_sign_exact_hilbert_positive_tests!(4);
gen_det_sign_exact_hilbert_positive_tests!(5); appear (and likewise add the D=2
invocation at the second similar block around the other occurrence of those
three lines referenced in the comment).
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 487ac7c3-9a0c-49e7-9596-42bae578ca82

📥 Commits

Reviewing files that changed from the base of the PR and between 2d49d73 and 5bf5815.

📒 Files selected for processing (6)
  • benches/exact.rs
  • scripts/bench_compare.py
  • scripts/tests/test_bench_compare.py
  • src/exact.rs
  • src/lib.rs
  • tests/proptest_exact.rs

Comment thread src/exact.rs
Comment thread tests/proptest_exact.rs
Update the `exact` feature to re-export `BigInt` and essential `num-traits`
(FromPrimitive, ToPrimitive, Signed) alongside `BigRational`. This
simplifies downstream usage by removing the need for direct dependencies
on the `num` ecosystem for common operations.

Additionally, formalize adversarial-input benchmarking for near-singular,
large-entry, and Hilbert matrices to better track performance on
ill-conditioned data. CI benchmark comparisons are now more resilient to
newly added benchmarks via `--baseline-lenient`.

Refs: #80
@acgetchell
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
tests/proptest_exact.rs (1)

33-35: ⚠️ Potential issue | 🟠 Major

Fix the diagonal-dominance shift to match the generated off-diagonal range.

Line 69 still shifts by D * 5 + 1, but lines 34-35 allow off-diagonal entries up to 10. For D=3+, generated matrices can fail strict diagonal dominance and even be singular, making the solve_exact(...).expect("diagonally-dominant A is non-singular") properties flaky.

Proposed fix
-    // `D + 5` upper-bounds (D · 5 + 1) once D ≤ 5 entries of magnitude ≤ 5;
-    // shift the supplied diagonal by this amount while preserving its sign.
-    let shift = f64::from(u8::try_from(D).unwrap_or(u8::MAX)).mul_add(5.0, 1.0);
+    // Off-diagonal entries come from `small_int_f64()` and have magnitude ≤ 10.
+    // Use a shift strictly larger than any row's off-diagonal sum.
+    let shift = f64::from(u32::try_from(D).expect("proptest dimensions fit in u32"))
+        .mul_add(10.0, 1.0);

Also applies to: 54-77

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/proptest_exact.rs` around lines 33 - 35, The diagonal-dominance shift
currently uses D * 5 + 1 but off-diagonal entries come from small_int_f64 which
yields values in [-10,10], so increase the shift to guarantee strict diagonal
dominance: replace the D * 5 + 1 shift with D * 10 + 1 (or compute shift as D *
max_off_diag + 1 using max_off_diag = 10) wherever the diagonal is boosted (the
matrix generation/shift logic referenced around the tests that call
solve_exact(...).expect("diagonally-dominant A is non-singular") — update all
occurrences in the matrix-construction block(s) in tests/proptest_exact.rs,
including the region covering lines ~54-77, so the diagonal boost matches the
off-diagonal range).
🧹 Nitpick comments (1)
src/exact.rs (1)

2010-2164: Adversarial regression tests pin each bench group's intended behavior.

The adversarial block cleanly mirrors benches/exact.rs and the assertions are solid:

  • solve_exact_near_singular_3x3_integer_x0: the RHS [6 + 2^-50, 15, 24] is exactly representable in f64 (6's ulp at its exponent is 2^-50), so A · [1,1,1] materialises without rounding and the exact round-trip is a meaningful check.
  • solve_exact_large_entries_3x3_unit_vector / det_sign_exact_large_entries_3x3_positive: the fast-filter fall-through is explicitly asserted (!a.det_direct().is_some_and(f64::is_finite)), making the intent of the test unambiguous and exercising the Bareiss cold path.
  • Hilbert positivity + residual tests cover D=2..=5 via macros (past D=2 gap addressed); the alternating-sign RHS in gen_solve_exact_hilbert_residual_tests is a nice touch to avoid accidental structural cancellation.
  • bigrational_matvec takes borrowed inputs and is test-only, consistent with the rest of the helper layout.

One minor optional nit: assert!(a.det_exact().is_ok()) at Line 2089 is a very weak check — if you want it to earn its keep, you could alternatively assert a.det_exact().unwrap().is_positive() (since Signed is already in scope under the exact feature) to cross-validate the sign the Bareiss path just returned. Entirely optional.

As per coding guidelines, "Tests for dimension-generic code must cover D=2 through D=5 whenever possible using macros for per-dimension test generation" — the Hilbert macros satisfy this.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/exact.rs` around lines 2010 - 2164, The test
det_sign_exact_large_entries_3x3_positive currently asserts
a.det_exact().is_ok(), which is weak; change that to assert the exact
determinant is positive by unwrapping and checking its sign (e.g. replace the
is_ok() assertion with an assertion that a.det_exact().unwrap().is_positive()),
referencing the test function det_sign_exact_large_entries_3x3_positive and the
Matrix::det_exact method so the Bareiss result is cross-validated against
det_sign_exact().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@tests/proptest_exact.rs`:
- Around line 33-35: The diagonal-dominance shift currently uses D * 5 + 1 but
off-diagonal entries come from small_int_f64 which yields values in [-10,10], so
increase the shift to guarantee strict diagonal dominance: replace the D * 5 + 1
shift with D * 10 + 1 (or compute shift as D * max_off_diag + 1 using
max_off_diag = 10) wherever the diagonal is boosted (the matrix generation/shift
logic referenced around the tests that call
solve_exact(...).expect("diagonally-dominant A is non-singular") — update all
occurrences in the matrix-construction block(s) in tests/proptest_exact.rs,
including the region covering lines ~54-77, so the diagonal boost matches the
off-diagonal range).

---

Nitpick comments:
In `@src/exact.rs`:
- Around line 2010-2164: The test det_sign_exact_large_entries_3x3_positive
currently asserts a.det_exact().is_ok(), which is weak; change that to assert
the exact determinant is positive by unwrapping and checking its sign (e.g.
replace the is_ok() assertion with an assertion that
a.det_exact().unwrap().is_positive()), referencing the test function
det_sign_exact_large_entries_3x3_positive and the Matrix::det_exact method so
the Bareiss result is cross-validated against det_sign_exact().

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 15dcae8c-3e23-48e3-9016-d192df149ce4

📥 Commits

Reviewing files that changed from the base of the PR and between 2d49d73 and b1a491d.

📒 Files selected for processing (10)
  • .github/workflows/benchmarks.yml
  • AGENTS.md
  • README.md
  • benches/exact.rs
  • docs/BENCHMARKING.md
  • scripts/bench_compare.py
  • scripts/tests/test_bench_compare.py
  • src/exact.rs
  • src/lib.rs
  • tests/proptest_exact.rs

Introduce proptests to verify that the floating-point determinant sign
matches the exact sign whenever the error bound is satisfied. This
validates the correctness of the Shewchuk-style filter used in determinant
calculations.

Additionally, improve test reliability by correcting the diagonal dominance
calculation to properly account for the maximum off-diagonal magnitude and
refactor matrix-vector multiplication helpers to use idiomatic iterators.

Refs: #80
@acgetchell
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 224-227: The README sentence implies FromPrimitive, ToPrimitive,
and Signed are exported only via the prelude, but src/lib.rs also re-exports
FromPrimitive, ToPrimitive, and Signed at the crate root; update the AGENTS.md
wording to state that BigInt and BigRational are re-exported from the crate root
and prelude and that FromPrimitive, ToPrimitive, and Signed (from num-traits)
are re-exported both at the crate root and in the prelude so consumers can use
those trait methods without adding num-traits as a dependency.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 926410ad-700c-4685-a6e4-00091397332d

📥 Commits

Reviewing files that changed from the base of the PR and between 2d49d73 and 6357db3.

📒 Files selected for processing (10)
  • .github/workflows/benchmarks.yml
  • AGENTS.md
  • README.md
  • benches/exact.rs
  • docs/BENCHMARKING.md
  • scripts/bench_compare.py
  • scripts/tests/test_bench_compare.py
  • src/exact.rs
  • src/lib.rs
  • tests/proptest_exact.rs

Comment thread AGENTS.md Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@acgetchell acgetchell merged commit 150678a into main Apr 21, 2026
9 checks passed
@acgetchell acgetchell deleted the perf/80-exact-bench-adversarial branch April 21, 2026 04:46
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.

perf: improve exact arithmetic benchmark coverage with diverse inputs

1 participant