Skip to main content

EddValidator

Struct EddValidator 

Source
pub struct EddValidator { /* private fields */ }
Expand description

EDD Validator for checking compliance with the four pillars.

Implementations§

Source§

impl EddValidator

Source

pub fn new() -> Self

Create a new EDD validator.

Source

pub fn lenient() -> Self

Create a validator in lenient mode (collects all violations).

Source

pub fn clear(&mut self)

Clear all collected violations.

Source

pub fn violations(&self) -> &[EddViolation]

Get collected violations.

Source

pub fn has_critical_violations(&self) -> bool

Check if any critical violations exist.

Source

pub fn has_errors(&self) -> bool

Check if any errors exist (including critical).

Source

pub fn validate_simulation_has_emc( &self, emc: Option<&EquationModelCard>, ) -> EddResult<()>

Validate that a simulation has an Equation Model Card.

§EDD-01: Missing Equation Model Card
§Errors

Returns EDD-01 violation if EMC is None.

Source

pub fn validate_emc_has_equation( &self, emc: &EquationModelCard, ) -> EddResult<()>

Validate that an EMC has a governing equation.

§EDD-02: Missing governing equation
§Errors

Returns EDD-02 violation if equation is empty.

Source

pub fn validate_emc_has_citation( &self, emc: &EquationModelCard, ) -> EddResult<()>

Validate that an EMC has a citation.

§EDD-03: Missing citation
§Errors

Returns EDD-03 violation if citation has no authors.

Source

pub fn validate_emc_has_tests(&self, emc: &EquationModelCard) -> EddResult<()>

Validate that an EMC has verification tests.

§EDD-04: Missing verification tests
§Errors

Returns EDD-04 violation if verification tests are empty.

Source

pub fn validate_emc( &mut self, emc: &EquationModelCard, ) -> Result<(), Vec<EddViolation>>

Perform full EMC validation.

§Errors

Returns list of violations if any validation checks fail.

Source

pub fn validate_seed_specified(&self, seed: Option<u64>) -> EddResult<()>

Validate that a seed is explicitly specified.

§EDD-05: Missing explicit seed
§Errors

Returns EDD-05 violation if seed is None.

Source

pub fn validate_has_falsification_criteria( &self, spec: &ExperimentSpec, ) -> EddResult<()>

Validate that an experiment has falsification criteria.

§EDD-06: Missing falsification criteria
§Errors

Returns EDD-06 warning if falsification criteria are empty.

Source

pub fn validate_experiment( &mut self, spec: &ExperimentSpec, ) -> Result<(), Vec<EddViolation>>

Validate an experiment specification fully.

§Errors

Returns list of violations if any validation checks fail (error severity or higher).

Source

pub fn validate_verification_tests<F>( &mut self, emc: &EquationModelCard, evaluator: F, ) -> Result<(), Vec<EddViolation>>
where F: Fn(&HashMap<String, f64>) -> f64,

Validate that verification tests pass.

§EDD-07: Verification test failed
§Errors

Returns EDD-07 violations for each verification test that fails.

Source

pub fn validate_conservation_law( &self, quantity_name: &str, initial_value: f64, current_value: f64, tolerance: f64, ) -> EddResult<()>

Validate conservation laws are satisfied.

§EDD-08: Conservation laws violated

Monitors quantities that should be conserved (energy, momentum, etc.) and triggers Jidoka (stop-on-error) if drift exceeds tolerance.

§Arguments
  • quantity_name - Name of the conserved quantity (e.g., “energy”)
  • initial_value - Value at simulation start
  • current_value - Current value during simulation
  • tolerance - Maximum allowed relative drift
§Errors

Returns EDD-08 violation if conservation law is violated.

Source

pub fn validate_cross_platform_reproducibility( &self, platform_a: &str, platform_b: &str, result_a: f64, result_b: f64, tolerance: f64, ) -> EddResult<()>

Validate cross-platform reproducibility.

§EDD-09: Cross-platform reproducibility failed

Compares simulation results across different platforms to ensure bitwise-identical outputs given the same seed.

§Arguments
  • platform_a - Name of first platform
  • platform_b - Name of second platform
  • result_a - Result from platform A
  • result_b - Result from platform B
  • tolerance - Maximum allowed difference (0.0 for exact match)
§Errors

Returns EDD-09 violation if results differ beyond tolerance.

Source

pub fn validate_tdd_compliance( &self, implementation_name: &str, has_test_file: bool, test_count: usize, ) -> EddResult<()>

Validate that implementation has associated failing tests.

§EDD-10: Implementation without failing test

Enforces the TDD principle: no implementation without a failing test. This is verified by checking that test files exist and contain appropriate test cases.

§Arguments
  • implementation_name - Name of the implementation
  • has_test_file - Whether a test file exists
  • test_count - Number of tests for this implementation
§Errors

Returns EDD-10 violation if no tests exist.

Source

pub fn validate_yaml_only_config( has_yaml_config: bool, hardcoded_params: &[String], ) -> Result<(), EddViolation>

§EDD-13: YAML-Only Configuration

Validates that no hardcoded parameters exist - all configuration must come from YAML files.

§Arguments
  • has_yaml_config - Whether the simulation has YAML configuration
  • hardcoded_params - List of detected hardcoded parameters
§Errors

Returns EDD-13 violation if:

  • No YAML configuration is provided, or
  • Hardcoded parameters are detected
Source

pub fn validate_probar_tui( probar_tests_passed: bool, test_count: usize, ) -> Result<(), EddViolation>

§EDD-14: Probar TUI Verification

Validates that TUI components have been tested with Probar.

§Arguments
  • probar_tests_passed - Whether Probar TUI tests passed
  • test_count - Number of Probar TUI tests
§Errors

Returns EDD-14 violation if:

  • No Probar tests exist, or
  • Probar tests failed
Source

pub fn validate_probar_wasm( probar_wasm_passed: bool, test_count: usize, ) -> Result<(), EddViolation>

§EDD-15: Probar WASM Verification

Validates that WASM components have been tested with Probar.

§Arguments
  • probar_wasm_passed - Whether Probar WASM tests passed
  • test_count - Number of Probar WASM tests
§Errors

Returns EDD-15 violation if:

  • No Probar WASM tests exist, or
  • Probar WASM tests failed
Source

pub fn validate_three_pillars( z3_proofs_passed: bool, has_yaml_config: bool, seed_specified: bool, probar_tui_passed: bool, probar_tui_test_count: usize, probar_wasm_passed: bool, probar_wasm_test_count: usize, ) -> Vec<EddViolation>

§Three Pillars Quality Gate

Validates all three pillars of provable simulation:

  1. Z3 Equation Proofs (EDD-11, EDD-12)
  2. YAML-Only Configuration (EDD-05, EDD-13)
  3. Probar UX Verification (EDD-14, EDD-15)
§Arguments
  • z3_proofs_passed - Whether Z3 proofs pass
  • has_yaml_config - Whether YAML config exists
  • seed_specified - Whether seed is specified
  • probar_tui_passed - Whether Probar TUI tests pass
  • probar_wasm_passed - Whether Probar WASM tests pass
§Returns

A vector of any violations found across all three pillars.

Trait Implementations§

Source§

impl Debug for EddValidator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EddValidator

Source§

fn default() -> EddValidator

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V