Skip to content

Conversation

@mofeing
Copy link
Collaborator

@mofeing mofeing commented Dec 9, 2025

fixes #1943

@baggepinnen
Copy link

The error went away 🎉

Still got tripped up on

julia> allowscalar(true)
┌ Warning: It's not recommended to use allowscalar([true]) to allow scalar indexing.
│ Instead, use `allowscalar() do end` or `@allowscalar` to denote exactly which operations can use scalar operations.
└ @ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:184

julia> cr = @compile create(Ar, Br, Cr, Q1r, Q2r, Q3r, Ts, umin_r, umax_r; Np=20)
ERROR: MethodError: no method matching exp!(::Reactant.TracedRArray{Float64, 2})
The function `exp!` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  exp!(::StridedMatrix{T}) where T<:Union{Float32, Float64, ComplexF64, ComplexF32}
   @ LinearAlgebra ~/.julia/juliaup/julia-1.12.2+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/dense.jl:726

but that's another story

@mofeing mofeing changed the title Try fix stricter module name resolution in Julia 1.12 Fix stricter module name resolution in Julia 1.12 Dec 18, 2025
@mofeing
Copy link
Collaborator Author

mofeing commented Dec 18, 2025

It seems like the ExplicitImport "Self Qualified Accesses" tests are failing on exactly the solution to this bug:

Module `Reactant` has self-qualified accesses:
  - `MLIR` was accessed as `Reactant.MLIR` inside `Reactant` at `/Users/runner/work/Reactant.jl/Reactant.jl/src/utils.jl:247:44`
  - `Ops` was accessed as `Reactant.Ops` inside `Reactant` at `/Users/runner/work/Reactant.jl/Reactant.jl/src/utils.jl:245:43`
  - `TracedUtils` was accessed as `Reactant.TracedUtils` inside `Reactant` at `/Users/runner/work/Reactant.jl/Reactant.jl/src/utils.jl:246:44`

Problem is that the "utils.jl" is included before the Ops and TracedUtils modules are defined, and apparently, in Julia 1.12, this is no longer valid due to some stricter module name resolution (checkout error message in #1943).

It should also be fixable by moving the include("utils.jl") to the end but that looks a lil bit fragile to me...

@avik-pal is it ok if we relax the "Self Qualified Accesses" test?

@avik-pal
Copy link
Collaborator

@ericphanson would you happen to know if there is a fix to this other than disabling the check?

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.

UndefVarError: Ops not defined in Reactant

4 participants