Chez parity: realized? on lazy-seq + conj! 1-arity identity

realized? threw 'not supported on' for a jolt-lazyseq record (the overlay
reads :jolt/type); add a jolt-lazyseq? arm to the post-prelude wrapper
reading the record's own realized? flag.

conj! 1-arity (conj! coll) is the transducer-completion arity and returns
coll as-is on the JVM, no transient check — we threw 'not a transient'.

Both gates: zero-janet 2696->2698, prelude 2649->2652, 0 new divergences.
This commit is contained in:
Yogthos 2026-06-20 19:40:05 -04:00
parent 32d2028559
commit 53a189541c
4 changed files with 24 additions and 11 deletions

View file

@ -62,9 +62,12 @@
(let ((overlay-realized? (var-deref "clojure.core" "realized?"))) (let ((overlay-realized? (var-deref "clojure.core" "realized?")))
(def-var! "clojure.core" "realized?" (def-var! "clojure.core" "realized?"
(lambda (x) (lambda (x)
(if (or (jolt-future? x) (jolt-promise? x) (jolt-delay? x)) (cond
(jolt-conc-realized? x) ((or (jolt-future? x) (jolt-promise? x) (jolt-delay? x)) (jolt-conc-realized? x))
(jolt-invoke overlay-realized? x))))) ;; a lazy-seq carries its own realized? flag (lazy-bridge.ss). The overlay
;; realized? reads :jolt/type and throws on a jolt-lazyseq record.
((jolt-lazyseq? x) (jolt-lazyseq-realized? x))
(else (jolt-invoke overlay-realized? x))))))
;; clojure.edn/read over a reader: the overlay edn.clj drain-reader uses janet/type; ;; clojure.edn/read over a reader: the overlay edn.clj drain-reader uses janet/type;
;; the native Chez version (io.ss) drains the jhost reader instead (jolt-uicd/jolt-7t3l). ;; the native Chez version (io.ss) drains the jhost reader instead (jolt-uicd/jolt-7t3l).
(def-var! "clojure.edn" "read" (def-var! "clojure.edn" "read"

View file

@ -23,14 +23,18 @@
(jolt-transient-active-set! t #f) (jolt-transient-active-set! t #f)
(jolt-transient-coll t)) (jolt-transient-coll t))
;; (conj!) with no args -> a fresh transient vector (Clojure); otherwise mutate t. ;; (conj!) with no args -> a fresh transient vector (Clojure); (conj! coll) is the
;; 1-arity transducer-completion arity, which returns coll as-is with NO transient
;; check (JVM: conj! 1-arity is identity); otherwise mutate t.
(define (jolt-conj! . args) (define (jolt-conj! . args)
(if (null? args) (cond
(jolt-transient-new (jolt-vector)) ((null? args) (jolt-transient-new (jolt-vector)))
((null? (cdr args)) (car args))
(else
(let ((t (car args)) (xs (cdr args))) (let ((t (car args)) (xs (cdr args)))
(jolt-trans-check t "conj!") (jolt-trans-check t "conj!")
(jolt-transient-coll-set! t (apply jolt-conj (jolt-transient-coll t) xs)) (jolt-transient-coll-set! t (apply jolt-conj (jolt-transient-coll t) xs))
t))) t))))
;; (assoc! t k v & kvs): variadic like Clojure (jolt-assoc already folds pairs). ;; (assoc! t k v & kvs): variadic like Clojure (jolt-assoc already folds pairs).
(define (jolt-assoc! t . kvs) (define (jolt-assoc! t . kvs)
(jolt-trans-check t "assoc!") (jolt-trans-check t "assoc!")

View file

@ -322,8 +322,9 @@
# jolt-cf1q.7 parity batches (hash/rseq/cat/transient-as-fn + ns runtime fns + # jolt-cf1q.7 parity batches (hash/rseq/cat/transient-as-fn + ns runtime fns +
# runtime-require alias registration) -> 2590; arrays + reader-features/ # runtime-require alias registration) -> 2590; arrays + reader-features/
# macroexpand/reader-conditional/re-matcher -> 2629; delay/force/realized? -> 2641. # macroexpand/reader-conditional/re-matcher -> 2629; delay/force/realized? -> 2641.
# Strided runs scale down. # STM stub + portable line-seq -> 2649; realized? on a lazy-seq + conj! 1-arity
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_PRELUDE_FLOOR") "2648"))) # (transducer-completion identity) -> 2652. Strided runs scale down.
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_PRELUDE_FLOOR") "2652")))
(def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor)) (def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor))
(when (or (> (length diverged) 0) (< pass floor)) (when (or (> (length diverged) 0) (< pass floor))
(printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged))) (printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged)))

View file

@ -200,6 +200,10 @@
(each k (sort-by (fn [k] (- (get tbl k))) (keys tbl)) (each k (sort-by (fn [k] (- (get tbl k))) (keys tbl))
(printf " %4d x %s" (get tbl k) k)))) (printf " %4d x %s" (get tbl k) k))))
(report "crash reasons" crash-keys) (report "crash reasons" crash-keys)
(when (os/getenv "JOLT_DUMP_CRASH_LABELS")
(printf "\nCRASH LABELS:")
(each [l k] (sort-by (fn [pair] (get pair 1)) crashes)
(printf " [%s] :: %s" k l)))
(when (> (length diverged) 0) (when (> (length diverged) 0)
(printf "\nNEW divergences (ran, wrong value) — gate FAILS:") (printf "\nNEW divergences (ran, wrong value) — gate FAILS:")
(each [l m] (slice diverged 0 (min 40 (length diverged))) (each [l m] (slice diverged 0 (min 40 (length diverged)))
@ -218,8 +222,9 @@
# ACTUAL (matching certify.clj's eval-isolated) -> 2673; delay/force/realized? -> # ACTUAL (matching certify.clj's eval-isolated) -> 2673; delay/force/realized? ->
# 2685; deftype (P. args) constructor via host-new var fallback -> 2688; # 2685; deftype (P. args) constructor via host-new var fallback -> 2688;
# date/time (Date/Timestamp/SimpleDateFormat/TimeZone) + clojure.edn/read over a # date/time (Date/Timestamp/SimpleDateFormat/TimeZone) + clojure.edn/read over a
# reader -> 2692. # reader -> 2692; STM stub + portable line-seq -> 2696; realized? on a lazy-seq +
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_ZJ_FLOOR") "2696"))) # conj! 1-arity (transducer-completion identity) -> 2698.
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_ZJ_FLOOR") "2698")))
(def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor)) (def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor))
(when (or (> (length diverged) 0) (< pass floor)) (when (or (> (length diverged) 0) (< pass floor))
(printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged))) (printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged)))