Cross-ns def/require/use/defmethod through the spine (jolt-c2l1)

The per-form eval passed a FIXED compile-ns to every subform of a top-level do,
so a runtime (ns ...)/(in-ns ...) didn't redirect later defs/refs — defs landed
in the wrong ns and qualified refs hit host-static ("Unknown class"). Thread
the current ns: each subform analyzes in (chez-current-ns), which ns/in-ns move.

That exposed two more gaps, now fixed:
- use refers ALL of a target's public vars (a refer-all table consulted by
  chez-resolve-refer) — was bound to plain require (explicit :refer only).
- defmethod on a QUALIFIED multifn (cf.mm/ext from another ns) resolves in the
  symbol's ns, not the current one (was auto-creating a stray multifn).

Corpus 2684->2688, 0 new divergences; floor raised. No re-mint (runtime shims).
This commit is contained in:
Yogthos 2026-06-21 16:56:46 -04:00
parent 76f8274603
commit c788e86f1a
6 changed files with 50 additions and 8 deletions

View file

@ -11,7 +11,7 @@
;; reset between cases so there is no leakage — same isolation a fresh process gives.
;;
;; chez --script host/chez/run-corpus.ss
;; JOLT_CHEZ_ZJ_FLOOR=N override the regression floor (default 2684)
;; JOLT_CHEZ_ZJ_FLOOR=N override the regression floor (default 2688)
;; JOLT_CORPUS_LIMIT=N every-Nth stride (fast iteration; floor drops to 0)
;; JOLT_DUMP_CRASH_LABELS=1 list crash + allowlisted labels
(import (chezscheme))
@ -65,6 +65,7 @@
(zj-prune! type-registry zj-type-base)
(hashtable-clear! ns-alias-table)
(hashtable-clear! ns-refer-table)
(hashtable-clear! ns-refer-all-table)
(when zj-ghier (jolt-invoke (var-deref "clojure.core" "reset!")
(var-cell-root zj-ghier) (jolt-invoke (var-deref "clojure.core" "make-hierarchy"))))
(set-chez-ns! "user"))
@ -202,7 +203,7 @@
;; Regression floor: fail on any NEW divergence or if pass drops below the floor.
(define base-floor (let ((s (getenv "JOLT_CHEZ_ZJ_FLOOR")))
(if s (string->number s) 2684)))
(if s (string->number s) 2688)))
(define floor (if limit 0 base-floor))
(when (or (> (length diverged) 0) (< pass floor))
(printf "REGRESSION: pass ~a < floor ~a or ~a new divergence(s)\n"