Contributing¶
Dev setup¶
postpile uses uv. A checkout is self-contained: postyp is temporarily vendored (see vendor/README.md for why, and for the retirement condition). Only the postpyc benchmark baseline still needs the sibling ../postpython checkout: opt in with uv pip install -e ../postpython.
System prerequisites (not pip-installable): a C compiler (cc/clang/gcc) and the qbe binary for the QBE backend.
The enforced gate¶
Ruff, three type-checkers (ty, zuban, pyrefly, with src at zero diagnostics under all three on 2026-08-05) and the differential test suite are the gate; mypy is advisory (the lifted compiler internals have pre-existing type debt under it).
make test # pytest
make lint # ruff check + format, ty, zuban, pyrefly (the enforced gate; ruff also runs in pre-commit)
make asan # the ASan memory suite (sees the over-releases the counters cannot)
make typecheck # mypy (advisory, never fails the build)
make docs # zensical build --strict
make refusal # the refusal-surface instrument (a measurement, not a gate)
Run a single tier with markers: uv run pytest -m unit (or integration, e2e).
Adding a golden program¶
The kernel corpus lives in tests/c_e2e/programs/. To add one:
- Drop a self-contained POST module of typed functions into
tests/c_e2e/programs/(the PROBES corpus is function-probed, so no top-level executable code there; whole scripts with top-level code are the other corpora below). - Add its probes (
(function, args)tuples) toPROBESintests/c_e2e/test_programs.py. The differential oracle then runs it under CPython and every backend and checks that they agree.
The whole corpus is also compiled on every available backend by the compile ratchet. See the testing guide.
The other corpora, for whole-script work: tests/c_e2e/test_p2w_corpus.py (the 104-program strict-xfail burn-down chart; promoting a program means moving its row), tests/c_e2e/test_pygo_corpus.py (the pygo concurrency corpus), and the whole-script e2e suites (test_flask.py, test_web_service.py, test_threaded_server.py, test_nbody.py).
Adding a backend¶
Implement the Backend protocol, register it (in-tree or via a postpile.backends entry point), and hold it to the differential suite. The full walkthrough is in Writing a backend.
Commit hygiene¶
pre-commit runs ruff (check + format) and a few generic hooks. Keep the diff scoped; the discipline is to lift proven code unchanged and rebuild only structure.