Skip to content

Differential

opulse.verify.differential

Differential checks: every backend must agree with the reference oracle.

Inputs are random values plus boundary values that the definition itself suggests: the integer literals it mentions (branch thresholds, moduli) and their neighbours, 0, +-1, and values around the semantic bound.

literals

literals(definition: Definition) -> set[int]

Integer literals appearing anywhere in a definition.

check_operator

check_operator(
    operator: Operator,
    evaluate: Callable[..., Triple],
    oracle: Oracle,
    rng: Random,
    random_trials: int = 200,
    value_range: tuple[int, int] = (-1000, 1000),
    inputs: Iterable[tuple] | None = None,
) -> list[Mismatch]

Compare evaluate(*args) with the oracle on boundary and random inputs.