From 6ebb210652d434d2cbcd834ae83cb60801126217 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 4 Jul 2026 23:09:43 -0400 Subject: [PATCH] QA: ignore Core/Base IR-introspection internals in public-API check The hasbranching utility code_typeds f and scans the resulting typed IR, so it necessarily accesses Core/Base compiler-introspection internals that have no public equivalent: Argument, CodeInfo, Const, MethodInstance, PartialStruct, SSAValue, SlotNumber (IR node & inference types) and code_typed_by_type (the non-public typed-IR entry point). Extend the all_qualified_accesses_are_public ignore tuple from (:Typeof,) to cover all of these so the QA ExplicitImports public-API check passes on 1.11+. Co-Authored-By: Chris Rackauckas --- test/qa/qa.jl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/test/qa/qa.jl b/test/qa/qa.jl index f98a736..a4190c4 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,15 +1,27 @@ using SciMLTesting, FunctionProperties, JET, Test # `hasbranching` is a compiler-introspection utility: it `code_typed`s `f` and scans the -# resulting IR for `Core.GotoIfNot` nodes, and builds the dispatch signature with -# `Core.Typeof`. Both names are internal to `Core` with no public equivalent -# (`typeof` differs from `Core.Typeof` on type-valued arguments, and `Base.typesof` -# is itself non-public), so these two accesses are ignored in the public-API checks. +# resulting typed IR for value-dependent branches, so it necessarily reaches into the +# `Core`/`Base` IR and inference internals, none of which have a public equivalent: +# - `GotoIfNot` (explicit import via `using Core: GotoIfNot`) is the conditional-branch IR node. +# - `CodeInfo`/`SSAValue`/`SlotNumber`/`Argument` are typed-IR node types scanned in the body. +# - `Const`/`PartialStruct` are inference lattice element types read off the IR. +# - `MethodInstance` is the resolved-call type used to recurse through static calls. +# - `Typeof` builds the dispatch signature (`typeof` differs from `Core.Typeof` on +# type-valued arguments, and `Base.typesof` is itself non-public). +# - `code_typed_by_type` is the non-public typed-IR entry point (`Base.code_typed_by_type`). +# All of these are Core/Base compiler-introspection internals with no public API, so they are +# ignored in the public-API checks. run_qa( FunctionProperties; explicit_imports = true, ei_kwargs = (; all_explicit_imports_are_public = (; ignore = (:GotoIfNot,)), - all_qualified_accesses_are_public = (; ignore = (:Typeof,)), + all_qualified_accesses_are_public = (; + ignore = ( + :Typeof, :Argument, :CodeInfo, :Const, :MethodInstance, + :PartialStruct, :SSAValue, :SlotNumber, :code_typed_by_type, + ), + ), ) )