Skip to content

test: add Aqua QA; migrate to JSON 1.x#4

Merged
Dale-Black merged 4 commits into
mainfrom
aqua-and-explicit-imports
Apr 20, 2026
Merged

test: add Aqua QA; migrate to JSON 1.x#4
Dale-Black merged 4 commits into
mainfrom
aqua-and-explicit-imports

Conversation

@Dale-Black
Copy link
Copy Markdown
Member

@Dale-Black Dale-Black commented Apr 20, 2026

Summary

Adds Aqua.jl package-quality checks to the test suite, and migrates the package to JSON 1.x — which also fixes the 657-test regression that's currently on main from when CompatHelper merged the JSON 0.21→1 bump (PR #3).

What's in

Aqua (test/test_aqua.jl) — Aqua.test_all(WasmTarget) runs all 11 sub-checks (method ambiguities, unbound type params, undefined exports, stale deps, missing compat, piracy, persistent tasks, project_toml/test_project_toml parity). All 11 pass locally in ~6 s.

JSON 1.x migration — pins JSON = "1". test/utils.jl::unmarshal_result guarded on result isa Dict, but JSON 1.x's JSON.parse returns JSON.Object <: AbstractDict, not Dict. The __bigint__ sentinel unwrap silently no-op'd, leaving 657 tests failing per OS with assertions like JSON.Object("__bigint__" => "30") == 30. Widen guards to AbstractDict. Sanity-checked on JSON 1.5.0:

wasmtime output parsed type unmarshaled
30 Int64 30
{"__bigint__":"30"} JSON.Object 30
{"__bigint__":"9007199254740994"} JSON.Object 9007199254740994
"__NaN__" String NaN

Drive-by fixes flagged by Aqua

  • Drop stale exports IRStatement and IntrinsicMapping — neither symbol was ever defined.
  • Drop unused Base.Experimental.@MethodTable import at codegen/interpreter.jl:19 (the macro is invoked via the qualified path, not the imported name).
  • Add stdlib [compat] entries for Dates and Test.

README

  • Aqua QA badge under the CI badge.

What's NOT in (intentionally dropped)

ExplicitImports.jl was wired up and working locally but removed — its AST walk over WasmTarget's codegen source took 13 min and OOM'd Ubuntu+macOS runners, and it emitted thousands of multi-MB recursion-limit warnings that made logs unreadable. The "are_public" checks also fundamentally clash with this package's nature (a compiler intentionally reaches into Base/Core/Compiler internals). Not worth the operational overhead.

Test plan

  • Local QA pass: Aqua 11/11 in 6.1 s
  • All three OSes green on CI — previously 657-test failure from JSON 1.x incompat, should be clean now

Dale-Black and others added 4 commits April 20, 2026 12:15
QA suite:
- Aqua.test_all(WasmTarget) — catches method ambiguities, unbound
  type params, undefined exports, stale deps, missing compat,
  piracy, persistent tasks. All 11 sub-checks pass.
- ExplicitImports individual checks — no_implicit_imports,
  no_stale_explicit_imports, explicit_imports_via_owners,
  qualified_accesses_via_owners, no_self_qualified_accesses
  (with `optimize` ignored — it's both a public kwarg and an
  exported function, the self-qualification is necessary to
  disambiguate inside kwarg-shadowed scopes). We skip the two
  "are_public" checks because WasmTarget intentionally reaches
  into Base/Core/Compiler internals (uncompressed_ir, memoryref,
  method_table, pow_body, etc.) — that's how compiling Julia
  to Wasm works.

Findings fixed while wiring this up:
- Drop stale `IRStatement` and `IntrinsicMapping` exports
  (neither symbol existed).
- Drop unused `Base.Experimental.@MethodTable` import at
  codegen/interpreter.jl:19 — the overlay table is defined via
  the qualified `Base.Experimental.@MethodTable` macro, not via
  the imported name.
- Add stdlib compat entries for Dates and Test.

JSON 1.x migration:
- Bump compat to JSON = "1" (JSON 1.x is where the ecosystem is
  heading; JSON 0.21 is legacy).
- `unmarshal_result` in test/utils.jl previously guarded on
  `result isa Dict`, but JSON 1.x's `JSON.parse` returns
  `JSON.Object <: AbstractDict`, not `Dict`. The `__bigint__`
  sentinel unwrap path was silently skipped, leaving 600+ tests
  failing on every CI run with assertions like
  `JSON.Object("__bigint__" => "30") == 30`. Widen the guards
  to `AbstractDict` so both JSON 0.21 and 1.x work.

README:
- Add Aqua QA and ExplicitImports.jl badges under the CI row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI runners were OOM'ing in the ExplicitImports block because the
individual check_* functions each re-walk every src/ file from
scratch — ~30 KB of codegen source × 5 checks blew past the 7 GB
Ubuntu/macOS runner limit ("hosted runner lost communication with
the server" after 25 min on macOS, 55 min on Ubuntu).

test_explicit_imports(...) initializes file_analysis once at the
start and passes it to every internal test_* call, so the AST walk
runs a single time. Dropped local runtime from 13m35s → 2m33s.

Keeps the same semantic coverage as before:
- `all_explicit_imports_are_public = false`  — WasmTarget reaches
  into Base/Core/Compiler internals on purpose (it's a compiler)
- `all_qualified_accesses_are_public = false`  — same reason
- `no_self_qualified_accesses = (; ignore=(:optimize,))` — the
  optimize kwarg on compile_* shadows the exported function, so
  `WasmTarget.optimize(...)` is the only way to reach it inside
  those methods

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ExplicitImports emits `@warn default_param_context reached recursion
limit` once per deeply-nested type parameter it can't fully walk.
For a compiler package like WasmTarget this fires thousands of times
and each warning dumps the entire unresolved `ImplicitCursor{...}`
type — a multi-MB blob per warning. GitHub's log viewer truncates
around 4 MB with "This step has been truncated due to its large
size", which makes any real failure impossible to locate.

The previous run's log was 235 MB of exactly those ~3 KB type dumps
with the test summary buried at the bottom.

Filter just that one warning text with a lightweight AbstractLogger
wrapper. All other log messages still pass through to the user.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ExplicitImports spent 13 min on the codegen analysis locally, OOM'd
Ubuntu+macOS CI runners, and dumped thousands of multi-MB recursion
warnings that made logs unreadable. Not worth the operational cost
for this package. The intrinsic-reach-into-Base nature of a compiler
is also fundamentally at odds with ExplicitImports' "are_public"
model.

Reverts only the ExplicitImports wiring:
- delete test/test_explicit_imports.jl
- drop include from test/runtests.jl
- drop ExplicitImports from [extras]/[compat]/[targets]
- drop badge from README

Aqua (all 11 sub-checks passing in ~6 s) and the JSON 1.x migration
(the actual bug fix for the 657-test regression on main) stay.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Dale-Black Dale-Black changed the title test: add Aqua + ExplicitImports QA; migrate to JSON 1.x test: add Aqua QA; migrate to JSON 1.x Apr 20, 2026
@Dale-Black Dale-Black merged commit 5d82291 into main Apr 20, 2026
3 checks passed
@Dale-Black Dale-Black deleted the aqua-and-explicit-imports branch April 20, 2026 22:26
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