#259 flet-local references from macrolet expansions compile as GLOBAL calls (uiop pathname-equal: 97k trap-routed NORMALIZE-COMPONENT sites)

open
Opened by atgreen

Found via the new P7 named traps (this campaign): the asdf operate/traverse blocker was "call to undefined function: NORMALIZE-COMPONENT".

uiop's pathname-equal (asdf.lisp ~2680) binds normalize-component via FLET, then a MACROLET (=?) expands to forms referencing it. funcl compiles those references as calls to the GLOBAL name NORMALIZE-COMPONENT — the flet rewrite evidently runs before (or independently of) the body's macroexpansion, so expansion-produced references miss the local-function rewrite. The crossing ledger records 97,248 trap-routed call sites for this one name.

Sibling ledger entries from the same asdf load look like the same class or adjacent expansion bugs, worth checking when this is fixed: WHEN (7,695 sites compiled as calls), OR (96), bare variables C (14,744) and ASDF/OPERATION::O (5,355) in call position, #:STATUS (3,247), plus ~30 genuinely-missing CL standard functions (FILE-POSITION, ENSURE-DIRECTORIES-EXIST, PRINT-UNREADABLE-OBJECT, WITH-COMPILATION-UNIT, MAKE-BROADCAST-STREAM, READ, DELETE-FILE, RENAME-FILE, FILL-POINTER, LOAD-TIME-VALUE, REMOVE-METHOD, SOFTWARE-TYPE/VERSION, MACHINE-TYPE...) that deserve their own tracking.

Also: 3x UNRESOLVED-FN-VALUE for ASDF/FORCING::TRAVERSE-ACTION — a (function traverse-action) value site silently left as lea rax,[rip+0] (wild-jump-in-waiting); likely the notinline late-binding lowering resolving through a split twin (cave#257).

Workaround shipping in asdf-funcl.patch: #+funcl flet-free pathname-equal using a plain helper defun.

Comments (1)

atgreen3992785830

ASSESSMENT 2026-07-11: still open as filed (macrolet-expanded flet-local refs compile as global calls; uiop pathname-equal's 97k trap-routed sites). Note: today's asdf loads complete WITH this bug — the trap route resolves (slowly) rather than crashing, so it's now a PERF+correctness-risk item rather than a blocker. The fix belongs in the macroexpander's env threading: macrolet expansions must carry the enclosing flet scope when the lift pass runs.