Repository navigation
Update JET to 0.12 and run the package analysis in CI - #570
Merged
Merged
Conversation
Mooncake 0.5.45 lifted its `JET = "0.9 - 0.11"` cap, so JET 0.12 is now resolvable. Add `test/other/jet.jl`, which runs `JET.test_package` over TensorKit, and gate it in `runtests.jl`. JET 0.12 only works on Julia 1.12+; on older versions it loads empty stubs and signals this through `JET_AVAILABLE`. Whole-package analysis is therefore pinned to the 0.12 generation, so its reports need not be curated for several JET/Julia combinations. Mooncake's tangent tests reach JET through Mooncake's extension and work with any functional JET, so they are gated separately. The `Mooncake = "0.5.45"` floor is load-bearing: with an older Mooncake the resolver settles on JET 0.11 and the analysis would be silently skipped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four latent bugs on paths that no test exercises:
- `@planar ... order=(...)` called a bare `normalizeindex`, which is not in
scope: an outright `UndefVarError`. Nothing tests `order=`.
- `_extract_contraction_pairs` interpolated `$ex` into its error message, but
the argument is named `rhs`, so constructing the error threw instead.
- `src/tensors/linalg.jl` threw `DimensionError`, which does not exist; the
intended type is `IndexError`.
- `numout`/`numin`'s fallbacks built `MethodError(f, T)` from a bare type.
`MethodError`'s second field must be the argument *tuple*, so `showerror`
itself threw `ErrorException("expected tuple type")` and the intended error
was never printable. Every other site in the file already uses `(T,)`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
No behavioural changes; each hunk silences a report that JET cannot see through.
Inference cannot narrow a `local` binding that is only assigned inside a branch,
so replace the sentinel-by-undefinedness idiom with real sentinel values:
`@cached`'s `hasparams`/`typed` flags become `nothing` checks on `params`/`typeex`,
`planar_trace`'s `local i, j` becomes `i = j = 0`, and `_construct_braidingtensors!`
tracks `V1`/`V2` as `nothing` rather than via `foundV1`/`foundV2`.
`OneOrNoneIterator`'s default `state = true` is a `Bool`, but a recursive call
passes an `Int`, so `if state` is reported as a non-boolean context; `isone`
accepts both and keeps the `Bool` default.
`fusiontensor` used `TupleTools.prod(d)` on a value inferred as
`Union{Tuple, NamedTuple}`; `reshape(F, :, sz[end])` computes the same leading
dimension without the union split.
The remaining reports came from functions that serve both tensors and spaces
under one name. Julia narrows a slot after a call that would otherwise throw a
`MethodError`, so an untyped argument passed to such a function is refined to
`Union{AbstractTensorMap, TensorMapSpace}` rather than to a tensor, and the next
call splits on a branch that has no method.
`_braid!`/`_transpose!` are fixed structurally rather than by annotation: they
now take `space(tdst)`/`space(tsrc)` once and pass the spaces to both
`spacecheck_transform` and `treebraider`/`treetransposer`, whose tensor-accepting
forwarding methods are therefore removed. `permute!`/`braid!`/`transpose!` likewise
pass spaces to `spacecheck_transform`, so its tensor-accepting method is removed too. `space` has no space-accepting method,
so this narrows the arguments on its own, and the non-dense path now computes two
spaces instead of four.
Where no such restructuring applies, the contract is written down instead:
`_trace_permute!` (matching `add_transform!` next door), the
`UniqueTreeTransformer`/`GenericTreeTransformer` constructors (`::HomSpace`,
their only caller always passes one), `parenttype(::Type{Union{}})`, and the
primal `A` of `trace_permute_pullback_ΔA!`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- `_recouple!`: pass `true`/`false` as gemm scalars so they cannot be union-split independently of `U`'s eltype - `nothing_or_block`: only accept a `Diagonal` wrapping a `SectorVector`, the only one `block` supports - `_fsbraid`: assert the `FusionTreeBlock` before the final `repartition` - drop `numind(::AbstractTensorMap)`, which the generic `numind(x) = numin(x) + numout(x)` already covers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TensorKit has no schur implementation for tensors, so `schur_full`/`schur_vals` already fail in `select_algorithm`. The forwarding methods only gave JET an unimplemented `DiagonalAlgorithm` path to report; MatrixAlgebraKit#276 itself has been fixed upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kshyatt
approved these changes
Oct 15, 2026
lkdvos
enabled auto-merge (squash)
October 15, 2026 15:08
Member
|
ROCm tests shouldn't be affected by this, I'll force merge |
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.
Replaces #495. Bumps the test compat to
JET = "0.9, 0.12"and addstest/other/jet.jl, which runsJET.test_packageover TensorKit, plus fixes for what it reports.This also fixes the current Pkg resolution failures on
main: CI's Julia1is now 1.13, where only JET 0.12 is installable, andmainstill caps JET at 0.11.Commits
other/jetonly runs whereJET.JET_AVAILABLE(Julia 1.12+, JET 0.12);mooncake/tangentis gated separately since it works with any functional JET.@planar ... order=(...)called an out-of-scopenormalizeindex(UndefVarError)._extract_contraction_pairsinterpolated an undefined$exinto its error message.linalg.jlthrew a nonexistentDimensionErrorinstead ofIndexError.numout/numinfallbacks builtMethodError(f, T)instead ofMethodError(f, (T,)), soshowerroritself threw.locals (@cached,planar_trace,_construct_braidingtensors!), type annotations where union-widened arguments split onto branches with no method, and_braid!/_transpose!/permute!/braid!/transpose!pass spaces tospacecheck_transform/treebraider/treetransposer, whose tensor-accepting methods are removed.mainsince (storagetype-adapted treetransformers #556, Add Enzyme rules for factorizations #464):_recouple!gemm scalars,nothing_or_blockrestricted toSectorVector-backedDiagonals, aFusionTreeBlockassertion in_fsbraid, and the redundantnumind(::AbstractTensorMap)removed.DefaultAlgorithmforwarding. TensorKit has no schur implementation for tensors, soschur_full/schur_valsalready errored; the forwarding only gave JET an unimplemented path to report.Remaining filter
JET#860: a false positive from Base's
@debugexpansion insideGenericTreeTransformer. The MatrixAlgebraKit#276 filter is gone; the fix is released.🤖 Generated with Claude Code