Skip to content

Use PreallocationTools warn_on_resize instead of NullLogger workaround - #459

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:use-warn-on-resize
Mar 25, 2026
Merged

Use PreallocationTools warn_on_resize instead of NullLogger workaround#459
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:use-warn-on-resize

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

  • PreallocationTools v1.2.0 (SciML/PreallocationTools.jl#161) added a warn_on_resize keyword argument to DiffCache
  • This PR replaces the Logging.with_logger(NullLogger()) workaround in get_tmp with the cleaner DiffCache(...; warn_on_resize=false) at construction time
  • Removes the Logging dependency from BoundaryValueDiffEqCore since it is no longer needed
  • Bumps PreallocationTools compat from "0.4, 1" to "1.2"

Changes

  • lib/BoundaryValueDiffEqCore/src/types.jl: Replaced the custom get_tmp wrapper (which suppressed warnings via NullLogger) with a simple passthrough. Added warn_on_resize=false to both DiffCache constructor calls in __maybe_allocate_diffcache.
  • lib/BoundaryValueDiffEqCore/src/BoundaryValueDiffEqCore.jl: Removed using Logging: Logging
  • lib/BoundaryValueDiffEqCore/Project.toml: Removed Logging dep/compat, bumped PreallocationTools compat to 1.2

Test plan

  • CI passes with the updated PreallocationTools compat
  • BVP solvers still work correctly without the NullLogger workaround

🤖 Generated with Claude Code

PreallocationTools v1.2 added a `warn_on_resize` option to DiffCache.
Use `DiffCache(...; warn_on_resize=false)` at construction time instead
of wrapping every `get_tmp` call in `Logging.with_logger(NullLogger())`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisRackauckas
ChrisRackauckas merged commit d327817 into SciML:master Mar 25, 2026
11 of 24 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Click to check benchmark results
master 82d776a... master / 82d776a...
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK2() 0.581 ± 0.016 s 0.579 ± 0.013 s 1 ± 0.037
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK3() 12.4 ± 0.49 ms 12.4 ± 0.57 ms 0.994 ± 0.06
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK4() 2.39 ± 0.15 ms 2.36 ± 0.15 ms 1.01 ± 0.088
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK5() 2.92 ± 0.5 ms 2.89 ± 0.51 ms 1.01 ± 0.25
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK6() 1.13 ± 0.25 ms 1.13 ± 0.25 ms 0.998 ± 0.31
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 2.55 ± 0.73 ms 2.57 ± 0.72 ms 0.995 ± 0.4
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 5.05 ± 1.3 ms 5.07 ± 1.3 ms 0.995 ± 0.36
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.0699 ± 0.013 s 0.0725 ± 0.012 s 0.965 ± 0.24
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.104 ± 0.03 s 0.106 ± 0.027 s 0.984 ± 0.38
Simple Pendulum/IIP/Shooting(Tsit5()) 0.309 ± 0.097 ms 0.304 ± 0.093 ms 1.02 ± 0.45
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK2() 0.747 ± 0.02 s 0.771 ± 0.013 s 0.969 ± 0.031
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK3() 15.1 ± 5.5 ms 15.3 ± 6.2 ms 0.987 ± 0.54
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK4() 2.77 ± 0.15 ms 2.79 ± 0.17 ms 0.993 ± 0.08
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK5() 3.46 ± 0.23 ms 3.47 ± 0.21 ms 0.997 ± 0.089
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK6() 1.33 ± 0.15 ms 1.34 ± 0.15 ms 0.995 ± 0.16
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 3.72 ± 3.3 ms 3.64 ± 3.3 ms 1.02 ± 1.3
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 7.31 ± 6.7 ms 7.36 ± 6.4 ms 0.993 ± 1.3
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.088 ± 0.0035 s 0.0877 ± 0.0034 s 1 ± 0.056
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.137 ± 0.0056 s 0.136 ± 0.0061 s 1.01 ± 0.062
Simple Pendulum/OOP/Shooting(Tsit5()) 0.609 ± 0.061 ms 0.612 ± 0.056 ms 0.996 ± 0.14
time_to_load 7.21 ± 0.058 s 7.26 ± 0.052 s 0.993 ± 0.011
### Benchmark Plots A plot of the benchmark results has been uploaded as an artifact to the workflow run for this PR. Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

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.

2 participants