Skip to content

test(meta): filter LoweredCodeUtils' benign JET-scan warnings#495

Merged
ocots merged 1 commit into
mainfrom
test/filter-jet-lcu-warnings
Jul 12, 2026
Merged

test(meta): filter LoweredCodeUtils' benign JET-scan warnings#495
ocots merged 1 commit into
mainfrom
test/filter-jet-lcu-warnings

Conversation

@ocots

@ocots ocots commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

JET.test_package (enabled in #494) collects method signatures via Revise/LoweredCodeUtils without calling anything. For a keyword-argument functor method — a callable struct with a ; kwarg=default in its call signature — Julia compiles a hidden var"#_#N" body function that LoweredCodeUtils cannot statically attribute to its parent method, so it emits @warn "skipping callee ... due to UndefRefError()" before moving on. HamiltonianVectorField's 10 variable_costate kwarg 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 OptionValue false 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 by test_hamiltonian_vector_field.jl (92 tests).

Change

Wraps the JET testset in test_code_quality.jl with a small custom Logging.AbstractLogger that filters out only messages matching level == Warn && _module == LoweredCodeUtils && startswith(message, "skipping callee") — precise on purpose, so any other, unrelated warning from LoweredCodeUtils still surfaces normally rather than being silenced wholesale.

Logging (a stdlib) added to [extras]/[targets]["test"]/[compat]: CTBase's strict Pkg.test sandbox needs stdlibs declared explicitly, same as the existing Markdown/Test entries.

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

  • Confirmed 0 occurrences of "skipping callee" in the test log after the change (previously 10)
  • test/suite/meta/test_code_quality.jl — 12/12 green
  • Full suite (Pkg.test("CTBase")) — 4731/4731 green

🤖 Generated with Claude Code

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>
@ocots
ocots merged commit ced3232 into main Jul 12, 2026
6 checks passed
@ocots
ocots deleted the test/filter-jet-lcu-warnings branch July 12, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant