Skip to content

Fix sampled matrix integration over dimensional axes#342

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-sampled-unitful-axis
Jul 8, 2026
Merged

Fix sampled matrix integration over dimensional axes#342
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-sampled-unitful-axis

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

This PR should be ignored until reviewed by @ChrisRackauckas.

Summary

  • Fix the sampled matrix fast path to allocate its accumulator using the weight * sample result type instead of eltype(data).
  • Add a Unitful regression test for SampledIntegralProblem(data, axis; dim = 2) with a dimensional axis.
  • Add Unitful as a test-only dependency through the main package test target.

Fixes #341.

Tests

  • Reproduced the original failure on the unmodified branch with Julia 1.12.6: DimensionError: 0.0 and 0.5 m are not dimensionally compatible at src/sampled.jl:79.
  • GROUP=Core timeout 3600 /home/crackauc/.juliaup/bin/julia +1.12 --project=. -e 'using Pkg; Pkg.test()'
    • Core/sampled_tests.jl: 30 passed
    • Core/interface_tests.jl: 871 passed
    • Core/inf_integral_tests.jl: 746 passed
    • overall: Testing Integrals tests passed
  • GROUP=AD timeout 7200 /home/crackauc/.juliaup/bin/julia +1.10 --project=. -e 'using Pkg; Pkg.test()'
    • AD/derivative_tests.jl: 2005 passed, 1176 broken
    • AD/nested_ad_tests.jl: 6 passed
    • overall: Testing Integrals tests passed
  • Runic v1.7.0: /home/crackauc/.juliaup/bin/julia +1.12 --project=.runic -e 'using Runic; exit(Runic.main(ARGS))' -- --check .

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review July 8, 2026 03:55
@ChrisRackauckas ChrisRackauckas merged commit 9a80e3d into SciML:master Jul 8, 2026
11 checks passed
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.

SampledIntegralProblem matrix integration over non-float axis fails in v5 fast path

2 participants