A proof's time limit is the reader's to set
Build, test, deploy / site (push) Successful in 7m44s

The Prove view gives each routine 3 seconds on the clock. On a slow or
busy device that runs out before the proof does, and claims stay open
with nothing to say why.

- The view says when the time, not the proof, stopped the checker, that
  what was not finished is open and not disproved, and offers to prove
  again with the next longer time. The setting is at the foot of the
  view: 3, 10 or 30 seconds or 2 minutes for each routine, kept in the
  browser (pplus.proveclock).
- A proof rendered with Quarto takes prove-seconds on the shortcode or
  pplus-prove-seconds for the site, and the render warns when the time
  ran out.
- The home page's own example is proved with no time on the clock, and
  the tests that hold a proof's outcome give it time to spare, so
  neither depends on the machine.
- core moves to 38e6e2c, whose report says which routines the clock
  stopped.
This commit is contained in:
alexm committed 2026-11-13 07:01:35 -05:00
1 parent d1955ad358
commit 7000662539
19 files changed
+240 -6

No files matched your search

+11 -2
View File
@@ -72,6 +72,8 @@ export interface RenderRequest {
/** hw: false leaves out the x86-64 listing; stepper false draws only the step `t`. */
listing?: boolean;
stepper?: boolean;
/** proof: the seconds on the clock the prover has for each routine (default 3, the app's own). */
proveSeconds?: number;
/** A run of the Mojo file by a real compiler (render.mjs does it when `mojo` is on the PATH). */
compiled?: { stdout: string; stderr: string; status: number | null; version: string } | null;
}
@@ -130,7 +132,10 @@ function prepare(req: RenderRequest): Prepared {
if (req.machine) state.machine = req.machine;
if (typeof req.t === 'number' && req.t >= 0) state.t = Math.floor(req.t);
if (req.title) state.title = req.title;
return { session: new Session(state), header, given, sources };
const session = new Session(state);
// a page is rendered once, on whatever machine builds the site: its author may give a proof more than the app's 3 seconds
if (typeof req.proveSeconds === 'number' && req.proveSeconds > 0) session.proofBudgetMs = Math.round(req.proveSeconds * 1000);
return { session, header, given, sources };
}
/* ------------------------------------------------------------------ */
@@ -423,7 +428,11 @@ function proofOf(p: Prepared): RenderResult {
const node = appView((h) => proofView(session, h, noHooks), 'view-proof');
const pr = session.proof();
const md = pr ? [`**${pr.report.counts.proved} proved, ${pr.report.counts.broken} broken, ${pr.report.counts.open} open.**`, '', ...pr.report.units.flatMap((u) => u.obligations.map((o) => `- ${o.status}: ${o.label} (line ${(o as any).specoLine ?? (o as any).pseudoLine ?? o.line})`))].join('\n') : '*The proof needs pseudocode that parses.*';
return result('proof', 'pseudo', node, md, pr && pr.report.counts.broken ? [`proof: ${pr.report.counts.broken} claim(s) broken`] : []);
const warnings = pr && pr.report.counts.broken ? [`proof: ${pr.report.counts.broken} claim(s) broken`] : [];
// the machine that renders the page was too slow for the clock: the page would show claims open that are provable
const stopped = pr?.report.clock?.stopped ?? [];
if (stopped.length) warnings.push(`proof: time ran out on ${stopped.join(', ')} (${session.proofClock() / 1000} s for each routine): give it more with prove-seconds on the shortcode, or pplus-prove-seconds for the site`);
return result('proof', 'pseudo', node, md, warnings);
}
function testsOf(p: Prepared): RenderResult {