# pplus-core — every command a person runs, in one place. # # pixi run [args] list them all: `pixi task list` # # The README's "Commands" table lists every task here; tests/tasks.test.mjs # keeps the two in step. Without pixi, `npm install && npm test` builds and # tests core with whatever node and python3 are on the PATH; CI runs # `pixi run ci` in the pinned environment below (docs/ci.md). [workspace] authors = ["Alex Maldonado "] channels = ["https://conda.modular.com/max/", "conda-forge"] name = "pplus-core" platforms = ["linux-64", "osx-arm64"] license = "Apache-2.0" license-file = "LICENSE.md" version = "0.2.0" [dependencies] mojo = "==1.2.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) # A C compiler, as `cc` and `gcc`: the Mojo compiler has the C compiler it finds link every program, library-check # builds the C references with it, and one test builds a C harness. CI's image has none (docs/ci.md). Mojo's runtime # libraries need glibc 2.34, so the C library the compiler links against is pinned to that and not conda-forge's # default, 2.28, against which no Mojo program links. On macOS the compiler is the system's. [target.linux-64.dependencies] gcc = ">=16.2.0,<16.3" sysroot_linux-64 = ">=2.34,<2.35" [tasks] # --- build and test -------------------------------------------------------- install = { cmd = "npm install", inputs = ["package.json"], outputs = ["node_modules/.package-lock.json"], description = "Install TypeScript (the only npm dependency)" } build = { cmd = "npx tsc -p tsconfig.json", depends-on = ["install"], description = "Compile src/ to dist/, with type declarations for pplus-web" } 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 --test-concurrency=8 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 : core without a browser, e.g. pixi run cli prove library/pseudo/programs/27-quantifiers.pseudo" } prove-fuzz = { cmd = "node scripts/prove-fuzz.mjs", depends-on = ["build"], description = "Fuzz the prover: random procedures with contracts are proved, then run; a proved obligation a run breaks is a finding, e.g. pixi run prove-fuzz --seed 7 --programs 500 (docs/ci.md)" } 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)" } # --- Dafny, pinned (scripts/dafny.py) --------------------------------------- dafny-fetch = { cmd = "python scripts/dafny.py fetch", description = "Download the pinned Dafny into .tools/, checked by SHA-256 (network, once)" } dafny = { cmd = "python scripts/dafny.py", description = "Run the pinned Dafny with the arguments given, e.g. pixi run dafny verify file.dfy (fetches it first if missing)" } # --- the library (library/, the pplus-library submodule; docs/library.md) --- library-check = { cmd = "node scripts/library.mjs check", depends-on = ["build"], description = "Check every library routine at every level (cases, prover, fuzzer, generated Mojo, every reference, the Dafny proof); writes library/status.json and STATUS.md" } library-emit = { cmd = "node scripts/library.mjs emit", depends-on = ["build"], description = "Regenerate src/library/generated.ts, the registry USE reads, from library/" } library-verify-mojo = { cmd = "node scripts/library.mjs mojo-sources | python scripts/library_godbolt.py", depends-on = ["build"], description = "Ask the pinned Mojo compiler about every Mojo reference of the library and store the answers (network)" } 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" } library-harness-input = { cmd = "node scripts/library.mjs harness {{ id }} {{ lang }} {{ level }} --input", args = ["id", "lang", "level"], depends-on = ["build"], description = "Print the line of stdin a C or Mojo reference's program reads: every case's arguments, e.g. pixi run library-harness-input md.LennardJones mojo multiply" } # --- write content --------------------------------------------------------- new-exercise = { cmd = "node scripts/new-exercise.mjs {{ id }}", args = ["id"], description = "Start an exercise: library/mojo/local/.mojo and src/exercises/.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/.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/.mojo: realistic Mojo that tests the interpreter" } play = { cmd = "node scripts/play.mjs {{ name }}", args = ["name"], depends-on = ["install"], description = "For library/mojo/local/.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) --------------------------------- mojo-verify = { cmd = "python scripts/mojo/corpus.py verify", description = "Ask godbolt about every program with no answer yet (network)" } 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 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-prune = { cmd = "python scripts/mojo/corpus.py prune", description = "Remove stored answers nothing reads any more: those of a compiler other than the pin, and those of programs since edited or removed (git keeps them)" } 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 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 only, no network" } 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 = "python scripts/mojo/corpus.py mojo-run {{ file }}", args = ["file"], description = "Run one Mojo file on the pinned local compiler, built with the pin's build arguments and then the file's own, e.g. library/mojo/probes/int-floordiv.mojo" } mojo-local = { cmd = "node scripts/mojo/local.mjs", depends-on = ["build"], description = "Build every Mojo program core holds or generates on the pinned local compiler and hold the checker, the interpreter and the translator to it (no network)" } mojo-fuzz = { cmd = "node scripts/mojo/fuzz.mjs", depends-on = ["build"], description = "Fuzz the pseudo-to-Mojo translator, the checker and the interpreter against the pinned local compiler with generated programs, e.g. pixi run mojo-fuzz --seed 7 --programs 50 (expressions) or pixi run mojo-fuzz --statements --seed 7 (whole programs)" } mojo-probes-local = { cmd = "for f in library/mojo/probes/*.mojo; do echo \"== $f\"; python scripts/mojo/corpus.py 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", "library-check", "mojo-local", "ci-fuzz"], description = "What CI runs on every push: every test, no program of ours failing, every library routine checked, every Mojo program built by the pinned compiler, and a short fuzz (docs/ci.md)" } ci-fuzz = { cmd = "node scripts/ci-fuzz.mjs", depends-on = ["build"], description = "The fuzzers' share of ci: mojo-fuzz and prove-fuzz on seed 1 and on a seed that moves with the CI run number or the date, each printed (docs/ci.md)" } nightly = { cmd = "node scripts/ci-fuzz.mjs --nightly", depends-on = ["build", "mojo-status-strict"], description = "What the scheduled CI runs: mojo-status-strict, then mojo-fuzz and prove-fuzz longer, on four seeds that move with the date (docs/ci.md)" } package = { cmd = "python scripts/package.py", description = "Zip the files git tracks (and new ones it does not ignore) into package/ for sharing" }