Skip to content

Move code depending on CausalInference.jl into extension#523

Open
pat-alt wants to merge 5 commits intomainfrom
causal-inference-broken
Open

Move code depending on CausalInference.jl into extension#523
pat-alt wants to merge 5 commits intomainfrom
causal-inference-broken

Conversation

@pat-alt
Copy link
Copy Markdown
Member

@pat-alt pat-alt commented Mar 15, 2026

This moves all code depending on CausalInference.jl into an extension to avoid the strong dependency (closes #465). I've noticed that the package is no longer precompiling due to an issue with CausalInference.jl (full stack trace below).

@mschauer @JorgeLuizFranco

(@v1.12) pkg> add CounterfactualExplanations
   Resolving package versions...
    Updating `~/.julia/environments/v1.12/Project.toml`
  [2f13d31b] + CounterfactualExplanations v1.5.0
    Updating `~/.julia/environments/v1.12/Manifest.toml`
  [47edcb42] + ADTypes v1.21.0
  [621f4979] + AbstractFFTs v1.5.0
  [7d9f7c33] + Accessors v0.1.43
  [79e6a3ab] + Adapt v4.5.0
  [dce04be8] + ArgCheck v2.5.0
  [ec485272] + ArnoldiMethod v0.4.0
  [7d9fca2a] + Arpack v0.5.4
  [a9b6321e] + Atomix v1.1.2
  [198e06fe] + BangBang v0.4.8
  [9718e550] + Baselet v0.1.1
  [324d7699] + CategoricalArrays v1.0.2
  [af321ab8] + CategoricalDistributions v0.2.1
  [8e462317] + CausalInference v0.19.2
  [082447d4] + ChainRules v1.73.0
  [d360d2e6] + ChainRulesCore v1.26.0
  [0b6fb165] + ChunkCodecCore v1.0.1
  [4c0bbee4] + ChunkCodecLibZlib v1.0.0
  [55437552] + ChunkCodecLibZstd v1.0.0
  [60701a23] + CliqueTrees v1.17.1
  [08986516] + Collects v1.1.0
  [861a8166] + Combinatorics v1.1.0
  [bbf7d656] + CommonSubexpressions v0.3.1
  [a33af91c] + CompositionsBase v0.1.2
  [ed09eef8] + ComputationalResources v0.3.2
  [187b0558] + ConstructionBase v1.6.0
  [6add18c4] + ContextVariablesX v0.1.3
  [2f13d31b] + CounterfactualExplanations v1.5.0
  [a93c6f00] + DataFrames v1.8.1
  [7806a523] + DecisionTree v0.12.4
  [244e2a9f] + DefineSingletons v0.1.2
  [163ba53b] + DiffResults v1.1.0
  [b552c78f] + DiffRules v1.15.1
  [a0c0ee7d] + DifferentiationInterface v0.7.16
  [b4f34e82] + Distances v0.10.12
  [31c24e10] + Distributions v0.25.123
  [f446124b] + EnergySamplers v1.0.4
  [f151be2c] + EnzymeCore v0.8.18
  [cc61a311] + FLoops v0.2.2
  [b9860ae5] + FLoopsBase v0.1.1
  [1a297f60] + FillArrays v1.16.0
  [3821ddf9] + FixedSizeArrays v1.3.0
  [587475ba] + Flux v0.16.9
  [f6369f11] + ForwardDiff v1.3.2
  [d9f16b24] + Functors v0.5.2
  [46192b85] + GPUArraysCore v0.2.0
  [86223c79] + Graphs v1.14.0
  [076d061b] + HashArrayMappedTries v0.2.0
  [34004b35] + HypergeometricFunctions v0.3.28
  [7869d1d1] + IRTools v0.4.15
  [d25df0c9] + Inflate v0.1.5
  [22cec73e] + InitialValues v0.3.1
  [842dd82b] + InlineStrings v1.4.5
  [3587e190] + InverseFunctions v0.1.17
  [41ab1584] + InvertedIndices v1.3.1
  [033835bb] + JLD2 v0.6.3
  [b14d175d] + JuliaVariables v0.2.4
  [63c18a36] + KernelAbstractions v0.9.40
⌅ [ec8451be] + KernelFunctions v0.10.67
  [8ac3fa9e] + LRUCache v1.6.2
  [92ad9a40] + LearnAPI v2.0.1
  [aa2f6b4e] + LogarithmicNumbers v1.4.1
  [c2834f40] + MLCore v1.0.0
  [7e8f7934] + MLDataDevices v1.17.4
  [a7f614a8] + MLJBase v1.12.1
  [c6f25543] + MLJDecisionTreeInterface v0.4.4
  [e80e1ace] + MLJModelInterface v1.12.1
  [d8e11817] + MLStyle v0.4.17
  [f1d291b0] + MLUtils v0.4.8
  [6fafb56a] + Memoization v0.2.2
⌅ [626554b9] + MetaGraphs v0.8.1
  [128add7d] + MicroCollections v0.2.0
  [6f286f6a] + MultivariateStats v0.10.4
  [872c559c] + NNlib v0.9.33
  [71a1bf82] + NameResolution v0.1.5
  [b8a86587] + NearestNeighbors v0.4.27
  [6fe1bfb0] + OffsetArrays v1.17.0
  [0b1bfda6] + OneHotArrays v0.2.10
  [3bd65402] + Optimisers v0.4.7
  [90014a1f] + PDMats v0.11.37
  [65ce6f38] + PackageExtensionCompat v1.0.2
  [2dfb63ee] + PooledArrays v1.4.3
  [8162dcfd] + PrettyPrint v0.2.0
  [08abe8d2] + PrettyTables v3.2.3
  [92933f4c] + ProgressMeter v1.11.0
  [1fd47b50] + QuadGK v2.11.2
  [c1ae055f] + RealDot v0.1.0
  [42d2dcc6] + Referenceables v0.1.3
  [79098fc4] + Rmath v0.9.0
  [431bcebd] + SciMLPublic v1.0.1
  [321657f4] + ScientificTypes v3.2.0
  [30f210dd] + ScientificTypesBase v3.1.0
  [6e75b9c4] + ScikitLearnBase v0.5.0
  [7e506255] + ScopedValues v1.6.0
  [91c51154] + SentinelArrays v1.4.9
  [efcf1570] + Setfield v1.1.2
  [605ecd9f] + ShowCases v0.1.0
  [699a6c99] + SimpleTraits v0.9.5
  [dc90abb0] + SparseInverseSubset v0.1.2
  [276daf66] + SpecialFunctions v2.7.1
  [171d559e] + SplittablesBase v0.1.15
  [90137ffa] + StaticArrays v1.9.18
  [1e83bf80] + StaticArraysCore v1.4.4
  [c062fc1d] + StatisticalMeasuresBase v0.1.3
  [64bff920] + StatisticalTraits v3.5.0
  [4c63d2b9] + StatsFuns v1.5.2
  [892a3eda] + StringManipulation v0.4.4
  [09ab397b] + StructArrays v0.7.2
  [3eeacb1d] + TabularDisplay v1.3.0
  [10284c91] + TaijaBase v1.2.3
  [ac1d9e8a] + ThreadsX v0.1.12
  [28d57a85] + Transducers v0.4.85
  [013be700] + UnsafeAtomics v0.3.0
  [e88e6eb3] + Zygote v0.7.10
  [700de1a5] + ZygoteRules v0.2.7
⌅ [68821587] + Arpack_jll v3.5.2+0
  [efe28fd5] + OpenSpecFun_jll v0.5.6+0
  [f50d1b31] + Rmath_jll v0.5.1+0
  [8ba89e20] + Distributed v1.11.0
  [9fa8497b] + Future v1.11.0
  [4af54fe1] + LazyArtifacts v1.11.0
  [4607b0f0] + SuiteSparse
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
  ✗ CausalInference
  ✗ CounterfactualExplanations
  ✗ CounterfactualExplanations  DecisionTreeExt
Precompiling packages finished.
  0 dependencies successfully precompiled in 36 seconds. 476 already precompiled.
  3 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 2 direct dependencies failed to precompile:

CounterfactualExplanations  DecisionTreeExt

Failed to precompile DecisionTreeExt [5370ada7-daca-5ee7-9ed3-cddd3c2cf6f4] to "/Users/paltmeyer/.julia/compiled/v1.12/DecisionTreeExt/jl_0pLbxZ".
ERROR: LoadError: MethodError: no method matching sorted_intersect_(::Graphs.FrozenVector{Int64}, ::Graphs.FrozenVector{Int64})
The function `sorted_intersect_` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  sorted_intersect_(::Vector{T}, ::Vector{T}) where T
   @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/pdag.jl:171

Stacktrace:
  [1] neighbors_undirected(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/pdag.jl:128
  [2] tails_and_adj_neighbors(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64, y::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:204
  [3] score_edge_inserts(score::Float64, dataParsed::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64, y::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:217
  [4] (::CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}})(::Tuple{Int64, Int64})
    @ CausalInference ./none:-1
  [5] MappingRF
    @ ./reduce.jl:92 [inlined]
  [6] FilteringRF
    @ ./reduce.jl:104 [inlined]
  [7] _foldl_impl
    @ ./reduce.jl:54 [inlined]
  [8] foldl_impl(op::Base.FilteringRF{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.MappingRF{CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.BottomRF{typeof(CausalInference.best)}}}, nt::Base._InitialValue, itr::Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
    @ Base ./reduce.jl:40
  [9] mapfoldl_impl(f::typeof(identity), op::typeof(CausalInference.best), nt::Base._InitialValue, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}})
    @ Base ./reduce.jl:36
 [10] mapfoldl(f::Function, op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; init::Base._InitialValue)
    @ Base ./reduce.jl:167
 [11] mapreduce(f::Function, op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; kw::@Kwargs{})
    @ Base ./reduce.jl:299
 [12] reduce(op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; kw::@Kwargs{})
    @ Base ./reduce.jl:479
 [13] find_best_insert(score::Float64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:182
 [14] ges_forward_search!(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, score::Float64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:124
 [15] macro expansion
    @ ./timing.jl:461 [inlined]
 [16] ges(n::Int64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}; score::Float64, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:54
 [17] ges
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:49 [inlined]
 [18] #ges#72
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:34 [inlined]
 [19] ges
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:28 [inlined]
 [20] #ges#73
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:41 [inlined]
 [21] macro expansion
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:14 [inlined]
 [22] macro expansion
    @ ~/.julia/packages/PrecompileTools/gn08A/src/workloads.jl:73 [inlined]
 [23] macro expansion
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:13 [inlined]
 [24] macro expansion
    @ ~/.julia/packages/PrecompileTools/gn08A/src/workloads.jl:121 [inlined]
 [25] top-level scope
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:118
 [26] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [27] top-level scope
    @ ~/.julia/packages/CausalInference/c2bzn/src/CausalInference.jl:54
 [28] include(mod::Module, _path::String)
    @ Base ./Base.jl:306
 [29] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:3024
 [30] top-level scope
    @ stdin:5
 [31] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [32] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2870
 [33] include_string
    @ ./loading.jl:2880 [inlined]
 [34] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:315
 [35] _start()
    @ Base ./client.jl:550
in expression starting at /Users/paltmeyer/.julia/packages/CausalInference/c2bzn/src/workloads.jl:3
in expression starting at /Users/paltmeyer/.julia/packages/CausalInference/c2bzn/src/CausalInference.jl:1
in expression starting at stdin:5
ERROR: LoadError: Failed to precompile CausalInference [8e462317-f959-576b-b3c1-403f26cec956] to "/Users/paltmeyer/.julia/compiled/v1.12/CausalInference/jl_MkiTKs".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:44
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
    @ Base ./loading.jl:3311
  [3] (::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}})()
    @ Base ./loading.jl:2679
  [4] mkpidlock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:93
  [5] #mkpidlock#7
    @ ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:88 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:114
  [7] #invokelatest_gr#232
    @ ./reflection.jl:1297 [inlined]
  [8] invokelatest_gr
    @ ./reflection.jl:1289 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3882
 [10] maybe_cachefile_lock
    @ ./loading.jl:3879 [inlined]
 [11] __require_prelocked(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2665
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2493
 [13] macro expansion
    @ ./loading.jl:2421 [inlined]
 [14] macro expansion
    @ ./lock.jl:376 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2386
 [16] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2362
 [17] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [18] top-level scope
    @ ~/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/DataPreprocessing.jl:13
 [19] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [20] top-level scope
    @ ~/.julia/packages/CounterfactualExplanations/178eM/src/CounterfactualExplanations.jl:47
 [21] include(mod::Module, _path::String)
    @ Base ./Base.jl:306
 [22] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:3024
 [23] top-level scope
    @ stdin:5
 [24] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [25] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2870
 [26] include_string
    @ ./loading.jl:2880 [inlined]
 [27] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:315
 [28] _start()
    @ Base ./client.jl:550
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/counterfactual_data.jl:7
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/DataPreprocessing.jl:1
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/CounterfactualExplanations.jl:1
in expression starting at stdin:5
ERROR: LoadError: Failed to precompile CounterfactualExplanations [2f13d31b-18db-44c1-bc43-ebaf2cff0be0] to "/Users/paltmeyer/.julia/compiled/v1.12/CounterfactualExplanations/jl_vhBBSZ".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:44
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
    @ Base ./loading.jl:3311
  [3] (::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}})()
    @ Base ./loading.jl:2679
  [4] mkpidlock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:93
  [5] #mkpidlock#7
    @ ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:88 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:114
  [7] #invokelatest_gr#232
    @ ./reflection.jl:1297 [inlined]
  [8] invokelatest_gr
    @ ./reflection.jl:1289 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3882
 [10] maybe_cachefile_lock
    @ ./loading.jl:3879 [inlined]
 [11] __require_prelocked(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2665
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2493
 [13] macro expansion
    @ ./loading.jl:2421 [inlined]
 [14] macro expansion
    @ ./lock.jl:376 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2386
 [16] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2362
 [17] top-level scope
    @ ~/.julia/packages/CounterfactualExplanations/178eM/ext/DecisionTreeExt/DecisionTreeExt.jl:3
 [18] include(mod::Module, _path::String)
    @ Base ./Base.jl:306
 [19] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:3024
 [20] top-level scope
    @ stdin:5
 [21] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [22] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2870
 [23] include_string
    @ ./loading.jl:2880 [inlined]
 [24] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:315
 [25] _start()
    @ Base ./client.jl:550
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/ext/DecisionTreeExt/DecisionTreeExt.jl:1
in expression starting at stdin:5
CounterfactualExplanations

Failed to precompile CounterfactualExplanations [2f13d31b-18db-44c1-bc43-ebaf2cff0be0] to "/Users/paltmeyer/.julia/compiled/v1.12/CounterfactualExplanations/jl_cgITIE".
ERROR: LoadError: MethodError: no method matching sorted_intersect_(::Graphs.FrozenVector{Int64}, ::Graphs.FrozenVector{Int64})
The function `sorted_intersect_` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  sorted_intersect_(::Vector{T}, ::Vector{T}) where T
   @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/pdag.jl:171

Stacktrace:
  [1] neighbors_undirected(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/pdag.jl:128
  [2] tails_and_adj_neighbors(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64, y::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:204
  [3] score_edge_inserts(score::Float64, dataParsed::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, x::Int64, y::Int64)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:217
  [4] (::CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}})(::Tuple{Int64, Int64})
    @ CausalInference ./none:-1
  [5] MappingRF
    @ ./reduce.jl:92 [inlined]
  [6] FilteringRF
    @ ./reduce.jl:104 [inlined]
  [7] _foldl_impl
    @ ./reduce.jl:54 [inlined]
  [8] foldl_impl(op::Base.FilteringRF{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.MappingRF{CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.BottomRF{typeof(CausalInference.best)}}}, nt::Base._InitialValue, itr::Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
    @ Base ./reduce.jl:40
  [9] mapfoldl_impl(f::typeof(identity), op::typeof(CausalInference.best), nt::Base._InitialValue, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}})
    @ Base ./reduce.jl:36
 [10] mapfoldl(f::Function, op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; init::Base._InitialValue)
    @ Base ./reduce.jl:167
 [11] mapreduce(f::Function, op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; kw::@Kwargs{})
    @ Base ./reduce.jl:299
 [12] reduce(op::Function, itr::Base.Generator{Base.Iterators.Filter{CausalInference.var"#find_best_insert##6#find_best_insert##7"{Graphs.SimpleGraphs.SimpleDiGraph{Int64}}, Base.Iterators.ProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}, CausalInference.var"#find_best_insert##4#find_best_insert##5"{Float64, CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}; kw::@Kwargs{})
    @ Base ./reduce.jl:479
 [13] find_best_insert(score::Float64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:182
 [14] ges_forward_search!(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, score::Float64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:124
 [15] macro expansion
    @ ./timing.jl:461 [inlined]
 [16] ges(n::Int64, data::CausalInference.GaussianScore{Float64, LinearAlgebra.Symmetric{Float64, Matrix{Float64}}}; score::Float64, parallel::Bool, verbose::Bool)
    @ CausalInference ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:54
 [17] ges
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:49 [inlined]
 [18] #ges#72
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:34 [inlined]
 [19] ges
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:28 [inlined]
 [20] #ges#73
    @ ~/.julia/packages/CausalInference/c2bzn/src/ges.jl:41 [inlined]
 [21] macro expansion
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:14 [inlined]
 [22] macro expansion
    @ ~/.julia/packages/PrecompileTools/gn08A/src/workloads.jl:73 [inlined]
 [23] macro expansion
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:13 [inlined]
 [24] macro expansion
    @ ~/.julia/packages/PrecompileTools/gn08A/src/workloads.jl:121 [inlined]
 [25] top-level scope
    @ ~/.julia/packages/CausalInference/c2bzn/src/workloads.jl:118
 [26] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [27] top-level scope
    @ ~/.julia/packages/CausalInference/c2bzn/src/CausalInference.jl:54
 [28] include(mod::Module, _path::String)
    @ Base ./Base.jl:306
 [29] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:3024
 [30] top-level scope
    @ stdin:5
 [31] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [32] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2870
 [33] include_string
    @ ./loading.jl:2880 [inlined]
 [34] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:315
 [35] _start()
    @ Base ./client.jl:550
in expression starting at /Users/paltmeyer/.julia/packages/CausalInference/c2bzn/src/workloads.jl:3
in expression starting at /Users/paltmeyer/.julia/packages/CausalInference/c2bzn/src/CausalInference.jl:1
in expression starting at stdin:5
ERROR: LoadError: Failed to precompile CausalInference [8e462317-f959-576b-b3c1-403f26cec956] to "/Users/paltmeyer/.julia/compiled/v1.12/CausalInference/jl_SAfWRf".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:44
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
    @ Base ./loading.jl:3311
  [3] (::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}})()
    @ Base ./loading.jl:2679
  [4] mkpidlock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:93
  [5] #mkpidlock#7
    @ ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:88 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.12.5+0.aarch64.apple.darwin14/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:114
  [7] #invokelatest_gr#232
    @ ./reflection.jl:1297 [inlined]
  [8] invokelatest_gr
    @ ./reflection.jl:1289 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId, String, Dict{String, Int64}}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3882
 [10] maybe_cachefile_lock
    @ ./loading.jl:3879 [inlined]
 [11] __require_prelocked(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2665
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2493
 [13] macro expansion
    @ ./loading.jl:2421 [inlined]
 [14] macro expansion
    @ ./lock.jl:376 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2386
 [16] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2362
 [17] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [18] top-level scope
    @ ~/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/DataPreprocessing.jl:13
 [19] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [20] top-level scope
    @ ~/.julia/packages/CounterfactualExplanations/178eM/src/CounterfactualExplanations.jl:47
 [21] include(mod::Module, _path::String)
    @ Base ./Base.jl:306
 [22] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:3024
 [23] top-level scope
    @ stdin:5
 [24] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [25] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2870
 [26] include_string
    @ ./loading.jl:2880 [inlined]
 [27] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:315
 [28] _start()
    @ Base ./client.jl:550
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/counterfactual_data.jl:7
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/data_preprocessing/DataPreprocessing.jl:1
in expression starting at /Users/paltmeyer/.julia/packages/CounterfactualExplanations/178eM/src/CounterfactualExplanations.jl:1
in expression starting at stdin:5

@pat-alt
Copy link
Copy Markdown
Member Author

pat-alt commented Mar 15, 2026

Extension not yet tested since I can't precompile CI.jl

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 15.00000% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.29%. Comparing base (c634199) to head (1fe7d51).

Files with missing lines Patch % Lines
ext/CausalInferenceExt/CausalInferenceExt.jl 0.00% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
- Coverage   91.08%   90.29%   -0.79%     
==========================================
  Files          92       93       +1     
  Lines        2265     2267       +2     
==========================================
- Hits         2063     2047      -16     
- Misses        202      220      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JorgeLuizFranco
Copy link
Copy Markdown
Contributor

Extension not yet tested since I can't precompile CI.jl

Hello, Patrick. Yes, I checked here. Lets wait for Moritz answer, maybe we can fix this and open a PR also in CausalInference.jl . Thank you for noticing!

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.

Move MINT functionality into extensions to avoid depending on CausalInference

2 participants