You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Carved out of #73's gap list because it is an invariant hazard on its own.
PreparedOperator (src/linalg.jl:24) has no supertype, so islinear(P), isconstant(P) and adjoint(P) are MethodErrors.
PreparedComposed and PreparedAdjoint (src/linalg.jl:270,289) are<: AbstractOperator but declare no trait methods, so islinear on a prepared composed tree falls through to the false default in src/operators/abstract.jl.
"Traits default to the weaker claim" only protects you when the weaker claim is the declared one. Here a wrapper that forwards traits from P.op gets a wrong answer that degrades safely by accident rather than by design.
Fix
Give PreparedOperator a supertype (or forward islinear / isconstant / isselfadjoint / isdiagonal to P.op explicitly).
PreparedComposed: islinear = islinear(a) && islinear(b), same for isconstant, mirroring Composed in src/operators/algebra.jl:98-100.
PreparedAdjoint: forward to the wrapped operator, mirroring AdjointOp in src/operators/abstract.jl:191.
Tests in test/prepare_linalg.jl: traits of a prepared tree equal the traits of the unprepared tree for every combinator.
Also worth noting while here: isconstant is declared on every leaf and propagated through the algebra but consumed nowhere in src/. Its first consumer is the SciML isconstant / caching decision in #65.
🤖 Beep boop — Claude found the traits that forgot to speak; Kyle is not muttering defaults to himself.
Activity