Skip to main content

DiffExecEngine

Trait DiffExecEngine 

Source
pub trait DiffExecEngine: Send + Sync {
    // Required method
    fn execute_and_compare(
        &self,
        general_text: &str,
        specialist_text: &str,
        module: &Module,
        config: &BackendConfig,
        tolerance: f64,
    ) -> Result<DiffExecResult, String>;
}
Expand description

PMAT-486 (§30 Track 4): engine that executes two emitted programs on contract-fixture inputs and numerically compares the outputs within a tolerance — the Runtime-stratum half of the §29 quorum. The trait + hook land here (free CI); the real CUDA / Vulkan implementations (PMAT-488 / PMAT-490) run out-of-band on self-hosted GPU runners.

Error posture (per the §30 Track-4 review): with no engine installed the DiffExec policy records NotRun { reason: no-engine } (benign — free CI stays green). An installed engine that returns Err propagates a hard BackendError that fails the job — a broken GPU run must NOT masquerade as “not run”.

Required Methods§

Source

fn execute_and_compare( &self, general_text: &str, specialist_text: &str, module: &Module, config: &BackendConfig, tolerance: f64, ) -> Result<DiffExecResult, String>

Execute general_text and specialist_text on the contract’s fixture inputs and compare. Ok(Match|Divergent) records the vote; Err(msg) is a hard failure (e.g. driver fault / launch error) the caller turns into a BackendError.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§