readback_check.py

back to table · edit · history · where entries came from · files · download

961 bytes, as of the version from 2026-12-02 03:42 (current). Recorded here, not run.

import json,sys
from generate import PinsonWinding
from build_check import check_records,matches,records_of
import numberdb.sage as numberdb
numberdb.configure(api_key=sys.stdin.read().strip())
g=PinsonWinding()
verification=g.verify(sample=None)
print('VERIFY_REPORT '+json.dumps({'checked':verification.checked,'matched':verification.matched,'ok':verification.ok,'missing':verification.missing,'differing':verification.differing,'coarser':verification.coarser}),flush=True)
assert verification.ok and verification.checked==75 and verification.matched==75
stored=numberdb.table(g.table)
rows=records_of(stored)
for row in rows:
    assert matches(row['number'],g.value(row['params'],100))
result=check_records(rows)
result['table']=g.table
result['production_contained_in_every_stored_interval']=True
print('STORED_CHECKS '+json.dumps(result),flush=True)
assert not result['failures'] and result['known_answer_control'] and result['negative_control_rejected']