Skip to main content

Recompute this yourself

Every published-results document ends with a recompute appendix: the fingerprint of each input, the seeds, and the exact public API calls that produced its numbers. This page replays that appendix against the project the numbers were judged on and checks that it gives back the same document.

You need the document (published_results.json), an API key for the project it names, and a checkout of this repository with tools/doctest installed. The command reads TESSERA_API_BASE and TESSERA_API_KEY from the environment.

01-recompute-this-yourself.sh
#!/usr/bin/env bash
# Recompute this yourself: replay a published-results document's recompute
# appendix against the project its numbers were judged on.
#
# Every call in the appendix is repeated. The protocol must re-read with the
# cited fingerprint, every POST must name the cited report (report ids are
# derived from the request's content), every cited report must re-hash to the
# cited fingerprint byte for byte, every published number must be found in its
# report with exactly the published value, and the verdict must be the cited
# evaluation's, verbatim. Anything else is printed as NOT REPRODUCED with the
# JSON pointer of what failed, and the command exits 1.
set -euo pipefail

: "${TESSERA_API_BASE:?e.g. https://api.staging.tessera.zone/v1}"
: "${TESSERA_API_KEY:?the tsk_ key of the project the numbers were judged on}"
: "${TESSERA_PUBLISHED_RESULTS:?the published_results.json to check}"
: "${TESSERA_REPO_ROOT:?a checkout of the Tessera repository (for the schemas)}"

tessera-doctest recompute \
--document "$TESSERA_PUBLISHED_RESULTS" \
--repo-root "$TESSERA_REPO_ROOT"

Download playbooks/recompute/01-recompute-this-yourself.sh — this exact file runs in CI on every change (hosts shown are for this environment).

What is checked​

CheckPasses when
The callsEvery call in the appendix answers. Each POST names the report the document cites: report ids are derived from the request's content, so the same request on the same project names the same report.
The protocolThe protocol re-reads with the fingerprint the document cites.
The fingerprintsEvery cited report re-hashes to the cited fingerprint, byte for byte.
The numbersEvery number is found in its report with exactly the published value and interval.
The verdictThe document's verdict is the cited evaluation's verdict, unchanged.

Each check prints reproduced or NOT REPRODUCED with the JSON pointer of the part of the document it checked. Any miss makes the command exit 1. The POST calls repeat the original requests, so a replay creates nothing new; it is a safe retry.

The CI-executed playbooks run the same command on the documents they publish. This page's step needs a judged project, so CI lints it but does not run it on its own.