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()
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
caseslist[AuditCase] — The cases to run through both passes.root_apathlib.Path — Store/records root for the first (cold) pass.root_bpathlib.Path — Store/records root for the second pass; must differ fromroot_a.
Returns list[AuditResult] — One
AuditResult per case, in the given order.default_toy_cases()
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()
render_audit_report()def render_audit_report(results: list[AuditResult]) -> str: ...Render the per-task determinism table and summary percentage.
Parameters
resultslist[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
AuditCaseclass 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
taskstr — Task name.computeCallable[..., float] — The pure function to call on a miss.specBaseModel — Frozen spec carrying the task’s non-input parameters.inputsMapping[str, float] — Mapping from input name to its float value.impl_versionint — The task’s implementation version.
AuditResult
AuditResultclass AuditResult(builtins.object):
def __init__(
self, task: str, deterministic: bool, digest_a: str, digest_b: str
) -> None: ...The determinism outcome for one AuditCase.
Parameters
taskstr — Task name, copied through from the case.deterministicbool —Trueif both passes produced the same output digest.digest_astr — Output digest from the first pass.digest_bstr — Output digest from the second pass.