Skip to main content

Module result

Module result 

Source
Expand description

The result contract optimization.result/0.2: outcomes with claims and evidence, the result journal, and the manifests the runner builds from it (the guide’s section Results and durable recovery).

Structs§

Certificate
A proof of a claim and the verdict of the checker that judged it.
Evidence
How much of a claim was verified, and how.
ObjectiveBounds
The objective of the best feasible point and a proven bound on the optimum.
Outcome
What a worker reports for one task: why it stopped, what it claims and how the claim is supported. Outcome::check enforces the contract’s rules.
Record
One committed task in the result journal results.jsonl.
Refutation
A claim of the solver that an independent check rejected.

Constants§

BOUND_TOLERANCE
Relative tolerance of the objective-bound rules of Outcome::check: two objective values a and b agree, and a dual bound may lie beyond the primal bound, by at most BOUND_TOLERANCE * max(1, |a|, |b|). Workers with tighter tolerances decide more strictly on their own and keep a rejected value in details.
CHECKS
Properties a worker recomputes independently of the solver.
CLAIMS
Every claim. A claim states what the worker asserts about the task’s answer; evidence states how much of that was verified.
LEVELS
Evidence levels, weakest first.
SCHEMA
Result manifests written by this build.
SCHEMAS
Result manifests compare reads. A 0.1 manifest is a valid 0.2 manifest without evidence, objective bounds or the claims added in 0.2.
VERDICTS
Why an independent check refuted the solver’s claim; the solver competitions’ wrong-answer categories.

Functions§

compare
Sets result manifests side by side. All must use a schema of SCHEMAS, the same payload schema and the same spec_digest; manifests of the legacy format go to legacy::result::compare. The answer lists the arms and warnings and names no winner.
counts
The work counters of records, summed per name; an overflow is an error.
manifest
The result manifest run.json of the attempt in dir, built from its journal and its artifacts. With complete false, the work is not fully accounted for: work is null and only known_work_lower_bound is given.
objectives_agree
Whether objective values a and b agree within BOUND_TOLERANCE.
progress
The progress of a running attempt: its completed tasks, its known work and its artifact index.
repair
Replays the journal of the attempt in dir, then ends a torn final line: a valid record gets its newline, anything else is removed. An invalid earlier record is an error, and the journal stays unchanged.
replay
The result journal of the attempt in dir, ordered by task_id; empty without a journal. Each record must have a task ID below task_count and not seen before, the job’s digest, a finite nonnegative time, safe counter names and an outcome that passes Outcome::check. An incomplete final line is ignored; any other invalid record is an error.
unreadable_manifest
The manifest of an attempt whose journal cannot be replayed (a corrupt or invalid record before its final line). No record is trusted, so there are no results and no work totals; runner.journal_error says why.
worker_outcome
The status and elapsed time from the worker’s own run.json in dir, if it can be trusted: it belongs to this job, its accounting is complete, its status is terminal, and its results and work equal the journal’s. Otherwise None. A completed manifest without all tasks, or an invalid elapsed time, is an error.