Commit 38c4e4f
test(faces): prove a Python-face program runs end-to-end (face → wasm → result)
The README's headline is "faces are the product" — a program in a familiar
surface, elaborated to the affine core, compiled to wasm. That path had never
been exercised as *running code*, only parsed. This proves it:
- test/e2e/fixtures/python_face_runnable.pyaff — Python-shaped source
(`def`, `if/else`, recursion), `# face: python` pragma.
- test/e2e/python_face_e2e.sh — compiles it THROUGH the Python face to
core-WASM and asserts main() === 5170 (fac(5)=120 + sum_to(100)=5050).
Skips loudly (exit 0) without the compiler or node; AFFINESCRIPT_BIN
overrides the binary path.
Observed (node 26, dune 3.24 build):
Compiled fixtures/python_face_runnable.pyaff -> pf.wasm (WASM)
main() = 5170 (expected 5170)
PASS: Python-face program ran end-to-end (face -> wasm -> correct result)
Recursion, not a loop, on purpose: proving the face path surfaced two real
bugs, filed with minimal repros:
- #683 — the Python face drops the trailing `;` on the last statement of a
while/for body (tail-position detection doesn't distinguish loop bodies
from value bodies), so face-authored loops don't yet compile. Recursion's
tail line is a value expression, which the face handles correctly.
- #682 — `total` is rejected as a variable name in let-binding / assignment
position (the `TOTAL` soft-keyword's ident-recovery is incomplete). The
fixture avoids that name.
So this is an honest end-to-end proof of the face→wasm path today, and a
regression lock, with the known loop gap tracked in #683.
Gates: dune build 0; face e2e PASS; doc-truthing OK; soundness ledger all-5 OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4a6a31f commit 38c4e4f
2 files changed
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments