A gate that does not depend on its machine, on a runner of its own
Test / gate (push) Canceled after 0s

The gate first ran on the server that deploys the site: a slow container
with no C compiler and no ICU. Ten tests failed there on correct code,
and no Mojo program could be built at all.

- The workflows ask for a runner labeled heavy, not the deploy server:
  the gate builds and runs some 300 Mojo programs and fuzzes. docs/ci.md
  says how to register one. With none registered a run waits.
- The pinned environment has a C compiler on Linux (gcc, with its C
  library pinned to glibc 2.34): mojo build links with the C compiler it
  finds, and conda-forge's default links against a C library too old
  for Mojo's runtime. mojo-local reports a program that could not be
  linked as that, and does not keep the answer.
- The pinned Dafny runs without ICU, and dafny-fetch fails when the
  Dafny it fetched does not start.
- A test's time limit is processor time at the machine's pace
  (tests/helpers/pace.mjs).
- The prover's time on the clock is the caller's: provePseudo and
  Workspace.proofBudgetMs take it, the Prove tab's 3 seconds stay the
  default, and the command line, library-check and the tests use none,
  so their answers are the counted budgets' alone.
- The library pointer moves to its workflow change (e5ae090).
This commit is contained in:
alexm committed 2026-11-13 06:13:28 -05:00
1 parent 401084bab3
commit b10a5c87a3
31 files changed
+427 -104

No files matched your search

+6 -5
View File
@@ -26,6 +26,7 @@ import { verify } from '../dist/engines/pseudo/vcgen.js';
import { checkProperties } from '../dist/engines/pseudo/testing.js';
import { PROBLEMS } from '../dist/common/problems.js';
import { LESSONS, solutionOf } from '../dist/curriculum/index.js';
import { NO_CLOCK } from './helpers/pace.mjs';
const PROVER_DIR = 'library/pseudo/prover';
const CORPUS_DIR = 'library/pseudo/programs';
@@ -65,7 +66,7 @@ function unsoundIn(src) {
const st = studyOf(src);
if (!st.ok) return { parsed: false, bad: [], proved: [] };
const program = st.program.program;
const r = verify(program, { budgetMs: 3000 });
const r = verify(program, NO_CLOCK);
const proved = r.units.filter((u) => !u.partial).flatMap((u) => u.obligations.filter((o) => o.status === 'proved'));
const failures = [];
for (const sub of program.subs.values()) {
@@ -98,7 +99,7 @@ test('regression programs: an obligation an unsound rule once proved is never pr
}
const st = studyOf(src);
assert.ok(st.ok, `${f} does not parse`);
const r = verify(st.program.program, { budgetMs: 3000 });
const r = verify(st.program.program, NO_CLOCK);
const all = r.units.flatMap((u) => u.obligations);
for (const m of marks) {
const o = all.filter((x) => x.kind === m.kind && x.line === m.line);
@@ -160,7 +161,7 @@ test('canary: after a program that runs to its end, ASSERT 1 == 2 is never prove
const line = lines.length + 1;
const withCanary = studyOf(`${lines.join('\n')}\nASSERT 1 == 2\n`);
if (!withCanary.ok) continue;
const r = verify(withCanary.program.program, { budgetMs: 3000 });
const r = verify(withCanary.program.program, NO_CLOCK);
const main = r.units.find((u) => u.kind === 'main');
const o = main?.obligations.find((x) => x.kind === 'assert' && x.line === line);
if (!o) continue;
@@ -174,7 +175,7 @@ test('canary: after a program that runs to its end, ASSERT 1 == 2 is never prove
test('a FUNCTION that RETURNS an ARRAY of written lengths hands back those lengths: known at the call, and checked in the run', () => {
// known at the call: the store into G has nothing left to prove (15-game-of-life showed it open)
const life = fs.readFileSync(path.join(CORPUS_DIR, '15-game-of-life.pseudo'), 'utf8');
const r = verify(studyOf(life).program.program, { budgetMs: 3000 });
const r = verify(studyOf(life).program.program, NO_CLOCK);
assert.deepEqual(r.units.flatMap((u) => u.obligations).filter((o) => o.status !== 'proved').map((o) => `${o.kind}@${o.line} ${o.label}`), []);
// and the fact is one a run keeps: a function that would hand back another length stops at its RETURN
const wrong = 'FUNCTION Two(N : INTEGER) RETURNS ARRAY[2] OF INTEGER\n DECLARE L : LIST OF INTEGER\n FOR I <- 0 TO N\n APPEND(L, I)\n NEXT I\n RETURN L\nENDFUNCTION\nDECLARE A : ARRAY[2] OF INTEGER\nA <- Two(3)\nASSERT LENGTH(A) == 2\n';
@@ -182,6 +183,6 @@ test('a FUNCTION that RETURNS an ARRAY of written lengths hands back those lengt
assert.ok(st.ok, st.diagnostics.map((d) => d.message).join('; '));
const run = runPseudo(st, {});
assert.equal(`${run.error?.kind}@${run.error?.line}`, 'value@6', run.error?.message);
const obs = verify(st.program.program, { budgetMs: 3000 }).units.flatMap((u) => u.obligations);
const obs = verify(st.program.program, NO_CLOCK).units.flatMap((u) => u.obligations);
assert.ok(obs.some((o) => o.line === 6 && o.status !== 'proved'), 'the RETURN of a list of unknown length is not proved to have 2 positions');
});