Added bug fixes across many crates.#429
Added bug fixes across many crates.#429marvin-hansen merged 21 commits intodeepcausality-rs:mainfrom
Conversation
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.1 to 5.5.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5.5.1...v5.5.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.5.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…ctions/cache-5 build(deps): Bump actions/cache from 4 to 5
…odecov/codecov-action-5.5.2 build(deps): Bump codecov/codecov-action from 5.5.1 to 5.5.2
…Updated tests for verification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…. Updated tests for verification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
… verification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…erification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…r verification. 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>
…rification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…for verification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…tests for verification. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…cation. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
PR Compliance Guide 🔍(Compliance updated until commit 09dbfe5)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 4d762df
|
|||||||||||||||||||||||||||||||||||||||||||||||||
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
==========================================
+ Coverage 94.31% 94.79% +0.48%
==========================================
Files 723 723
Lines 28603 28710 +107
==========================================
+ Hits 26976 27217 +241
+ Misses 1627 1493 -134 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Code Suggestions ✨Latest suggestions up to 6b3f7dd
Previous suggestionsSuggestions up to commit 4d762df
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
…acceleration. 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>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
User description
Describe your changes
Added bug fixes across many crates.
updated GH depds to latest version.
Issue ticket number and link
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.
PR Type
Bug fix, Tests, Enhancement, Documentation
Description
Fixed critical bugs across multiple crates including quaternion space array dimensions, octonion multiplication signs, and physics quantity validation
Added finiteness validation to physics quantity constructors to prevent NaN and infinite values
Implemented error chain preservation in deontic error conversions by wrapping
GraphErrorin variant fieldsRefactored CSM state management API to use internal state IDs instead of arbitrary indices, eliminating ID mismatch bugs
Fixed division by zero vulnerabilities in
ObservableandInferabletraits with empty collection guardsAdded multivector grade validation to Maxwell solver for electromagnetic calculations
Fixed uniform distribution overflow handling in random number generation (u32, u64, usize)
Corrected sparse matrix index validation for non-square matrices with separate bounds checking
Implemented CSV column exclusion in data loader to respect
exclude_indicesconfigurationAdded validation to
Topologyconstructor withResultreturn type for construction-time error checkingRemoved unused process noise parameter from Kalman filter implementation
Implemented custom
Defaulttrait for MHD quantities respecting physical invariantsAdded comprehensive bug documentation and reproduction tests across physics, random number generation, topology, data structures, and numeric modules
Diagram Walkthrough
File Walkthrough
17 files
adjustable_tests.rs
Fix quaternion space array grid dimension bugdeep_causality/tests/types/context_node_types/space/quaternion_space/adjustable_tests.rs
4, 4, 4, 1to4, 4, 4, 4across 18 test functions
(w, x, y, z)
deontic_error_tests.rs
Preserve error chain in deontic error conversionsdeep_causality_ethos/tests/errors/deontic_error_tests.rs
DeonticErrorenum variants to includeGraphErrorfields forFailedToAddEdge,GraphNotFrozen,GraphIsFrozen, andGraphIsCyclicSomesource instead ofNoneforerror chain preservation
GraphErrorfield in errorvariants
csm_single_state_tests.rs
Fix CSM state management API to use internal IDsdeep_causality/tests/types/csm_types/csm/csm_single_state_tests.rs
add_single_state()andupdate_single_state()callsmapping
idinstead ofhardcoded
2)remove_single_state()to use correct state ID2instead of43quantities.rs
Implement custom Default for MHD quantities with constraintsdeep_causality_physics/src/mhd/quantities.rs
Defaultderive fromLarmorRadius,DebyeLength,PlasmaFrequency, andConductivityDefaulttrait for each type returningf64::MIN_POSITIVEto satisfy> 0constraintmod.rs
Add empty collection guards to inferable trait methodsdeep_causality/src/traits/inferable/mod.rs
conjoint_delta(),percent_inferable(),percent_inverse_inferable(), andpercent_non_inferable()methodszero
uniform_u32.rs
Fix uniform u32 distribution overflow and range handlingdeep_causality_rand/src/types/distr/uniform/uniform_u32.rs
low == high(single-value ranges)checked_add()to prevent overflow whenhigh_val == u32::MAXarithmetic.rs
Fix octonion multiplication sign errors in basis elementsdeep_causality_num/src/complex/octonion_number/arithmetic.rs
e5_res,e6_res, ande7_rescomponentsestimation.rs
Remove unused process noise from Kalman filterdeep_causality_physics/src/dynamics/estimation.rs
process_noiseparameter (prefixed with underscore)p_newdirectly instead ofp_finaluniform_usize.rs
Fix uniform usize distribution overflow and range handlingdeep_causality_rand/src/types/distr/uniform/uniform_usize.rs
low == high(single-value ranges)checked_add()to prevent overflow whenhigh_val == usize::MAXuniform_u64.rs
Fix uniform u64 distribution overflow and range handlingdeep_causality_rand/src/types/distr/uniform/uniform_u64.rs
low == high(single-value ranges)checked_add()to prevent overflow whenhigh_val == u64::MAXapi.rs
Update effect ethos API for new error variant signaturesdeep_causality_ethos/src/types/effect_ethos/api.rs
link_inheritance()to wrapGraphError::GraphIsFrozenin newvariant signature
link_defeasance()to wrapGraphError::GraphIsFrozenin newvariant signature
mod.rs
Fix sparse matrix index validation for non-square matricesdeep_causality_sparse/src/types/sparse_matrix/mod.rs
max()to individual bounds checkscsv.rs
Implement CSV column exclusion in data loaderdeep_causality_discovery/src/types/data_loader/csv.rs
exclude_indicesconfiguration when loading CSVdata
deep_causality_bugs.md
Deep Causality Division by Zero and CSM ID Mismatch Bugsspecs/fixes/deep_causality_bugs.md
vulnerabilities in
ObservableandInferabletraits when operating onempty collections
methods use arbitrary indices instead of state internal IDs, causing
inconsistent state access
analysis, and recommended fixes for both bugs
production systems
topology_bugs.md
Topology Shape Preservation and Constructor Validation Bugsspecs/implemented/topology_bugs.md
TopologyWitness::extendflatteningmulti-dimensional tensors to 1D, breaking shape preservation
consistency with
fmapTopology::newconstructor accepting invalid inputs withoutvalidation, allowing out-of-bounds cursors and mismatched
data/skeleton sizes
gaps with recommended fixes
matching existing safe implementations
data_structures_bugs.md
3D Array Storage Indexing Order Bugspecs/implemented/data_structures_bugs.md
Storagetrait implementation using
[height][width][depth]instead of[depth][height][width]non-cubic grids and silent data corruption in other cases
mismatch and comparison with correct 2D implementation
implementation
num_bugs.md
Octonion Multiplication Sign Error Bugspecs/implemented/num_bugs.md
incorrect sign terms violating Cayley-Dickson construction rules
(e2*e5, e5*e2, e3*e5, e5*e3) with expected vs actual results
algebraic properties like the alternative property
bug went undetected despite comprehensive test coverage
4 files
quantities.rs
Add finiteness validation to physics quantity constructorsdeep_causality_physics/src/dynamics/quantities.rs
is_finite()check) toMass,Speed,Acceleration,Force,Torque,Length,Area,Volume,MomentOfInertia,and
FrequencyconstructorsPhysicalInvariantBrokenerror for NaN and infinite valuesdeontic_error.rs
Wrap GraphError in DeonticError variants for error chain preservationdeep_causality_ethos/src/errors/deontic_error.rs
DeonticErrorenum to includeGraphErrorfields inFailedToAddEdge,GraphNotFrozen,GraphIsFrozen, andGraphIsCyclicvariants
Error::source()implementation to return the wrappedGraphErrorfor these variantsDisplayimplementation to handle the new variant signaturesFromimplementation to preserve the original errorsolver.rs
Add multivector grade validation to Maxwell solverdeep_causality_physics/src/electromagnetism/solver.rs
validate_pure_grade()helper method to check multivector gradepurity
calculate_potential_divergence()forgradient and potential inputs
PhysicalInvariantBrokenerror if inputs contain non-grade-1components
mod.rs
Add validation to Topology constructor with Result returndeep_causality_topology/src/types/topology/mod.rs
Topology::new()to returnResultinsteadof
Self13 files
multiplication_bug_repro_tests.rs
Add octonion multiplication bug reproduction testsdeep_causality_num/tests/complex/octonion_number/multiplication_bug_repro_tests.rs
with expected results
comparisons
topology_tests.rs
Update topology tests for Result-based validationdeep_causality_topology/tests/types/topology/topology_tests.rs
.unwrap()toTopology::new()calls that now returnResult#[should_panic]attributes from validation testsvalidation_tests.rs
Add topology validation test suitedeep_causality_topology/tests/types/topology/validation_tests.rs
Topologyvalidation logicvalid cases
indexing_bug_repro.rs
Add array indexing bug reproduction testsdeep_causality_data_structures/tests/grid_type/indexing_bug_repro.rs
PointIndexcoordinates and rawarray indices
access
teloid_graph_tests.rs
Update teloid graph tests for new error variantsdeep_causality_ethos/tests/types/teloid_graph/teloid_graph_tests.rs
DeonticError::GraphIsFrozento handle newGraphErrorfieldDeonticError::FailedToAddEdgeto usewildcard for
GraphErrorfieldcsv_exclude_bug_repro.rs
Add CSV exclude indices bug reproduction testdeep_causality_discovery/tests/types/data_loader/csv_exclude_bug_repro.rs
exclude_indicesparameter is properly respected whenloading CSV data
verify_graph_bug_repro.rs
Add effect ethos verify graph bug reproduction testdeep_causality_ethos/tests/types/effect_ethos/verify_graph_bug_repro.rs
GraphIsCyclicwith proper error chainfrom_triplets_tests.rs
Add non-square sparse matrix validation testsdeep_causality_sparse/tests/types/sparse_matrix/from_triplets_tests.rs
non-square matrices
csm_id_repro.rs
Add CSM state ID mismatch bug reproduction testdeep_causality/tests/types/csm_types/csm/csm_id_repro.rs
hkt_topology_tests.rs
Update HKT topology tests for Result return typedeep_causality_topology/tests/extensions/hkt_topology_tests.rs
.unwrap()toTopology::new()calls that now returnResulteffect_ethos_evaluate_action_tests.rs
Update effect ethos action evaluation tests for new error variantsdeep_causality_ethos/tests/types/effect_ethos/effect_ethos_evaluate_action_tests.rs
DeonticError::GraphIsCyclicto handle newGraphErrorfieldDeonticError::GraphNotFrozento usewildcard for field
div_by_zero_repro.rs
Add observable division by zero bug reproduction testdeep_causality/tests/traits/observable/div_by_zero_repro.rs
physics_tests.rs
Update half-life zero validation testdeep_causality_physics/tests/nuclear/physics_tests.rs
HalfLife::new(0.0)returns error atconstruction time
PhysicalInvariantBroken2 files
state_add.rs
Refactor CSM add_single_state to use internal state IDdeep_causality/src/types/csm_types/csm/state_add.rs
idxparameter fromadd_single_state()methodsignature
index-based
state_update.rs
Refactor CSM update_single_state to use internal state IDdeep_causality/src/types/csm_types/csm/state_update.rs
idxparameter fromupdate_single_state()methodsignature
index-based
4 files
physics_bugs.md
Comprehensive physics module bug documentation and analysisspecs/implemented/physics_bugs.md
deep_causality_physicscrate, including detailed analysis of rootcauses, evidence, and recommended fixes
constraints), Kalman filter (incorrect process noise addition),
nuclear physics (HalfLife zero validation), quantum physics
(PhaseAngle non-finite values), electromagnetism (Maxwell solver
incomplete divergence calculation), and dynamics quantities
(NaN/infinity validation gaps)
each bug went undetected
other physics modules
rand_bugs.md
Random number generation crate bug documentationspecs/implemented/rand_bugs.md
deep_causality_randcrateUniformU32::new_inclusiveoverflow bug when upper boundequals
u32::MAXandrandom_boolcomparison operator bug withp=1.0for both bugs
UniformU64andUniformUsizeimplementationskani.md
Kani Rust Verifier Documentation and Capabilitiesspecs/deferred/kani.md
for detecting bounds checking, pointer safety, and overflow errors
and uninitialized memory detection gaps
support across language features
floating point operation approximations in Kani
num_kani.md
Kani Verification Action Plan for Numeric Cratespecs/deferred/num_kani.md
deep_causality_numcrateusing Kani Rust verifier
algebraic laws, and complex number implementations
casting operations, and numeric safety properties
verification approach for CI integration
37 files