#301 KIND-7 resolved-call relocs resolve by BARE NAME — cross-package collisions bind the wrong function (asdf fasl load: ENSURE-PACKAGE expected 1, got 25)
closedFound loading the first-ever asdf.lisp fasl (252s compile, 5.05MB, via cave#300's classifier fix). Load dies in 0.05s: 'invalid number of arguments: ENSURE-PACKAGE expected 1, got 25 | in: LOAD'. Cause: KIND-7 relocs (cave#299, resolved rel32 calls serialized by name) re-resolve at load against the consumer's name-keyed fn-table — uiop/package's 25-arg ENSURE-PACKAGE call in the fasl binds to a different same-named function already in the image (or an earlier-registered 1-arg one). Same disease class KIND-6 fixed for pkgsym direct calls; KIND-7 needs the same treatment: carry home-pkg in the v5 record (field already exists — slice 3) and resolve package-scoped first, name-keyed fallback. Sites: ag-resolve-call-rel32 emit side (record home-pkg when the callee symbol is package-homed), load-reresolve-baked-reloc KIND-7 arm (package-aware lookup). This is now THE blocker for the asdf fasl; alexandria fasls are unaffected (no cross-package name collisions in the green set).
Comments (2)
ADR-0031 stage 1 (ccc3cd8) retires this issue's wrong-bind mechanism: all name->record channels (fasl installs, funcall/apply designators, loader KIND-6/7) now share the reader-equivalent accessibility door, and the name-keyed designator heal is restricted to name-keyed-world homes. The 3KB two-package repro (apply/funcall of a colliding designator across a fasl) is green, matching the source-load control. The asdf fasl now loads in 0.11s DEEP into uiop (packages materialize, uiop/os region executes) and fails HONESTLY on the next distinct layer: UNDEFINED-PKG-DESIGNATOR: UIOP/VERSION::OS-UNIX-P — the wire carries a compile-time-minted UIOP/VERSION-homed record for a symbol that should resolve inherited from UIOP/OS (post-load, find-symbol OS-UNIX-P in UIOP/VERSION hits — the inheritance exists by then; the divergence is at fasl-COMPILE read time, likely export-timing during uiop's define-package expansion vs the classifier's replay). Closing this issue (the ENSURE-PACKAGE wrong-bind class is dead); the inheritance-timing residue is the follow-up issue.
PARTIAL + full diagnosis (commit above). KIND-7 now carries home-pkg and the loader resolves package-scoped first (fn-cell of the interned (pkg,name) record, bare-name fallback). Battery green, alexandria fasls 0.13s. BUT the asdf failure is UNCHANGED because the failing call is NOT a KIND-7 site. Instrumented findings: (1) funcl stdlib defines a 1-arg ENSURE-PACKAGE (stdlib.lisp:9125) colliding with uiop's 25-arg one in every NAME-KEYED channel — fn-table, funcl-funcall-fallback ((apply 'ensure-package ...) designators), fn-patches; (2) deeper: relocs apply at CO-INSTALL time, before the fasl's own defpackage CO-RUNs execute — a K7-NOBASE trace storm (hundreds of names: TYPEP, LIST, %ENSURE-PACKAGE-RAW...) shows scoped resolution missing during the asdf replay, so KIND-6/7 fall back to name-keyed mint records whose fn-cells are never healed once the package exists. FIX DIRECTION (next session): lazy JVM-style resolution — package-scoped calls resolve through the fn-cell at first CALL, not eagerly at reloc time; heal mint-fallback records when the package materializes; and make funcl-funcall-fallback prefer the symbol's own package before the bare-name table. asdf fasl artifacts: 5,056,030 bytes, compiles in ~250s, loads (with the wrong-bind casualty) in 0.05s.