Problem
Directive derivation (#241) gives specialization bindings — top-level bindings applying an @inline arity=N target to some of its arguments — a derived policy: arity=(N-k) while under-applied, always-inline once saturated. The derivation skips any binding carrying an explicit root directive (never/always/arity=N), but a written default cannot serve as that opt-out: resolveModes (the directive-precedence resolver in Language.PureScript.Backend.IR.Inliner) folds a winning default mode to no annotation before translation, so by the time derivedInlinePolicy inspects the uber-module the binding is indistinguishable from an unannotated one and derivation proceeds. The only working opt-out today is never, which is stronger than intended — it also pins the binding against every other paste path.
Approach
First decide the semantics, then plumb it. The README defines default as "resets the target to the built-in heuristics", and derivation can be read as part of the heuristics — under that reading current behavior is correct and the gap is expressiveness only. The leaning is the other way: an explicit directive naming a specific binding expresses intent about that binding, so default should also mask derivation. Implementation once decided: preserve the mask through translation — either a Default constructor on Annotation that collectInlinePolicy gathers into a policyDefault ∷ Set QName and that every other consumer treats as no annotation, or a masked-target set threaded from mkModule through the linker — and consult it in the hasRootDirective guard of derivedInlinePolicy.
Prerequisites / Relations
Builds on #241 (derived directives) and the #232 directive DSL. Independent of the #242 directive pack.
Verification / Measurement
A pipeline spec: a specialization of an arity=N target annotated @inline spec default keeps its call sites calling the shared binding (no derived paste), while an unannotated sibling specialization still derives. Directive-source precedence (local pragma vs file vs export) over the default entry stays as documented.
Problem
Directive derivation (#241) gives specialization bindings — top-level bindings applying an
@inline arity=Ntarget to some of its arguments — a derived policy:arity=(N-k)while under-applied, always-inline once saturated. The derivation skips any binding carrying an explicit root directive (never/always/arity=N), but a writtendefaultcannot serve as that opt-out:resolveModes(the directive-precedence resolver inLanguage.PureScript.Backend.IR.Inliner) folds a winningdefaultmode to no annotation before translation, so by the timederivedInlinePolicyinspects the uber-module the binding is indistinguishable from an unannotated one and derivation proceeds. The only working opt-out today isnever, which is stronger than intended — it also pins the binding against every other paste path.Approach
First decide the semantics, then plumb it. The README defines
defaultas "resets the target to the built-in heuristics", and derivation can be read as part of the heuristics — under that reading current behavior is correct and the gap is expressiveness only. The leaning is the other way: an explicit directive naming a specific binding expresses intent about that binding, sodefaultshould also mask derivation. Implementation once decided: preserve the mask through translation — either aDefaultconstructor onAnnotationthatcollectInlinePolicygathers into apolicyDefault ∷ Set QNameand that every other consumer treats as no annotation, or a masked-target set threaded frommkModulethrough the linker — and consult it in thehasRootDirectiveguard ofderivedInlinePolicy.Prerequisites / Relations
Builds on #241 (derived directives) and the #232 directive DSL. Independent of the #242 directive pack.
Verification / Measurement
A pipeline spec: a specialization of an
arity=Ntarget annotated@inline spec defaultkeeps its call sites calling the shared binding (no derived paste), while an unannotated sibling specialization still derives. Directive-source precedence (local pragma vs file vs export) over thedefaultentry stays as documented.