A type-aware audit (~190 collection expressions vs reference Clojure) found four divergences the corpus missed — value-equality (= [0 1] '(0 1)) hides type and laziness differences. Fixed, with type-predicate + over-infinite corpus rows that pin them. - partition-all [n coll] built vector chunks; JVM chunks are seqs. (The [n step coll] arity was already correct, as is the partition-all transducer, whose chunks are vectors in JVM too.) Now builds seq chunks. - replace always returned a vector (mapv) and was eager; JVM is type-preserving — a vector maps to a vector, any other seqable to a lazy seq. - sequence eagerly realized its source (into-xform), so (first (sequence (map inc) (range))) hung. Rewrote as a transformer iterator: pull one input at a time, buffer the step outputs, emit lazily, run the completion to flush a stateful xform. eduction builds on it (lazy, no longer an eager vector). - mapcat and (apply concat coll-of-colls) hung over an infinite source because jolt-apply seq->lists the trailing arg and mapcat seq->lists the map result. Added lazy-concat-seq (lazily flatten a seq of colls); mapcat uses it directly, and apply special-cases concat (its result is lazy) to route through it. Docs: a cross-cutting return-type + laziness contract in docs/spec/09-core-library; SPEC.md notes that = masks type/laziness so they need predicate / over-infinite rows. EBNF is reader syntax only — unaffected. Seed change (partition-all/replace/eduction are clojure.core overlay) -> re-mint; selfhost holds. make test + shakesmoke + buildsmoke green, 0 new divergences. Co-authored-by: Yogthos <yogthos@gmail.com> |
||
|---|---|---|
| .. | ||
| build-app | ||
| bench-chez.ss | ||
| corpus.edn | ||
| directlink-test.ss | ||
| ffi-binding-test.ss | ||
| inline-test.ss | ||
| numeric-test.ss | ||
| README.md | ||
| transient-test.ss | ||
| unit.edn | ||
| values-test.ss | ||
Chez test harness
The correctness gate for jolt. Pure Chez (+ Clojure for the JVM oracle).
Correctness is judged against the JVM-sourced conformance spec; the spec itself
lives in test/conformance/ (see its SPEC.md). Run the whole gate with make test from the repo root.
The spec corpus
corpus.edn is the contract: ~2920 rows {:suite :label :expected :actual}, with
:expected sourced from reference JVM Clojure by test/conformance/regen-corpus.clj.
It is frozen (the canonical source) — add or change cases here, then re-source the
answers with regen-corpus.clj and re-certify with test/conformance/certify.clj.
The gate runners (host/chez/)
-
run-corpus.ss— runs every corpus case through the spine (read → analyze → IR → emit → eval, all on Chez), comparing each result by value-equality against the JVM:expected. Aknown-failallowlist 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.chez --script host/chez/run-corpus.ss JOLT_CORPUS_LIMIT=200 … # every-Nth stride, fast iteration JOLT_CHEZ_ZJ_FLOOR=N … # override the floor (default 2678) -
run-unit.ss— host-specific unit cases (test/chez/unit.edn) that aren't in the JVM-portable corpus: dot-forms, java statics, io, reader, walk, vars/namespaces, refs. Each:expris evaluated in-process and its printed value compared to a baked:expected(:throwsasserts a raise). -
selfcheck.sh— self-host fixpoint:bootstrap.ssrebuild byte-equals the checked-in seed (host/chez/seed/). -
smoke.sh— realbin/joltc -eCLI smoke.
Other Chez tests
values-test.ss— the value model (nil/truthiness/collections).make values.bench-chez.ss— compute bench through the pipeline (opt-in; not in the gate).
All runners assume chez on PATH.