Supersedes the Option B (hybrid) decision. Records that the earlier Option A
attempt failed for lack of the boundary fixes (cons-cell leak, nth/next/rest
over lazy via seq-done?, coll->cells maps/sets + cell disambiguation, ~@ splice
+ normalize-pvecs realization), and that re-attempting with those fixes makes
Option A pass all gates (conformance 246x3, lazy-infinite 40/40). All
transformers lazy in 3 modes; interleave/reductions/tree-seq use letfn recursion
to avoid jolt-r81.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Added 16 atom-counter laziness tests to lazy-infinite-test.janet:
map, filter, remove, take-while, drop-while, distinct, take-nth,
map-indexed, keep, keep-indexed, interpose, partition, partition-all,
mapcat, dedupe, repeated-inc
Each test wraps input elements in (swap! c inc) and proves only the
exact minimal number of elements are realized. 37/37 pass, 0 timeouts.
Updated phase-5.md §7: "22/22" → "21/21" (interleave commented out),
§6.3 marked Done.
Final gate results:
lazy-infinite: 37/37 (21 value + 16 counter)
conformance: 229/229 ×3
specs: 32/32 files, 0 failures
clojure-test-suite: 3971 pass (↑45), 6 timeouts (↓3)
core-bench: TOTAL 2531 ms (no Phase-4 baseline for comparison)
Representation decision: Option B (hybrid). Option A blast-radius
measured — always-lazy map breaks lazy-infinite (0/21) and crashes
conformance completely. Hybrid (lazy over lazy input, eager over
concrete) is the only viable approach with current lazy-seq machinery.
Gates verified:
- lazy-infinite: 21/21 (0 timeouts)
- conformance: 229/229 x3
- specs: 32/32 files, 0 failures
- clojure-test-suite: 3971 pass (up from 3926), 6 timeouts (down from 9)
- core-bench: TOTAL 2531 ms
22/22 lazy-infinite, 229x3 conformance, 32/32 specs — all green.
clojure-test-suite: 849 pass (regression from 3926). Top failing
files: lazy_seq, mapcat, map, group-by, keys, vals, subs. Root cause
is the 40-lazy.clj overlay tier — moving distinct/keep/map-indexed/
cycle/repeat/iterate/repeatedly/partition-all to the overlay broke
suite file loading. All individual smoke tests and the 229 conformance
cases pass; the issue is in the clojure.test shim + .cljc loading path.
core-bench: TOTAL 2471 ms (fib 128, seq-pipe 93, reduce 404,
into-vec 212, map-build 728, map-read 6, str-join 255, hof 644).
No Phase-4 baseline exists for comparison.
§6.3 laziness counters + representation decision deferred.
The git stash pop restored the old lazy-seq version of dedupe.
Re-applied the make-lazy-seq + coll->cells fix for the 20-coll
tier where lazy-seq macro is not yet available.
Step-by-step plan for jolt-c09 (Phase 5 of the clojure.core migration):
current state of the LazySeq machinery and the eager gaps, the cardinal
laziness rules, leaf-first transformer conversion order, realization-boundary
audit, the representation decision (lazy-seq vs eager-vector for map over a
vector), and a testing strategy built around a deadlined subprocess harness
(infinite realizations are CPU-bound and uninterruptible in-process).