feat: move corpus to library
Test / test (push) Failing after 1m38s

This commit is contained in:
alexm committed 2026-10-06 10:27:46 -04:00
1 parent 5b8b079165
commit cae5cff55a
1350 files changed
+197 -941995

No files matched your search

+15 -15
View File
@@ -15,9 +15,9 @@ platforms = ["linux-64", "osx-arm64"]
version = "0.2.0"
[dependencies]
mojo = "==1.1.0" # the compiler the corpus is pinned to (mojo/pin.json)
nodejs = ">=26.10.0,<26.11" # the build and tests; the quest processor needs >= 22.6
python = ">=3.14.7,<3.15" # the corpus pipeline and the Dafny pin (standard library only)
mojo = "==1.1.0" # the compiler the corpus is pinned to (library/mojo/pin.json)
nodejs = ">=26.10.0,<26.11" # the build and tests; the quest processor needs >= 22.6
python = ">=3.14.7,<3.15" # the corpus pipeline and the Dafny pin (standard library only)
[tasks]
# --- build and test --------------------------------------------------------
@@ -26,7 +26,7 @@ build = { cmd = "npx tsc -p tsconfig.json", depends-on = ["install"], descriptio
watch = { cmd = "npx tsc -p tsconfig.json --watch", depends-on = ["install"], description = "Rebuild dist/ on every change" }
check = { cmd = "npx tsc -p tsconfig.json --noEmit", depends-on = ["install"], description = "Type-check only" }
test = { cmd = "node --test tests/*.test.mjs", depends-on = ["build"], description = "Build, then run every test (the corpus pipeline's and the Dafny pin's Python tests included)" }
cli = { cmd = "node scripts/cli.mjs", depends-on = ["build"], description = "pplus check|run|prove|fuzz|translate <file>: core without a browser, e.g. pixi run cli prove tests/corpus/27-quantifiers.pseudo" }
cli = { cmd = "node scripts/cli.mjs", depends-on = ["build"], description = "pplus check|run|prove|fuzz|translate <file>: core without a browser, e.g. pixi run cli prove library/pseudo/programs/27-quantifiers.pseudo" }
engines-diff = { cmd = "node scripts/engines-diff.mjs {{ static }}", args = ["static"], depends-on = ["build"], description = "Show what a course checkout's static/ directory has not taken yet from src/engines/ (docs/engines.md)" }
engines-export = { cmd = "node scripts/engines-export.mjs {{ static }}", args = ["static"], depends-on = ["build"], description = "Copy the engines into a course checkout's static/js/, TypeScript modules as built (docs/engines.md)" }
@@ -41,10 +41,10 @@ library-verify-mojo = { cmd = "node scripts/library.mjs mojo-sources | python sc
library-harness = { cmd = "node scripts/library.mjs harness {{ id }} {{ lang }} {{ level }}", args = ["id", "lang", "level"], depends-on = ["build"], description = "Print the program a reference implementation is run as, e.g. pixi run library-harness md.LennardJones c multiply" }
# --- write content ---------------------------------------------------------
new-exercise = { cmd = "node scripts/new-exercise.mjs {{ id }}", args = ["id"], description = "Start an exercise: mojo/local/<id>.mojo and src/exercises/<id>.ts, registered in index.ts" }
new-probe = { cmd = "node scripts/mojo/new-program.mjs probe {{ name }} \"{{ question }}\"", args = ["name", "question"], description = "Start mojo/probes/<name>.mojo: one question about the pinned compiler" }
new-stress = { cmd = "node scripts/mojo/new-program.mjs stress {{ name }} \"{{ about }}\"", args = ["name", "about"], description = "Start mojo/stress/<name>.mojo: realistic Mojo that tests the interpreter" }
play = { cmd = "node scripts/play.mjs {{ name }}", args = ["name"], depends-on = ["install"], description = "For mojo/local/<name>.mojo: run, verify on godbolt, build, list the assembly, test" }
new-exercise = { cmd = "node scripts/new-exercise.mjs {{ id }}", args = ["id"], description = "Start an exercise: library/mojo/local/<id>.mojo and src/exercises/<id>.ts, registered in index.ts" }
new-probe = { cmd = "node scripts/mojo/new-program.mjs probe {{ name }} \"{{ question }}\"", args = ["name", "question"], description = "Start library/mojo/probes/<name>.mojo: one question about the pinned compiler" }
new-stress = { cmd = "node scripts/mojo/new-program.mjs stress {{ name }} \"{{ about }}\"", args = ["name", "about"], description = "Start library/mojo/stress/<name>.mojo: realistic Mojo that tests the interpreter" }
play = { cmd = "node scripts/play.mjs {{ name }}", args = ["name"], depends-on = ["install"], description = "For library/mojo/local/<name>.mojo: run, verify on godbolt, build, list the assembly, test" }
play-watch = { cmd = "node scripts/play.mjs {{ name }} --watch", args = ["name"], depends-on = ["install"], description = "The same, again on every save (tests off)" }
# --- the Mojo corpus (docs/mojo-corpus.md) ---------------------------------
@@ -52,17 +52,17 @@ mojo-verify = { cmd = "python scripts/mojo/corpus.py verify", description = "Ask
mojo-verify-item = { cmd = "python scripts/mojo/corpus.py verify --force --item '{{ id }}'", args = ["id"], description = "Ask again about one item; a trailing * matches a prefix, e.g. 'probes/life-*' (network)" }
mojo-verify-dry = { cmd = "python scripts/mojo/corpus.py verify --dry-run", description = "Show what mojo-verify would send; send nothing" }
mojo-verify-diagnostics = { cmd = "python scripts/mojo/corpus.py verify --corpus diagnostics", description = "Also check the compiler's own diagnostic tests (opt-in, about 140 files; network)" }
mojo-status = { cmd = "python scripts/mojo/corpus.py status", description = "Judge every item from the stored answers, offline; writes mojo/golden/STATUS.md" }
mojo-status = { cmd = "python scripts/mojo/corpus.py status", description = "Judge every item from the stored answers, offline; writes library/mojo/golden/STATUS.md" }
mojo-status-strict = { cmd = "python scripts/mojo/corpus.py status --strict", description = "The same, and fail if a program we wrote (probes, local, stress) fails" }
mojo-harvest = { cmd = "python scripts/mojo/corpus.py harvest", description = "After editing mojo/pin.json: fetch Modular's sources, process them, regenerate src/mojo/generated/ and syntax/ (network)" }
mojo-harvest = { cmd = "python scripts/mojo/corpus.py harvest", description = "After editing library/mojo/pin.json: fetch Modular's sources, process them, regenerate src/mojo/generated/ and syntax/ (network)" }
mojo-harvest-local = { cmd = "python scripts/mojo/corpus.py harvest --local-dir {{ dir }}", args = [{ arg = "dir", default = "zips" }], description = "Harvest, using zips in <dir> for sources the pin leaves UNRESOLVED" }
mojo-harvest-offline = { cmd = "python scripts/mojo/corpus.py harvest --local-dir {{ dir }} --offline", args = [{ arg = "dir", default = "zips" }], description = "Harvest from zips in <dir> only, no network" }
mojo-fetch = { cmd = "python scripts/mojo/corpus.py fetch --update", description = "Re-resolve every ref in the pin and rewrite mojo/mojo.lock.json (network)" }
mojo-emit = { cmd = "python scripts/mojo/corpus.py emit", description = "Regenerate src/mojo/generated/ and syntax/mojo.xml from the pin and the corpus, offline" }
mojo-fetch = { cmd = "python scripts/mojo/corpus.py fetch --update", description = "Re-resolve every ref in the pin and rewrite library/mojo/mojo.lock.json (network)" }
mojo-emit = { cmd = "python scripts/mojo/corpus.py emit", description = "Regenerate src/mojo/generated/ and library/syntax/mojo.xml from the pin and the corpus, offline" }
mojo-test = { cmd = "python -m unittest discover -s scripts/mojo/tests", description = "The corpus pipeline's own tests (also run by test)" }
mojo-run = { cmd = "mojo run {{ file }}", args = ["file"], description = "Run one Mojo file on the pinned local compiler, e.g. mojo/probes/int-floordiv.mojo" }
mojo-probes-local = { cmd = "for f in mojo/probes/*.mojo; do echo \"== $f\"; mojo run \"$f\" < /dev/null; echo \"exit $?\"; done", description = "Run every probe on the local compiler (a quick look; godbolt's answers stay the reference)" }
mojo-update = { depends-on = ["mojo-harvest", "mojo-verify", "mojo-status", "test"], description = "After editing mojo/pin.json: harvest, verify, status, test" }
mojo-run = { cmd = "mojo run {{ file }}", args = ["file"], description = "Run one Mojo file on the pinned local compiler, e.g. library/mojo/probes/int-floordiv.mojo" }
mojo-probes-local = { cmd = "for f in library/mojo/probes/*.mojo; do echo \"== $f\"; mojo run \"$f\" < /dev/null; echo \"exit $?\"; done", description = "Run every probe on the local compiler (a quick look; godbolt's answers stay the reference)" }
mojo-update = { depends-on = ["mojo-harvest", "mojo-verify", "mojo-status", "test"], description = "After editing library/mojo/pin.json: harvest, verify, status, test" }
# --- ship ------------------------------------------------------------------
ci = { depends-on = ["test", "mojo-status-strict"], description = "What CI runs: every test (the library's registry up to date among them), and no program of ours failing" }