Expand description
§Cliffy Test - Algebraic Testing Framework
Tests are geometric invariants. Failures are geometric distances. Test composition uses geometric product.
§Philosophy
Traditional testing asks: “Does this assertion pass?” Cliffy testing asks: “Does this state lie on the expected manifold?”
By integrating with amari-flynn, we categorize test events into three types:
| Category | Probability | Meaning |
|---|---|---|
| Impossible | P = 0 | Formally proven to never occur |
| Rare | 0 < P << 1 | Statistically bounded failure rate |
| Emergent | P > 0 | Valid but unpredicted behaviors |
§Quick Start
use cliffy_test::prelude::*;
// Define an impossible invariant - must NEVER fail
let inv = invariant_impossible! {
name: "Magnitude is non-negative",
check: || {
let v = vector(1.0, 2.0, 3.0);
if v.magnitude() >= 0.0 {
TestResult::Pass
} else {
TestResult::fail_with_distance(v.magnitude(), "Negative magnitude")
}
}
};Re-exports§
pub use amari_flynn;
Modules§
- error
- Geometric error types for test failures
- generators
- Generators for property-based testing with QuickCheck
- invariants
- Invariant types for algebraic testing
- macros
- Declarative macros for algebraic testing
- manifold
- Manifold testing - verify states lie on expected geometric manifolds
- prelude
- Prelude module for common imports
- result
- Test result types with geometric information
Macros§
- emergent
- Track emergent behavior - valid but unpredicted (P > 0)
- geometric_
test - Run a test with geometric invariant checking
- invariant_
impossible - Define an impossible invariant - must NEVER fail (P = 0)
- invariant_
rare - Define a rare invariant - bounded failure probability (0 < P << 1)
- verify_
invariant - Verify an invariant and panic with geometric error info on failure
Structs§
- Bivector
- Bivector type - wrapper around Multivector with only grade 2
- Multivector
- A multivector in a Clifford algebra Cl(P,Q,R)
- Vector
- Vector type - wrapper around Multivector with only grade 1
Functions§
- bivector
- Convenience function to create a GA3 bivector from components
- from_
coeffs - Convenience function to create a GA3 from coefficient array
- sandwich
- Sandwich product: r * v * r.reverse()
- vector
- Convenience function to create a GA3 vector from components