test(meta): filter LoweredCodeUtils' benign JET-scan warnings#495
Merged
Conversation
JET.test_package collects method signatures via Revise/LoweredCodeUtils without calling anything. For keyword-argument functor methods, Julia compiles a hidden var"#_#N" body function that LoweredCodeUtils cannot statically attribute to its parent method, so it emits a "skipping callee ... UndefRefError()" warning before moving on and continuing the scan unaffected (10 such warnings from HamiltonianVectorField's variable_costate kwarg methods). It is a collector limitation, not a JET finding. Wraps the JET testset in a logger that filters that specific message (prefix + emitting module), so any other warning from LoweredCodeUtils still surfaces normally. Logging added to the test target (a stdlib, but CTBase's strict Pkg.test sandbox needs it declared explicitly, same as the existing Markdown/Test entries). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JET.test_package(enabled in #494) collects method signatures via Revise/LoweredCodeUtilswithout calling anything. For a keyword-argument functor method — a callable struct with a; kwarg=defaultin its call signature — Julia compiles a hiddenvar"#_#N"body function thatLoweredCodeUtilscannot statically attribute to its parent method, so it emits@warn "skipping callee ... due to UndefRefError()"before moving on.HamiltonianVectorField's 10variable_costatekwarg methods trigger exactly this, printing 10 warnings on every test run.This is a collector limitation, not a JET finding: nothing is misreported (unlike the
OptionValuefalse positive fixed in #494, this has no entry in JET's actual result), it's pure log noise while scanning. The flagged bodies are simply excluded from the static scan; their runtime behavior is unaffected and already covered bytest_hamiltonian_vector_field.jl(92 tests).Change
Wraps the
JETtestset intest_code_quality.jlwith a small customLogging.AbstractLoggerthat filters out only messages matchinglevel == Warn && _module == LoweredCodeUtils && startswith(message, "skipping callee")— precise on purpose, so any other, unrelated warning fromLoweredCodeUtilsstill surfaces normally rather than being silenced wholesale.Logging(a stdlib) added to[extras]/[targets]["test"]/[compat]: CTBase's strictPkg.testsandbox needs stdlibs declared explicitly, same as the existingMarkdown/Testentries.Also documented generically in the Handbook (
philosophy/performance.md, companion doc) so the same filter is reused rather than rediscovered in other control-toolbox packages.Test plan
test/suite/meta/test_code_quality.jl— 12/12 greenPkg.test("CTBase")) — 4731/4731 green🤖 Generated with Claude Code