Increased test coverage #644
Merged
Merged
Conversation
- add default-method tests for Adjustable/UncertainAdjustable traits - cover CausalAction::action() and Model's Identifiable::id() trait impl - cover ActionError->CausalityError and CsmError::Uncertain source arms - cover monadic_collection_utils non-Value / missing-threshold error paths - cover GraphGeneratableEffect apply no-value/no-error branch - cover Interpreter Default impl and no-context / poisoned-lock evolve paths - cover get_shortest_path start==stop and unfrozen-graph arms; add_causaloid frozen-graph error; collection aggregation-Err (stateless and stateful); stateful collection incoming-error and empty-collection arms - cover InferableReasoning::all_non_inferable true arm via a mock Inferable - net: 244 -> 155 uncovered lines in deep_causality/src; remaining lines are dead/unexported code, defensive guards, unreachable!() phantom arms, and error paths unconstructible via the public API Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Add tests covering previously untested modules (tests only; no production source changes beyond wiring a #[cfg(test)] mod): - algebra: Group/Abelian, Ring, and Module (scale) trait impls - arithmetic: identity (zero/one) and Neg for owned and &ref tensors - ops: tensor_svd_decomp power iteration, non-contiguous reshape (tensor_shape), tensor_product, tensor_reduction, tensor_stack, tensor_inverse, and ein_sum diagonal/trace paths - getters/get_ref, to-conversions, display, ext_hkt, ext_stats Remaining uncovered lines are unreachable defensive guards, documented: - tensor_inverse:85 — div-by-zero shadowed by the earlier relative singular-matrix check (pivot == max_val > tol >= epsilon) - tensor_reduction:127 — AxisOutOfBounds shadowed by sum_axes' own axis validation, which runs first - tensor_shape:42/54 — defensive index guard and rank>0 false edge (non-contiguous tensors always have rank >= 2) - tensor_svd_decomp:73/113 — zero-norm guards unreachable given the positive deterministic v init and normalized u - ein_sum_impl:404 — if-let-None merge for an always-valid batch index Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…argeted branch tests - brcd: cover None-plan/empty-config path (acyclic CPDAG with no valid cut), non-2D tensor guard, pairwise candidate enumeration, non-positive Dirichlet concentration, and directed-arc cpdag_key collection - surd: cover the monotonicity level-raise body in both the base and CDL paths - dag_sampling: add permutation-stress and equal_to_vec batteries; prove the remaining forbidden-prefix breaks, post-orientation cycle guards, and WeightedChoice fallthrough unreachable for valid chordal/CPDAG input - document all residual lines as unreachable/defensive exceptions (feature-gated parallel paths, guards shadowed by earlier validation, invariant shape/cycle guards, llvm-cov generic-stub artifacts) - tests only; no source changes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
… the rest - Cover 4 reachable defensive guards with real tests: - astro/wrappers schwarzschild_radius error arm (negative mass → Length::new) - fluids/coherent_structures lambda2 upper r_val clamp (scanned gradient) - quantum/gates_haruna exp non-finite-delta guard (overflow sweep) - relativity/spacetime time_dilation gamma clamp (identical-vector rounding) - Document the 157 remaining uncovered lines as defensively unreachable: infallible R::from_f64 closures, always-Ok kernels/constructors, and guards shadowed by earlier validation (with per-line NOTE blocks in the test files). - Fix 3 pre-existing clippy -D warnings in test files by rewriting test code (unnecessary_unwrap, single-pattern match, identity_op). - Tests only; no non-test source changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…t defensive remainder - adjunction-Stokes: cover exterior-derivative column-bound guard and the boundary lookup-miss arm via short-coefficient and partial-chain tests - gauge witness: cover the scalar (0-d) connection single-point default in both abelian and non-abelian field-strength kernels using a custom SPACETIME_DIM=1, LIE_ALGEBRA_DIM=1 abelian group - simplicial complex: cover empty-complex hodge_star_operators fast path and the previously-unused create_test_tensor helper - manifold covariance: add 1x1 success-path tests for covariance/eigen - remaining uncovered lines are documented exceptions: from_f64 conversion arms (never fail for f64/f32), zero-extent lattice guards, writeln! ?-Err regions, redundant guards shadowed by earlier validation, constructor- prevented empty states, the f64-sqrt undershoot guard (proven unreachable), if-let merge-brace region artifacts, and degenerate-geometry branches gated by validated inputs 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>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 96.09% 97.56% +1.47%
==========================================
Files 1114 1114
Lines 57243 57243
==========================================
+ Hits 55005 55851 +846
+ Misses 2238 1392 -846 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
No issues found across 173 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Increased test coverage across multiple crates.
Issue ticket number and link
Closes #638
Code checklist before requesting a review
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
Increase test coverage across
deep_causality,deep_causality_algorithms, anddeep_causality_physics. Adds targeted tests for error paths, default trait bodies, and edge-case branches; no production code changes.Test Coverage
deep_causality: tests for error conversions and sources; defaultAdjustable/UncertainAdjustable; collection aggregation and short-circuit paths (incl.UncertainF64); graph guards (frozen add, unfrozen or identical-node shortest-path); space-time interval time-scale conversions; model/interpreter defaults; applicative no-value branch; utils aggregate non-Value errors.deep_causality_algorithms: BRCD empty-config/None-plan and non-finite scoring; GST cached-removal replay; SURD level-raising and zero-entropy cases (base and CDL); DAG sampling branch coverage; MRMR non-finite first-feature; SURD utils marginal zero entries.deep_causality_physics: kernel and wrapper error arms across astro, condensed, dynamics, EM, fluids, MHD, nuclear, photonics, quantum, relativity, thermodynamics, and waves; finiteness/clamp checks; small PDG and quantity constructor/accessor tests.Build/Test Config
tests/errorsuite and wire new test modules underdeep_causality_physics/tests/BUILD.bazel.Written for commit 4719e8a. Summary will update on new commits.