SIGN IN SIGN UP

Compiler: prevent invalidating custom AbstractInterpreter precompiles (#61714)

Packages with a custom `AbstractInterpreter` (cuTile, JET, etc.) lost their precompiled inference results the moment the REPL was loaded, because of the `REPLInterpreter` in there.

The cause is abstract dispatch through the interp field of `InferenceState` and `OptimizationState`, typed `::AbstractInterpreter`. Reads of that field widen to the supertype, so calls like `cache_owner(frame.interp)` register abstract-dispatch backedges. Loading REPL adds another interpreter and trips those backedges.

The fix re-narrows the field to the concrete interpreter type at the few call sites that need to dispatch on it, using per-call typeasserts rather than threading the type everywhere (which causes additional allocations).

A few invalidations still leak through the `Future{T}` work-thunk machinery; closing those would mean parameterizing `Future{T}`, left for later.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
T
Tim Besard committed
0d22f19d5c4f015003fa421af1c50fce73e9e677
Parent: d2456dc
Committed by GitHub <noreply@github.com> on 5/29/2026, 8:00:38 AM