jolt/test/chez
Yogthos 58d03d67be Delete the Janet host — Chez is the sole substrate
Remove the Janet seed (src/jolt/*.janet: reader, value layer, vars/ns, the
tree-walking interpreter, the Janet backend, the optimizing compiler), the
Janet->Scheme cross-compiler (host/chez/{driver,emit,jolt-chez}.janet),
bin/jolt-chez, the jpm build (project.janet) and the Janet test runner
(run-tests.janet), plus the entire Janet test suite. jolt now builds and runs
on Chez alone: bin/joltc off the checked-in seed, bootstrap.ss to rebuild it.

The portable Clojure stays: jolt-core/**, host/chez/**.ss, and the stdlib +
tooling under src/jolt/clojure + src/jolt/jolt (read by the seed build, no
Janet). The gate is 'make test' (self-host, corpus, unit, cli smoke, certify).
Drop the sci and clojure-test-suite submodules (used only by deleted Janet
integration tests); irregex stays.

Filesystem corpus/unit cases that probed project.janet now probe README.md.

jolt-cf1q.6
2026-06-21 11:29:03 -04:00
..
bench-chez.ss Chez Phase 4: perf probe (test/chez/bench-chez.ss) 2026-06-20 14:30:36 -04:00
corpus.edn Delete the Janet host — Chez is the sole substrate 2026-06-21 11:29:03 -04:00
README.md Move the Chez test oracle off Janet 2026-06-21 09:48:49 -04:00
unit.edn Delete the Janet host — Chez is the sole substrate 2026-06-21 11:29:03 -04:00
values-test.ss Chez Phase 0c + 0a hardening: collections decision + value-model fixes 2026-06-17 13:10:19 -04:00

Chez test harness

The correctness gate for jolt on Chez (epic jolt-cf1q). Correctness is judged against the JVM-sourced conformance spec — no Janet decides pass/fail. The spec itself lives in test/conformance/ (see its SPEC.md); this directory holds the Chez runners and unit tests.

The spec corpus

  • corpus.edn — the contract: ~2920 rows {:suite :label :expected :actual}, with :expected sourced from reference JVM Clojure. Valid as both EDN and Janet data. Generated by test/conformance/regen-corpus.clj (the answers) over the case list from extract-corpus.janet (the :actual strings, pulled from test/spec/*.janet and conformance-test.janet).
  • extract-corpus.janet — re-derives the case list when spec rows change. Writes only when JOLT_EXTRACT_CORPUS_OUT is set, so a gate run never clobbers the JVM-sourced corpus.edn. After re-deriving, re-source the answers with regen-corpus.clj.

The standing gate

run-corpus-zero-janet.janet runs every corpus case through the zero-Janet spine: read → analyze → IR → emit → eval, all on Chez (the analyzer is jolt.analyzer cross-compiled to Scheme over host-contract.ss). Each result is compared by value-equality against the JVM :expected. A known-fail allowlist covers cases jolt can't match because Chez has no JVM host (Java classes, arrays, BigDecimal, opaque host-object printers, …); the gate fails only on a NEW divergence or if the pass count drops below the floor.

JOLT_CHEZ_ZEROJANET_CORPUS=1 janet test/chez/run-corpus-zero-janet.janet
JOLT_CORPUS_LIMIT=200 …            # every-Nth stride, fast iteration

Floor: 2678 (JOLT_CHEZ_ZJ_FLOOR overrides). Raise it as host gaps close.

Unit tests

_*.janet drive bin/joltc (the pure-Chez CLI; JOLT_BIN overrides) one subprocess per case and compare the last stdout line against a baked expected value. :throws asserts a non-zero exit. Each file targets one area — _type/_class/_seqpred (taxonomy + predicates), _str/_strns/_reader (strings + reader), _io/_ioreader/_insttime/_javastatic (host interop), _dynbind/_var_meta/_ns (vars + namespaces), _atomwatch/_walk/_dotform /_stdlib (refs, walk, dot-forms, stdlib). Run one with janet test/chez/_type.janet.

Self-host gates

  • spine-test.janet — the zero-Janet compile/eval spine end to end.
  • cli-test.janetbin/joltc -e behavior.
  • bootstrap-test.janethost/chez/bootstrap.ss rebuilds the prelude + image from source on Chez and matches the checked-in seed (host/chez/seed/).
  • fixpoint-test.janet — the on-Chez compiler reproduces itself (stage2 == stage3, prelude pstage3 == pstage4).

Bench

bench-pipeline.janet (opt-in via JOLT_CHEZ_BENCH=1) times fib + mandelbrot through the real pipeline against the spike ceiling. Skipped in the gate.

All Chez runners skip cleanly when chez is not on PATH.