|
1 | 1 | #!/usr/bin/env bash |
2 | | -# scripts/check_vm_parity.sh — VM-backend parity probe (ADR-0070 / D-196). |
| 2 | +# scripts/check_vm_parity.sh — NON-DEFAULT-backend e2e sweep (D-553; was the |
| 3 | +# ADR-0070 / D-196 VM-parity probe). |
3 | 4 | # |
4 | | -# Builds cljw with `-Dbackend=vm` (ReleaseSafe) and runs the clj-grounded |
5 | | -# corpus + the (now-empty) D-196 VM-parity-blocker e2e list against it. |
| 5 | +# Builds cljw with `-Dbackend=tree_walk` (the F-012 differential-oracle |
| 6 | +# backend; `vm` is the production default since ADR-0070 step 4) and runs the |
| 7 | +# corpus + the FULL test/e2e suite against it — so an oracle-only e2e / |
| 8 | +# rendering regression cannot hide behind the vm-default gate. |
6 | 9 | # |
7 | | -# HISTORY: this probe existed to stop VM gaps being MASKED by the (then) |
8 | | -# tree_walk default — the per-commit gate ran e2e on tree_walk only. ALL 5 |
9 | | -# D-196 blockers closed 2026-06-02, and **build.zig's default flipped to `vm`** |
10 | | -# (ADR-0070 step 4 / F-012). Post-flip the per-commit gate runs e2e on vm (the |
11 | | -# production default), so the masking concern this probe guarded is resolved. |
| 10 | +# Cadence: on-demand / Phase boundaries (ADR-0049 per-commit-cost concern), |
| 11 | +# NEVER per-commit. Runtime ≈ one serial e2e pass (~5 min). |
12 | 12 | # |
13 | | -# CURRENT ROLE (on-demand): a `-Dbackend=vm` ReleaseSafe + corpus smoke. The |
14 | | -# BLOCKERS list is empty (kept as the re-add point should a future VM-only |
15 | | -# regression need tracking). FOLLOW-UP (tracked): repurpose to exercise the |
16 | | -# e2e suite on the NON-default backend (`tree-walk`, the differential oracle) |
17 | | -# so an oracle-only e2e/rendering regression can't hide behind the vm-default |
18 | | -# gate — run on-demand / at Phase boundaries per ADR-0049's per-commit-cost |
19 | | -# concern, not as a per-commit gate. |
| 13 | +# SKIPS lists e2e steps that intrinsically exercise the DEFAULT backend |
| 14 | +# (AOT bytecode / build pipeline) and are meaningless or false-failing on |
| 15 | +# tree-walk; each entry carries its reason. A newly-failing step NOT in |
| 16 | +# SKIPS is a genuine tree-walk regression — fix it, don't add it here |
| 17 | +# without a reason. |
| 18 | +# |
| 19 | +# HISTORY: the D-196 blocker era (VM gaps masked by the then-tree_walk |
| 20 | +# default) closed 2026-06-02; build.zig's default flipped to vm. This script |
| 21 | +# then idled as a corpus-only probe until the D-553 repurpose (2026-07-06). |
20 | 22 | # |
21 | 23 | # Restores the DEFAULT (vm ReleaseSafe wasm — the unified gate config) |
22 | 24 | # binary on exit. |
|
25 | 27 | set -uo pipefail |
26 | 28 | cd "$(dirname "$0")/.." |
27 | 29 |
|
28 | | -# D-196 blocker e2e (basename under test/e2e/, minus .sh). Prune as gaps close. |
29 | | -BLOCKERS=( |
30 | | - # ALL D-196 blockers CLOSED 2026-06-02 — the list is empty; the probe now |
31 | | - # verifies the corpus + (the absence of) regressions on -Dbackend=vm. Per |
32 | | - # ADR-0070 step 4 the next cycle flips build.zig default to vm and promotes |
33 | | - # this probe to a hard per-commit gate. |
34 | | - # phase14_ns_directive CLOSED 2026-06-02 (D-098): op_ns_with_filter + |
35 | | - # ns_filters side-table + emitLibspec loop. Pruned. |
36 | | - # phase14_java_static_dispatch CLOSED 2026-06-02 (D-196 blocker 3): the |
37 | | - # java-surface ctor `(java.io.File. …)` now resolves on the VM via the |
38 | | - # shared special_forms.constructInstance (was deftype-only). Pruned. |
39 | | - # phase14_catch_keyword CLOSED 2026-06-02 (D-014b VM lowering): |
40 | | - # op_match_type_keyword parallels op_match_class. Pruned. |
41 | | - # phase14_with_context + phase14_user_throw CLOSED 2026-06-02 (ADR-0071): |
42 | | - # the cleanup-handler kind (op_push_cleanup / op_reraise) preserves the |
43 | | - # dynamic error-context + catalog Kind through a binding / bare-try |
44 | | - # unwind, matching TreeWalk's `defer`. Pruned from the blocker list. |
45 | | - # NOTE: phase14_eval is NOT a VM blocker — `eval` is unimplemented on BOTH |
46 | | - # backends (name_error), tracked separately as D-197. Do not add here. |
| 30 | +# e2e basenames (minus .sh) that are DEFAULT-BACKEND-specific by design. |
| 31 | +SKIPS=( |
| 32 | + # (populated empirically; empty = the whole suite is backend-neutral) |
47 | 33 | ) |
48 | 34 |
|
49 | 35 | restore() { zig build -Dwasm -Doptimize=ReleaseSafe >/dev/null 2>&1 || true; } |
50 | 36 | trap restore EXIT |
51 | 37 |
|
52 | | -echo "check_vm_parity: building -Dbackend=vm -Doptimize=ReleaseSafe…" |
53 | | -if ! zig build -Dwasm -Doptimize=ReleaseSafe -Dbackend=vm >/tmp/vmp_build.txt 2>&1; then |
54 | | - echo "check_vm_parity: VM BUILD FAILED (see /tmp/vmp_build.txt)"; exit 1 |
| 38 | +echo "check_vm_parity: building -Dbackend=tree_walk -Doptimize=ReleaseSafe…" |
| 39 | +if ! zig build -Dwasm -Doptimize=ReleaseSafe -Dbackend=tree_walk >/tmp/vmp_build.txt 2>&1; then |
| 40 | + echo "check_vm_parity: tree-walk BUILD FAILED (see /tmp/vmp_build.txt)"; exit 1 |
55 | 41 | fi |
56 | 42 | export CLJW_SKIP_BUILD=1 |
57 | 43 |
|
58 | 44 | fails=0 |
59 | 45 | if bash scripts/check_corpus_regression.sh >/tmp/vmp_corpus.txt 2>&1; then |
60 | | - echo " corpus : ok ($(tail -1 /tmp/vmp_corpus.txt))" |
| 46 | + echo " corpus : ok ($(tail -1 /tmp/vmp_corpus.txt))" |
61 | 47 | else |
62 | | - echo " corpus : FAIL ($(tail -1 /tmp/vmp_corpus.txt))"; fails=$((fails + 1)) |
| 48 | + echo " corpus : FAIL ($(tail -1 /tmp/vmp_corpus.txt))"; fails=$((fails + 1)) |
63 | 49 | fi |
64 | 50 |
|
65 | | -for name in "${BLOCKERS[@]}"; do |
66 | | - t="test/e2e/$name.sh" |
67 | | - [ -f "$t" ] || { echo " MISSING : $name"; continue; } |
68 | | - if timeout 120 bash "$t" >/tmp/vmp_e2e.txt 2>&1; then |
69 | | - echo " CLOSED : $name (passes on VM — prune from BLOCKERS)" |
| 51 | +is_skipped() { |
| 52 | + local n="$1" |
| 53 | + for s in "${SKIPS[@]:-}"; do [ "$s" = "$n" ] && return 0; done |
| 54 | + return 1 |
| 55 | +} |
| 56 | + |
| 57 | +for t in test/e2e/*.sh; do |
| 58 | + name="$(basename "$t" .sh)" |
| 59 | + if is_skipped "$name"; then |
| 60 | + echo " SKIP (default-backend) : $name" |
| 61 | + continue |
| 62 | + fi |
| 63 | + if timeout 180 bash "$t" >/tmp/vmp_e2e.txt 2>&1; then |
| 64 | + : # green — stay quiet (the suite is ~250 steps) |
70 | 65 | else |
71 | | - echo " blocker : $name ($(grep -iE 'FAIL|NotImplemented' /tmp/vmp_e2e.txt | head -1 | cut -c1-80))" |
| 66 | + echo " FAIL on tree-walk : $name ($(grep -iE 'FAIL|error' /tmp/vmp_e2e.txt | head -1 | cut -c1-100))" |
72 | 67 | fails=$((fails + 1)) |
73 | 68 | fi |
74 | 69 | done |
75 | 70 |
|
76 | | -echo "check_vm_parity: $fails failing group(s) over corpus + ${#BLOCKERS[@]} D-196 blockers on -Dbackend=vm" |
| 71 | +echo "check_vm_parity: $fails failing group(s) (corpus + full e2e) on -Dbackend=tree_walk" |
77 | 72 | exit "$fails" |
0 commit comments