Skip to content

salvus.flow.acta.memo.audit

salvus.flow.acta.memo.audit salvus flow acta memo audit

Compare output digests from two runs with independent empty caches.

Functions

audit_determinism()

def audit_determinism(
    cases: list[AuditCase], root_a: pathlib.Path, root_b: pathlib.Path
) -> list[AuditResult]: ...

Run every case cold against two independent store/record pairs.

Parameters
  • cases list[AuditCase] — The cases to run through both passes.
  • root_a pathlib.Path — Store/records root for the first (cold) pass.
  • root_b pathlib.Path — Store/records root for the second pass; must differ from root_a.
Returns list[AuditResult] — One AuditResult per case, in the given order.

default_toy_cases()

def default_toy_cases() -> list[AuditCase]: ...

Return the built-in toy-flow case set for the determinism audit.

Returns list[AuditCase]

render_audit_report()

def render_audit_report(results: list[AuditResult]) -> str: ...

Render the per-task determinism table and summary percentage.

Parameters
  • results list[AuditResult] — Audit results, in the order to display.
Returns str — A plain-text table (task, deterministic, both digest prefixes), followed by the percentage of matching results.

Classes

AuditCase

class AuditCase(builtins.object):
    def __init__(
        self,
        task: str,
        compute: Callable[..., float],
        spec: BaseModel,
        inputs: Mapping[str, float],
        impl_version: int = 1,
    ) -> None: ...

One task invocation to run through both audit passes.

Parameters
  • task str — Task name.
  • compute Callable[..., float] — The pure function to call on a miss.
  • spec BaseModel — Frozen spec carrying the task’s non-input parameters.
  • inputs Mapping[str, float] — Mapping from input name to its float value.
  • impl_version int = 1 — The task’s implementation version.

AuditResult

class AuditResult(builtins.object):
    def __init__(
        self, task: str, deterministic: bool, digest_a: str, digest_b: str
    ) -> None: ...

The determinism outcome for one AuditCase.

Parameters
  • task str — Task name, copied through from the case.
  • deterministic bool — True if both passes produced the same output digest.
  • digest_a str — Output digest from the first pass.
  • digest_b str — Output digest from the second pass.