Skip to main content

fluxbench_logic/
lib.rs

1#![warn(missing_docs)]
2//! FluxBench Logic - Algebraic Verification Engine
3//!
4//! Evaluates performance assertions and synthetic metrics using mathematical expressions.
5//! Provides verification rules (pass/fail/warn), synthetic metric computation, and dependency graphs.
6
7mod context;
8mod graph;
9mod synthetic;
10mod verification;
11
12pub use context::MetricContext;
13pub use graph::{DependencyGraph, GraphError};
14pub use synthetic::{SyntheticDef, SyntheticResult, compute_synthetics};
15pub use verification::{
16    ResolvedMetric, Severity, Verification, VerificationContext, VerificationResult,
17    VerificationStatus, VerificationSummary, aggregate_verifications, run_verifications,
18};
19
20/// Definition of a verification rule registered via `#[flux::verify]`
21#[derive(Debug, Clone)]
22pub struct VerifyDef {
23    /// Unique identifier
24    pub id: &'static str,
25    /// Expression to evaluate
26    pub expression: &'static str,
27    /// Severity level
28    pub severity: Severity,
29    /// Tolerance margin for float comparison
30    pub margin: f64,
31}
32
33// Collect all registered verifications and synthetics
34inventory::collect!(VerifyDef);
35inventory::collect!(SyntheticDef);