You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BatchIntegralFunction: VEGAS in-place crashes with default max_batch; HCubatureJL gives bare AssertionError #377
Two failures with BatchIntegralFunction on master (63b17e8, v5.5.2, Julia 1.12.4):
using Integrals
f_iip!(y, x, p) = (y .=vec(sum(abs2, x; dims =1)); nothing)
bf =BatchIntegralFunction(f_iip!, zeros(0))
try
sol =solve(IntegralProblem(bf, ([0.0, 0.0], [1.0, 1.0])), VEGAS(); abstol =1e-3, reltol =1e-3)
println("V1 default max_batch: ok ", sol.u)
catch e
println("V1 default max_batch: ", first(split(sprint(showerror, e), '\n')))
end
sol =solve(IntegralProblem(BatchIntegralFunction(f_iip!, zeros(0); max_batch =1000), ([0.0, 0.0], [1.0, 1.0])), VEGAS(); abstol =1e-3, reltol =1e-3)
println("V1 max_batch=1000: ", sol.u)
g(x, p) =sum(abs2, x; dims =1) |> vec
try
sol =solve(IntegralProblem(BatchIntegralFunction(g), ([0.0, 0.0], [1.0, 1.0])), HCubatureJL())
println("G3: ok ", sol.u)
catch e
println("G3: ", typeof(e), "", first(split(sprint(showerror, e), '\n')))
end
V1 default max_batch: ArgumentError: invalid GenericMemory size: the number of elements is either negative or too large for system address width
V1 max_batch=1000: 0.6670047238153245
G3: AssertionError AssertionError: f isa IntegralFunction
VEGAS with an in-place BatchIntegralFunction and the default max_batch (typemax(Int)) crashes. The buffer is allocated with similar(prototype, …, max_batch) (src/Integrals.jl:431-435). It should be sized by the batch size VEGAS actually requests, or by min(max_batch, <VEGAS batch size>).
HCubatureJL with a batched integrand fails with a bare @assert f isa IntegralFunction (src/Integrals.jl:366). If batching isn't supported for HCubatureJL, this should be an ArgumentError that says so and names the algorithms that do support batching (QuadGKJL, VEGAS, …).
Found during the SciML performance/genericity audit.
Activity
ChrisRackauckas-Claude commentedon Nov 10, 2026
Taking this — Muse CLI Code, model muse-ember-1.0 (job 377-muse).
🤖 Posted by an AI agent — harness: Muse CLI Code · model: muse-ember-1.0
Conversation: local job 377-muse (no session URL)
Fix BatchIntegralFunction handling in VEGAS and HCubatureJL (#390)