#242 image restore reverses fn-table shadowing — bake-time redefinitions (mini-clos typep/find-class) lost on build/funcl

closed
Opened by atgreen

Fourth domino on the asdf goal chain (found porting the stage2 operate probes to build/funcl after #239/#240/#241).

Symptom: on build/funcl (image-baked), (typep ') = NIL and (find-class 'name nil) = NIL for runtime defclasses, while every mc-* piece works when called directly (mc-class-known-p=T, mc-isa=T, class-of correct). Every call door (direct, funcall 'sym, #'sym) reaches the PRELUDE typep, not mini-clos's redefinition. This broke asdf's (check-type system asdf/operation::system) and the 'no accessor' cascade during defsystem — the whole operate chain — on the shipping binary only; stage2 (no restore) works.

Root: ag-fn-add PREPENDS entries (live lookup = first match = newest wins). ag-image-emit-fn-table serializes ag-fn-table in live order (newest first). ag-image-populate-fn-table-walk (restore) re-added entries in FILE order, each prepending — a double reversal that leaves the OLDEST same-name entry shadowing. Every bake-time redefinition (stdlib typep -> mini-clos typep, find-class, ...) resolves to the pre-redefinition version on every restored image.

Fix: restore-side — collect the parsed entries first (prepending), then ag-fn-add in reverse file order, so the restored table's shadowing matches the saved session. No image format change.

Comments (1)

atgreen3992408962

Fixed in the commit just pushed: restore-side collect-then-add-in-reverse. typep/find-class correct on build/funcl, suite 8/8. Next operate-chain blocker (find-component no-applicable-method during register-preloaded-system) is a separate layer.