Skip to content

Fixed miri tests #646

Merged
marvin-hansen merged 7 commits into
deepcausality-rs:mainfrom
marvin-hansen:main
Jun 22, 2026
Merged

Fixed miri tests #646
marvin-hansen merged 7 commits into
deepcausality-rs:mainfrom
marvin-hansen:main

Conversation

@marvin-hansen

@marvin-hansen marvin-hansen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Describe your changes

Fixed miri tests

Issue ticket number and link

closes #643

Code checklist before requesting a review

  • I have signed the DCO?
  • All tests are passing when running make test?
  • No errors or security vulnerabilities are reported by make check?

For details on make, please see BUILD.md

Note: The CI runs all of the above and fixing things before they hit CI speeds
up the review and merge process. Thank you.


Summary by cubic

Stabilizes Miri test runs across the workspace by adding a Miri runner and conditionally skipping unsupported or long-running tests. Tightens physics quantity assertions and trait coverage to prevent regressions.

  • Bug Fixes

    • Added build/scripts/miri.sh to run cargo miri test across all crates.
    • Skipped slow/unsupported cases under Miri via #[cfg(not(miri))]/#[cfg_attr(miri, ignore)] in deep_causality_algorithms and deep_causality_cfd (DAG sampling, IO, solver/coupling).
    • Hardened deep_causality_physics quantity tests with stricter invariants and trait coverage (e.g., Mass, MomentOfInertia, zero-length in Length, VectorPotential default).
  • Refactors

    • Restructured deep_causality_physics quantity tests into per-quantity folders with leaf *_tests.rs and lightweight mod.rs.
    • Exported shared fixtures as deep_causality_physics::utils_tests (behind alloc) for reuse across leaves.
    • Updated Bazel glob to quantities/*/*_tests.rs to match the new layout.

Written for commit 97f82c2. Summary will update on new commits.

Review in cubic

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…leaves

Restructure tests/quantities/ to the kernels convention: each quantity is a
folder (no _tests suffix) with a declarations-only mod.rs plus self-contained
*_tests.rs leaves. Split the seven files over 250 lines by quantity type;
extract the fourteen single-file folders into dedicated leaves.

Export shared SolenoidalField test fixtures to deep_causality_physics::
utils_tests so each leaf compiles standalone under Bazel's per-file
rust_test_suite. Update the quantities glob to quantities/*/*_tests.rs.

cargo test: 1563 pass. bazel test //...: 865 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
@marvin-hansen marvin-hansen self-assigned this Jun 22, 2026

@cubic-dev-ai cubic-dev-ai 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.

10 issues found across 129 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

Comment thread deep_causality_algorithms/tests/mod.rs Outdated
Comment thread makefile
Comment thread deep_causality_physics/tests/quantities/dynamics_quantities/mass_tests.rs Outdated
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (aee75a8) to head (97f82c2).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #646   +/-   ##
=======================================
  Coverage   97.56%   97.57%           
=======================================
  Files        1114     1115    +1     
  Lines       57243    57313   +70     
=======================================
+ Hits        55851    55921   +70     
  Misses       1392     1392           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Address P3 review findings — mostly pre-existing inconsistent test rigor
surfaced by the quantities test reorganization, where Mass was authored
more thoroughly than its sibling scalars.

- dynamics/mass: assert the PhysicalInvariantBroken/"finite" variant on
  the NaN and Infinity paths, and tighten the negative-value check to
  require "negative" (it previously also passed on any "Mass" message,
  so the finite-error message would have satisfied it).
- dynamics/moment_of_inertia: assert the stored value on the valid path
  and the PhysicalInvariantBroken/"negative" variant on rejection,
  matching the Mass exemplar.
- dynamics/length: add the missing new(0.0) zero-length case that Mass
  and Speed already cover.
- condensed/trait_coverage: exercise PartialOrd for all seven scalars
  rather than only Conductance, in a file dedicated to trait coverage.
- condensed/vector_potential: split the combined default+new test in two
  and assert the default multivector's value is 0.0, not only its length.

Also:
- makefile: document the `miri` target in `make help`.
- deep_causality_algorithms/tests: fix "foreever" comment typo.

cargo test -p deep_causality_physics: 1565 pass. clippy and fmt clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
@marvin-hansen marvin-hansen merged commit fdcb537 into deepcausality-rs:main Jun 22, 2026
13 checks passed
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.

Fix miri tests

1 participant