#303 asdf fasl replay: OS-UNIX-P never EXPORTED from UIOP/VERSION at load — defun fn-cell lands on an UIOP/OS-own twin, designator funcall dies

closed
Opened by atgreen

Residue after cave#302 (7ab1a4b). The asdf fasl (5,056,030 bytes, loads in 0.12s) now resolves its quoted os-unix-p designator to the correctly-homed UIOP/VERSION record — but the load still aborts in uiop/os with 'funcall of an unbound or NIL function value'.

Measured post-load (probes in the surviving session):

Ground truth at SOURCE-load (works): the ONE canonical os-unix-p is UIOP/VERSION-homed, external there, inherited-visible from UIOP/OS; the defun's install resolves through the same reader walk to the same record — identity stays consistent.

At REPLAY the export edge is missing: whatever exported OS-UNIX-P from UIOP/VERSION at compile (uiop's ensure-package/define-package machinery running live) does not reproduce it at load, so ag-fasl-co-install-name's accessibility door cannot see the V record inherited and mints/hits the UIOP/OS-own twin. Suspects, in order: (1) a CO-RUN raise swallowed during the uiop/version or uiop/os define-package replay (ensure-package's export path touching a funcl gap only on the replay side); (2) the replay's ensure-package intern resolving the export designator through a different door than the compile session (creating the OS twin then exporting THAT); (3) export state that at compile came from a door with side effects the fasl doesn't serialize (e.g. the reader's inherited-hit re-export).

Next step: trace export calls (name+package) during BOTH the compile session and the replay for OS-UNIX-P, diff the sequences — 0.12s load makes the replay side cheap; the compile side needs one 250s run with the trace. Repro: (fasl-compile "asdf.lisp" X) then (load X) in a fresh image.

Comments (1)

atgreen3992933944

FIXED in c769fc0. The issue's premise was falsified by measurement: tracing pkg-add-export-name on BOTH sides showed OS-UNIX-P is exported from UIOP/OS (never UIOP/VERSION) at compile AND at replay — the export edge replays fine, and the replayed defun install correctly lands the fn-cell on the canonical UIOP/OS record (funcall probe T).

The real defect was the KIND-4 reloc's HOME CAPTURE at compile: the quote emitter's KIND-4 arm receives the NAME-KEYED POOL record (not the reader's canonical record — traced: reader resolved the detect-os alist symbol to the UIOP/OS-homed record @1112567139, but ag-quoted-emit-symbol received pool record @1081796083). A pool record's home slot is its FIRST-TOUCH package: os-unix-p first hit the pool while package was still UIOP/VERSION (emitting the uiop/os define-package's #: export list, whose own reloc is home=NIL/uninterned). So detect-os's reloc carried home=UIOP/VERSION; at replay that resolves to the fn-cell-less phantom minted by the home=NIL reloc's pool-as-mint (re-homed to the then-current package = UIOP/VERSION) — the funcall death.

Fix: ag-quoted-sym-door-home-name — the KIND-4 home is resolved through the SAME accessibility door the replay's CO-INSTALL uses (ag-reader-intern-fn on the emission-site package), not read from the pool record's stale slot. Wire check: detect-os relocs now carry home=UIOP/OS. Replay: designator funcall T, (uiop/os:detect-os) => :OS-UNIX, load proceeds through uiop/pathname/filesystem/stream into uiop/image where it dies on a DISTINCT divergence (filed as its own issue). Gates: fasl spike oracle green (baseline == artifact incl. pkgsym 21/15/T), --hosted exit 42, sharded suite green except the pre-existing stage1 save-image SEGV (fails on unmodified main too; filed separately).