Skip to content

Conversation

evetion
Copy link
Member

@evetion evetion commented Apr 2, 2025

Update the Julia Manifest.toml to get the latest dependencies.

Changed packages

  Installing known registries into `~/.julia`
       Added `General` registry to ~/.julia/registries
    Updating registry at `~/.julia/registries/General.toml`
     Cloning git-repo `https://github.com/visr/SparseConnectivityTracer.jl`
    Updating git-repo `https://github.com/visr/SparseConnectivityTracer.jl`
    Updating `~/work/Ribasim/Ribasim/Project.toml`
  [2b5f629d] ↑ DiffEqBase v6.167.1 ⇒ v6.167.2
  [a0c0ee7d] ↑ DifferentiationInterface v0.6.49 ⇒ v0.6.50
  [86223c79] ↑ Graphs v1.12.0 ⇒ v1.12.1
  [7073ff75] ↑ IJulia v1.26.0 ⇒ v1.27.0
  [5903a43b] ↑ Infiltrator v1.8.6 ⇒ v1.8.7
  [0f8b85d8] ↑ JSON3 v1.14.1 ⇒ v1.14.2
  [7ed4a6bd] ↑ LinearSolve v3.7.0 ⇒ v3.7.2
  [fa8bd995] ↑ MetaGraphsNext v0.7.2 ⇒ v0.7.3
  [6ad6398a] ↑ OrdinaryDiffEqBDF v1.3.0 ⇒ v1.4.0
  [bbf590c4] ↑ OrdinaryDiffEqCore v1.20.0 ⇒ v1.21.0
  [127b3ac7] ↑ OrdinaryDiffEqNonlinearSolve v1.5.0 ⇒ v1.6.0
  [43230ef6] ↑ OrdinaryDiffEqRosenbrock v1.8.0 ⇒ v1.9.0
  [0bca4576] ↑ SciMLBase v2.79.0 ⇒ v2.82.0
    Updating `~/work/Ribasim/Ribasim/Manifest.toml`
  [5ba52731] ↑ CodecLz4 v0.4.5 ⇒ v0.4.6
  [3da002f7] ↑ ColorTypes v0.12.0 ⇒ v0.12.1
  [2b5f629d] ↑ DiffEqBase v6.167.1 ⇒ v6.167.2
  [a0c0ee7d] ↑ DifferentiationInterface v0.6.49 ⇒ v0.6.50
  [ffbed154] ↑ DocStringExtensions v0.9.3 ⇒ v0.9.4
  [a4df4552] ↑ FastPower v1.1.1 ⇒ v1.1.2
  [5c1252a2] ↑ GeometryBasics v0.5.6 ⇒ v0.5.7
  [86223c79] ↑ Graphs v1.12.0 ⇒ v1.12.1
  [7073ff75] ↑ IJulia v1.26.0 ⇒ v1.27.0
  [5903a43b] ↑ Infiltrator v1.8.6 ⇒ v1.8.7
  [d1acc4aa] ↑ IntervalArithmetic v0.22.26 ⇒ v0.22.27
  [0f8b85d8] ↑ JSON3 v1.14.1 ⇒ v1.14.2
  [7ed4a6bd] ↑ LinearSolve v3.7.0 ⇒ v3.7.2
  [fa8bd995] ↑ MetaGraphsNext v0.7.2 ⇒ v0.7.3
  [d41bc354] ↑ NLSolversBase v7.9.0 ⇒ v7.9.1
  [6ad6398a] ↑ OrdinaryDiffEqBDF v1.3.0 ⇒ v1.4.0
  [bbf590c4] ↑ OrdinaryDiffEqCore v1.20.0 ⇒ v1.21.0
  [4302a76b] ↑ OrdinaryDiffEqDifferentiation v1.4.0 ⇒ v1.5.0
  [127b3ac7] ↑ OrdinaryDiffEqNonlinearSolve v1.5.0 ⇒ v1.6.0
  [43230ef6] ↑ OrdinaryDiffEqRosenbrock v1.8.0 ⇒ v1.9.0
  [90014a1f] ↑ PDMats v0.11.32 ⇒ v0.11.33
  [65ce6f38] - PackageExtensionCompat v1.0.2
  [d236fae5] ↑ PreallocationTools v0.4.25 ⇒ v0.4.26
  [0bca4576] ↑ SciMLBase v2.79.0 ⇒ v2.82.0
  [47a9eef4] - SparseDiffTools v2.24.0
  [4c63d2b9] ↑ StatsFuns v1.3.2 ⇒ v1.4.0
  [19fa3120] - VertexSafeGraphs v0.2.0
  [d7e528f0] ↑ FreeType2_jll v2.13.3+1 ⇒ v2.13.4+0
  [4b2f31a3] ↑ Libmount_jll v2.40.3+0 ⇒ v2.41.0+0
  [38a345b3] ↑ Libuuid_jll v2.40.3+0 ⇒ v2.41.0+0
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/b19db3927f0db4151cb86d073689f2428e524576/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/be30be76e25b0aff2c9a85930ed3ac34c5f10c83/build.log`
        Info We haven't cleaned this depot up for a bit, running Pkg.gc()...
      Active manifest files: 1 found
      Active artifact files: 70 found
      Active scratchspaces: 2 found
     Deleted no artifacts, repos, packages or scratchspaces

Packages still outdated after update

Status `~/work/Ribasim/Ribasim/Project.toml`
All package versions

ADTypes ────────────────────────── v1.14.0
AbstractFFTs ───────────────────── v1.5.0
AbstractTrees ──────────────────── v0.4.5
Accessors ──────────────────────── v0.1.42
Adapt ──────────────────────────── v4.3.0
AdaptivePredicates ─────────────── v1.2.0
AliasTables ────────────────────── v1.1.3
Animations ─────────────────────── v0.4.2
ArgCheck ───────────────────────── v2.5.0
ArnoldiMethod ──────────────────── v0.4.0
ArrayInterface ─────────────────── v7.18.0
ArrayLayouts ───────────────────── v1.11.1
Arrow ──────────────────────────── v2.8.0
ArrowTypes ─────────────────────── v2.3.0
Automa ─────────────────────────── v1.1.0
AxisAlgorithms ─────────────────── v1.1.0
AxisArrays ─────────────────────── v0.4.7
BasicModelInterface ────────────── v0.1.1
BenchmarkTools ─────────────────── v1.6.0
BitIntegers ────────────────────── v0.3.5
BitTwiddlingConvenienceFunctions ─ v0.1.6
BracketingNonlinearSolve ───────── v1.1.2
Bzip2_jll ──────────────────────── v1.0.9+0
CEnum ──────────────────────────── v0.5.0
CPUSummary ─────────────────────── v0.2.6
CRlibm_jll ─────────────────────── v1.0.1+0
Cairo ──────────────────────────── v1.1.1
CairoMakie ─────────────────────── v0.13.2
Cairo_jll ──────────────────────── v1.18.4+0
ChainRulesCore ─────────────────── v1.25.1
CloseOpenIntervals ─────────────── v0.1.13
CodeTracking ───────────────────── v1.3.6
CodecBzip2 ─────────────────────── v0.8.5
CodecLz4 ───────────────────────── v0.4.6
CodecZlib ──────────────────────── v0.7.8
CodecZstd ──────────────────────── v0.8.6
ColorBrewer ────────────────────── v0.4.1
ColorSchemes ───────────────────── v3.29.0
ColorTypes ─────────────────────── v0.12.1
ColorVectorSpace ───────────────── v0.11.0
Colors ─────────────────────────── v0.13.0
CommonSolve ────────────────────── v0.2.4
CommonSubexpressions ───────────── v0.3.1
CommonWorldInvalidations ───────── v1.0.0
Compat ─────────────────────────── v4.16.0
CompositionsBase ───────────────── v0.1.2
ConcreteStructs ────────────────── v0.2.3
ConcurrentUtilities ────────────── v2.5.0
Conda ──────────────────────────── v1.10.2
Configurations ─────────────────── v0.17.6
ConstructionBase ───────────────── v1.5.8
Contour ────────────────────────── v0.6.3
CpuId ──────────────────────────── v0.3.1
Crayons ────────────────────────── v4.1.1
DBInterface ────────────────────── v2.6.1
DataAPI ────────────────────────── v1.16.0
DataFrames ─────────────────────── v1.7.0
DataInterpolations ─────────────── v8.0.0
DataStructures ─────────────────── v0.18.22
DataValueInterfaces ────────────── v1.0.0
DelaunayTriangulation ──────────── v1.6.4
DiffEqBase ─────────────────────── v6.167.2
DiffEqCallbacks ────────────────── v4.3.0
DiffResults ────────────────────── v1.1.0
DiffRules ──────────────────────── v1.15.1
DifferentiationInterface ───────── v0.6.50
DisplayAs ──────────────────────── v0.1.6
Distributions ──────────────────── v0.25.118
DocStringExtensions ────────────── v0.9.4
EarCut_jll ─────────────────────── v2.2.4+0
EnumX ──────────────────────────── v1.0.5
EnzymeCore ─────────────────────── v0.8.8
ExactPredicates ────────────────── v2.2.8
Expat_jll ──────────────────────── v2.6.5+0
ExprTools ──────────────────────── v0.1.10
ExproniconLite ─────────────────── v0.10.14
Extents ────────────────────────── v0.1.5
FFMPEG_jll ─────────────────────── v6.1.2+0
FFTW ───────────────────────────── v1.8.1
FFTW_jll ───────────────────────── v3.3.10+3
FastBroadcast ──────────────────── v0.3.5
FastClosures ───────────────────── v0.3.2
FastPower ──────────────────────── v1.1.2
FileIO ─────────────────────────── v1.17.0
FilePaths ──────────────────────── v0.8.3
FilePathsBase ──────────────────── v0.9.24
FillArrays ─────────────────────── v1.13.0
FindFirstFunctions ─────────────── v1.4.1
FiniteDiff ─────────────────────── v2.27.0
FixedPointNumbers ──────────────── v0.8.5
Fontconfig_jll ─────────────────── v2.15.0+0
Format ─────────────────────────── v1.3.7
ForwardDiff ────────────────────── v0.10.38
FreeType ───────────────────────── v4.1.1
FreeType2_jll ──────────────────── v2.13.4+0
FreeTypeAbstraction ────────────── v0.10.6
FriBidi_jll ────────────────────── v1.0.16+0
FunctionWrappers ───────────────── v1.1.3
FunctionWrappersWrappers ───────── v0.1.3
Functors ───────────────────────── v0.5.2
GPUArraysCore ──────────────────── v0.2.0
GeoFormatTypes ─────────────────── v0.4.4
GeoInterface ───────────────────── v1.4.1
GeometryBasics ─────────────────── v0.5.7
Gettext_jll ────────────────────── v0.21.0+0
Giflib_jll ─────────────────────── v5.2.3+0
Glib_jll ───────────────────────── v2.82.4+0
Glob ───────────────────────────── v1.3.1
Graphics ───────────────────────── v1.1.3
Graphite2_jll ──────────────────── v1.3.14+1
Graphs ─────────────────────────── v1.12.1
GridLayoutBase ─────────────────── v0.11.1
Grisu ──────────────────────────── v1.0.2
HarfBuzz_jll ───────────────────── v8.5.0+0
HiGHS ──────────────────────────── v1.15.0
HiGHS_jll ──────────────────────── v1.10.0+0
HypergeometricFunctions ────────── v0.3.28
IJulia ─────────────────────────── v1.27.0
IOCapture ──────────────────────── v0.2.5
IfElse ─────────────────────────── v0.1.1
ImageAxes ──────────────────────── v0.6.12
ImageBase ──────────────────────── v0.1.7
ImageCore ──────────────────────── v0.10.5
ImageIO ────────────────────────── v0.6.9
ImageMetadata ──────────────────── v0.9.10
Imath_jll ──────────────────────── v3.1.11+0
IndirectArrays ─────────────────── v1.0.0
Infiltrator ────────────────────── v1.8.7
Inflate ────────────────────────── v0.1.5
InlineStrings ──────────────────── v1.4.3
IntelOpenMP_jll ────────────────── v2025.0.4+0
Interpolations ─────────────────── v0.15.1
IntervalArithmetic ─────────────── v0.22.27
IntervalSets ───────────────────── v0.7.10
InverseFunctions ───────────────── v0.1.17
InvertedIndices ────────────────── v1.3.1
IrrationalConstants ────────────── v0.2.4
Isoband ────────────────────────── v0.1.1
IterTools ──────────────────────── v1.10.0
IteratorInterfaceExtensions ────── v1.0.0
JLD2 ───────────────────────────── v0.5.12
JLLWrappers ────────────────────── v1.7.0
JSON ───────────────────────────── v0.21.4
JSON3 ──────────────────────────── v1.14.2
Jieko ──────────────────────────── v0.2.1
JpegTurbo ──────────────────────── v0.1.6
JpegTurbo_jll ──────────────────── v3.1.1+0
JuMP ───────────────────────────── v1.25.0
JuliaInterpreter ───────────────── v0.9.42
KernelDensity ──────────────────── v0.6.9
Krylov ─────────────────────────── v0.9.10
LAME_jll ───────────────────────── v3.100.2+0
LERC_jll ───────────────────────── v4.0.1+0
LLVMOpenMP_jll ─────────────────── v18.1.7+0
LZO_jll ────────────────────────── v2.10.3+0
LaTeXStrings ───────────────────── v1.4.0
LayoutPointers ─────────────────── v0.1.17
LazyArrays ─────────────────────── v2.6.1
LazyModules ────────────────────── v0.3.1
LeftChildRightSiblingTrees ─────── v0.2.0
Legolas ────────────────────────── v0.5.23
Libffi_jll ─────────────────────── v3.2.2+2
Libgcrypt_jll ──────────────────── v1.11.0+0
Libglvnd_jll ───────────────────── v1.7.0+0
Libgpg_error_jll ───────────────── v1.51.1+0
Libiconv_jll ───────────────────── v1.18.0+0
Libmount_jll ───────────────────── v2.41.0+0
Libtiff_jll ────────────────────── v4.7.1+0
Libuuid_jll ────────────────────── v2.41.0+0
LineSearch ─────────────────────── v0.1.4
LineSearches ───────────────────── v7.3.0
LinearSolve ────────────────────── v3.7.2
LogExpFunctions ────────────────── v0.3.29
LoggingExtras ──────────────────── v1.1.0
LoweredCodeUtils ───────────────── v3.1.0
Lz4_jll ────────────────────────── v1.10.1+0
MKL_jll ────────────────────────── v2025.0.1+1
MacroTools ─────────────────────── v0.5.15
Makie ──────────────────────────── v0.22.2
MakieCore ──────────────────────── v0.9.1
ManualMemory ───────────────────── v0.1.8
MappedArrays ───────────────────── v0.4.2
MarkdownTables ─────────────────── v1.1.0
MathOptInterface ───────────────── v1.38.0
MathTeXEngine ──────────────────── v0.6.2
MaybeInplace ───────────────────── v0.1.4
MbedTLS ────────────────────────── v1.1.9
MetaGraphsNext ─────────────────── v0.7.3
Missings ───────────────────────── v1.2.0
Mocking ────────────────────────── v0.8.1
MosaicViews ────────────────────── v0.3.4
Moshi ──────────────────────────── v0.3.5
MuladdMacro ────────────────────── v0.2.4
MutableArithmetics ─────────────── v1.6.4
NLSolversBase ──────────────────── v7.9.1
NaNMath ────────────────────────── v1.1.2
Netpbm ─────────────────────────── v1.1.1
NonlinearSolve ─────────────────── v4.5.0
NonlinearSolveBase ─────────────── v1.5.1
NonlinearSolveFirstOrder ───────── v1.3.0
NonlinearSolveQuasiNewton ──────── v1.2.0
NonlinearSolveSpectralMethods ──── v1.1.0
Observables ────────────────────── v0.5.5
OffsetArrays ───────────────────── v1.16.0
Ogg_jll ────────────────────────── v1.3.5+1
OpenBLASConsistentFPCSR_jll ────── v0.3.29+0
OpenEXR ────────────────────────── v0.3.3
OpenEXR_jll ────────────────────── v3.2.4+0
OpenSSL_jll ────────────────────── v3.0.16+0
OpenSpecFun_jll ────────────────── v0.5.6+0
Opus_jll ───────────────────────── v1.3.3+0
OrderedCollections ─────────────── v1.8.0
OrdinaryDiffEqBDF ──────────────── v1.4.0
OrdinaryDiffEqCore ─────────────── v1.21.0
OrdinaryDiffEqDifferentiation ──── v1.5.0
OrdinaryDiffEqLowOrderRK ───────── v1.2.0
OrdinaryDiffEqNonlinearSolve ───── v1.6.0
OrdinaryDiffEqRosenbrock ───────── v1.9.0
OrdinaryDiffEqSDIRK ────────────── v1.3.0
OrdinaryDiffEqTsit5 ────────────── v1.1.0
OteraEngine ────────────────────── v1.1.1
PDMats ─────────────────────────── v0.11.33
PNGFiles ───────────────────────── v0.4.4
PackageCompiler ────────────────── v2.2.0
Packing ────────────────────────── v0.5.1
PaddedViews ────────────────────── v0.5.12
Pango_jll ──────────────────────── v1.56.1+0
Parameters ─────────────────────── v0.12.3
Parsers ────────────────────────── v2.8.1
Pixman_jll ─────────────────────── v0.44.2+0
PkgVersion ─────────────────────── v0.3.3
PlotUtils ──────────────────────── v1.4.3
Polyester ──────────────────────── v0.7.16
PolyesterWeave ─────────────────── v0.2.2
PolygonOps ─────────────────────── v0.1.2
PooledArrays ───────────────────── v1.4.3
PreallocationTools ─────────────── v0.4.26
PrecompileTools ────────────────── v1.2.1
Preferences ────────────────────── v1.4.3
PrettyTables ───────────────────── v2.4.0
ProgressLogging ────────────────── v0.1.4
ProgressMeter ──────────────────── v1.10.2
PtrArrays ──────────────────────── v1.3.0
QOI ────────────────────────────── v1.0.1
QuadGK ─────────────────────────── v2.11.2
RangeArrays ────────────────────── v0.3.2
Ratios ─────────────────────────── v0.4.5
RecipesBase ────────────────────── v1.3.4
RecursiveArrayTools ────────────── v3.31.2
Reexport ───────────────────────── v1.2.2
RelocatableFolders ─────────────── v1.0.1
Requires ───────────────────────── v1.3.1
Revise ─────────────────────────── v3.7.3
Rmath ──────────────────────────── v0.8.0
Rmath_jll ──────────────────────── v0.5.1+0
RoundingEmulator ───────────────── v0.2.1
RuntimeGeneratedFunctions ──────── v0.5.13
SIMD ───────────────────────────── v3.7.1
SIMDTypes ──────────────────────── v0.1.0
SQLite ─────────────────────────── v1.6.1
SQLite_jll ─────────────────────── v3.48.0+0
SciMLBase ──────────────────────── v2.82.0
SciMLJacobianOperators ─────────── v0.1.1
SciMLOperators ─────────────────── v0.3.13
SciMLStructures ────────────────── v1.7.0
Scratch ────────────────────────── v1.2.1
SentinelArrays ─────────────────── v1.4.8
Setfield ───────────────────────── v1.1.2
ShaderAbstractions ─────────────── v0.5.0
Showoff ────────────────────────── v1.0.3
SignedDistanceFields ───────────── v0.4.0
SimpleNonlinearSolve ───────────── v2.2.0
SimpleTraits ───────────────────── v0.9.4
SimpleUnPack ───────────────────── v1.1.0
Sixel ──────────────────────────── v0.1.3
SoftGlobalScope ────────────────── v1.1.0
SortingAlgorithms ──────────────── v1.2.1
SparseMatrixColorings ──────────── v0.4.14
SpecialFunctions ───────────────── v2.5.0
StableRNGs ─────────────────────── v1.0.2
StackViews ─────────────────────── v0.1.1
Static ─────────────────────────── v1.2.0
StaticArrayInterface ───────────── v1.8.0
StaticArrays ───────────────────── v1.9.13
StaticArraysCore ───────────────── v1.4.3
Statistics ─────────────────────── v1.11.1
StatsAPI ───────────────────────── v1.7.0
StatsBase ──────────────────────── v0.34.4
StatsFuns ──────────────────────── v1.4.0
StrideArraysCore ───────────────── v0.5.7
StringManipulation ─────────────── v0.4.1
StringViews ────────────────────── v1.3.4
StructArrays ───────────────────── v0.7.0
StructTypes ────────────────────── v1.11.0
SymbolicIndexingInterface ──────── v0.3.38
TZJData ────────────────────────── v1.5.0+2025b
TableTraits ────────────────────── v1.0.1
Tables ─────────────────────────── v1.12.0
TensorCore ─────────────────────── v0.1.1
TerminalLoggers ────────────────── v0.1.7
TestEnv ────────────────────────── v1.102.0
TestItemRunner ─────────────────── v1.1.0
TestItems ──────────────────────── v1.0.0
ThreadingUtilities ─────────────── v0.5.2
TiffImages ─────────────────────── v0.11.3
TimeZones ──────────────────────── v1.21.3
TimerOutputs ───────────────────── v0.5.28
TranscodingStreams ─────────────── v0.11.3
TriplotBase ────────────────────── v0.1.0
TruncatedStacktraces ───────────── v1.4.0
UnPack ─────────────────────────── v1.0.2
UnicodeFun ─────────────────────── v0.4.1
Unitful ────────────────────────── v1.22.0
VersionParsing ─────────────────── v1.3.0
WeakRefStrings ─────────────────── v1.4.2
WebP ───────────────────────────── v0.1.3
WoodburyMatrices ───────────────── v1.0.0
XML2_jll ───────────────────────── v2.13.6+1
XSLT_jll ───────────────────────── v1.1.42+0
XZ_jll ─────────────────────────── v5.6.4+1
Xorg_libX11_jll ────────────────── v1.8.6+3
Xorg_libXau_jll ────────────────── v1.0.12+0
Xorg_libXdmcp_jll ──────────────── v1.1.5+0
Xorg_libXext_jll ───────────────── v1.3.6+3
Xorg_libXrender_jll ────────────── v0.9.11+1
Xorg_libpthread_stubs_jll ──────── v0.1.2+0
Xorg_libxcb_jll ────────────────── v1.17.0+3
Xorg_xtrans_jll ────────────────── v1.5.1+0
ZMQ ────────────────────────────── v1.4.0
ZeroMQ_jll ─────────────────────── v4.3.6+0
Zstd_jll ───────────────────────── v1.5.7+1
isoband_jll ────────────────────── v0.2.3+0
libaom_jll ─────────────────────── v3.11.0+0
libass_jll ─────────────────────── v0.15.2+0
libfdk_aac_jll ─────────────────── v2.0.3+0
libpng_jll ─────────────────────── v1.6.47+0
libsixel_jll ───────────────────── v1.10.5+0
libsodium_jll ──────────────────── v1.0.21+0
libvorbis_jll ──────────────────── v1.3.7+2
libwebp_jll ────────────────────── v1.5.0+0
oneTBB_jll ─────────────────────── v2022.0.0+0
x264_jll ───────────────────────── v10164.0.1+0
x265_jll ───────────────────────── v3.6.0+0

@visr visr marked this pull request as draft April 2, 2025 07:22
@visr
Copy link
Member

visr commented Apr 2, 2025

Interesting, there are DimensionMismatch errors coming from SparseMatrixColorings.

I suspect that is caused by SciML/OrdinaryDiffEq.jl#2567 landing on top of our #2137?

For instance for the pid_control test model

ERROR: DimensionMismatch: all inputs to eachindex must have the same indices, got Base.OneTo(28) and Base.OneTo(26)
Stacktrace:
  [1] throw_eachindex_mismatch_indices(::IndexLinear, ::Base.OneTo{Int64}, ::Vararg{Base.OneTo{Int64}})
    @ Base ./abstractarray.jl:325
  [2] eachindex
    @ ./abstractarray.jl:393 [inlined]
  [3] eachindex
    @ ./abstractarray.jl:382 [inlined]
  [4] decompress!
    @ ~/.julia/packages/SparseMatrixColorings/BED6Y/src/decompression.jl:361 [inlined]
  [5] _sparse_jacobian_aux!(::Tuple{typeof(Ribasim.water_balance!), Vector{Float64}}, 
  [6] jacobian!
    @ ~/.julia/packages/DifferentiationInterface/7eD1K/ext/DifferentiationInterfaceSparseMatrixColoringsExt/jacobian.jl:237 [inlined]
  [7] jac
    @ ~/work/Ribasim/Ribasim/core/src/model.jl:65 [inlined]

@SouthEndMusic
Copy link
Collaborator

That stack trace though 🥲

@SouthEndMusic
Copy link
Collaborator

@gdalle do you know what is going on here?

@gdalle
Copy link

gdalle commented Apr 2, 2025

From what I can tell, you're trying to use sparse AD by writing into a sparse Jacobian matrix which has a different number of zeros than the sparsity pattern detected during preparation. I would need an MWE to figure out more.

@SouthEndMusic
Copy link
Collaborator

SouthEndMusic commented Apr 2, 2025

@gdalle does that mean that false positives in the sparsity detection are not allowed? The sparsity in our models can effectively change, so during sparsity detection we try to capture every possible dependency

@gdalle
Copy link

gdalle commented Apr 2, 2025

No, but it means that you must be consistent in the sparsity patterns of the Jacobian matrices you handle. I'm not sure yet whether this is caused by Ribasim or OrdinaryDiffEq or the combination of both, but what's happening here is:

  • prep = DI.prepare_jacobian(f, backend, x) performed coloring on a detected or provided sparsity pattern with 26 structural nonzero coefficients
  • DI.jacobian!(f, jac, prep, backend, x) is apparently being called on a Jacobian storage jac with 28 structural nonzero coefficients

@gdalle
Copy link

gdalle commented Apr 2, 2025

EDIT: it's actually really weird that it doesn't error before, because I have a check specifically for the number of zeros to match. So I would say there is a small probability of a bug in SparseMatrixColorings, please provide an MWE.

@SouthEndMusic
Copy link
Collaborator

Isolating a MWE is not so easy, unless you're willing to locally run our pixi workflow for writing test models to disk.

Just to be sure: is sparsity_pattern(jac_prep) the proper way to obtain the Jacobian prototype to be passed to OrdinaryDiffEq.jl?

@gdalle
Copy link

gdalle commented Apr 2, 2025

Just to be sure: is sparsity_pattern(jac_prep) the proper way to obtain the Jacobian prototype to be passed to OrdinaryDiffEq.jl?

It should be, yes.

@SouthEndMusic
Copy link
Collaborator

Interesting. When I print sparsity_pattern(jac_prep) I get (as sort of expected from the above)

6×6 SparseArrays.SparseMatrixCSC{Bool, Int64} with 26 stored entries:      
 1  1  1  1  1  ⋅
 1  1  1  1  ⋅  1
 1  1  1  1  ⋅  ⋅
 1  1  1  1  ⋅  ⋅
 1  1  1  1  ⋅  ⋅
 1  1  1  1  ⋅  ⋅

but when I print integrator.alg.autodiff.sparsity_detector.jacobian_sparsity I get

6×6 SparseArrays.SparseMatrixCSC{Bool, Int64} with 28 stored entries:
 1  1  1  1  1  ⋅
 1  1  1  1  ⋅  1
 1  1  1  1  ⋅  ⋅
 1  1  1  1  ⋅  ⋅
 1  1  1  1  1  ⋅
 1  1  1  1  ⋅  1

@SouthEndMusic
Copy link
Collaborator

Should there be anything in sparsity_detector at all, considering the sparsity detection was done outside the context of OrdinaryDiffEq.jl? I can check what is there before this update

@gdalle
Copy link

gdalle commented Apr 2, 2025

The fact that the added nonzeros are on the diagonal makes me think that the issue is SciML/OrdinaryDiffEq.jl#2567 (comment). This is a modification of the sparsity pattern a posteriori, but it will be invisible to the detector, and hence to the subsequent coloring. So I will prepare decompression for a matrix with 26 entries, even though it has 28.

@SouthEndMusic
Copy link
Collaborator

@gdalle for a MWE you could download the generated_testmodels from our release assets and run

Ribasim.run("...\generated_testmodels\pid_control\ribasim.toml")

@gdalle
Copy link

gdalle commented Apr 2, 2025

Feel free to contribute the MWE here: SciML/OrdinaryDiffEq.jl#2653

@ChrisRackauckas
Copy link

Test this patch: SciML/OrdinaryDiffEq.jl#2655

@gdalle
Copy link

gdalle commented Apr 2, 2025

@SouthEndMusic what do you have as problem.f.jac_prototype and problem.f.sparsity?

@gdalle
Copy link

gdalle commented Apr 2, 2025

I get this with your MWE:

julia> model.integrator.f.jac.jac_prep |> sparsity_pattern
6×6 SparseArrays.SparseMatrixCSC{Bool, Int64} with 28 stored entries:
 1  1  1  1  1  
 1  1  1  1    1
 1  1  1  1    
 1  1  1  1    
 1  1  1  1  1  
 1  1  1  1    1

julia> model.integrator.f.sparsity
6×6 SparseArrays.SparseMatrixCSC{Bool, Int64} with 28 stored entries:
 1  1  1  1  1  
 1  1  1  1    1
 1  1  1  1    
 1  1  1  1    
 1  1  1  1  1  
 1  1  1  1    1

julia> model.integrator.f.jac_prototype
6×6 SparseArrays.SparseMatrixCSC{Float64, Int64} with 28 stored entries:
 1.0           7.10628e-314  7.10628e-314  0.0  0.0    
 7.10628e-314  1.0           7.10628e-314  0.0      0.0
 7.10628e-314  7.10628e-314  1.0           0.0        
 7.10607e-314  7.10628e-314  0.0           1.0        
 2.35747e-314  7.10628e-314  0.0           0.0  1.0    
 7.1061e-314   7.10628e-314  0.0           0.0      1.0

julia> model.integrator.f.jac.jac_prep |> sparsity_pattern
6×6 SparseArrays.SparseMatrixCSC{Bool, Int64} with 28 stored entries:
 1  1  1  1  1  
 1  1  1  1    1
 1  1  1  1    
 1  1  1  1    
 1  1  1  1  1  
 1  1  1  1    1

Which does not necessarily mean that these matrices looked that way when they were created. Indeed, OrdinaryDiffEq modifies some of them

@gdalle
Copy link

gdalle commented Apr 2, 2025

I figured out why you're getting the ugly stack trace instead of a nicer error message: you're passing as jacobian_prototype the sparsity pattern itself, which is also stored inside the coloring result, and which OrdinaryDiffEq subsequently modifies:

jac_prototype = solver.sparse ? sparsity_pattern(jac_prep) : nothing

Adding a copy to this line means you get the nicer error:

julia> solve!(model)
ERROR: DimensionMismatch: `A` and `S` must have the same sparsity pattern.
Stacktrace:
  [1] check_same_pattern
    @ ~/Documents/GitHub/Julia/SparseMatrixColorings.jl/src/matrices.jl:83 [inlined]
  [2] decompress!
    @ ~/Documents/GitHub/Julia/SparseMatrixColorings.jl/src/decompression.jl:359 [inlined]

The broader issue is that user-provided in-place Jacobians do not know anything about the mass_matrix that OrdinaryDiffEq adds later on. So their behavior becomes invalid

@gdalle
Copy link

gdalle commented Apr 2, 2025

Could you try running it again with the version of SparseMatrixColorings from gdalle/SparseMatrixColorings.jl#224 ?

@gdalle
Copy link

gdalle commented Apr 2, 2025

What do the errors say now?

@visr
Copy link
Member

visr commented Apr 2, 2025

A great, all tests pass, thanks for the fix. Two of the larger test models are now Unstable. That looks like another issue though. Will have to look into it.

@gdalle
Copy link

gdalle commented Apr 2, 2025

Ok good. SciML folks are still deciding whether they want to yank the new release or include my fix

@ChrisRackauckas
Copy link

Well we should just yank OrdinaryDiffEqDifferentiation and then bump the minimum so this patch is required in all released versions.

@gdalle
Copy link

gdalle commented Apr 5, 2025

@visr as it turns out the right fix shouldn't come from SparseMatrixColorings but from OrdinaryDiffEq. It has now been merged into OrdinaryDiffEq#master, can you give that branch a try (with the normal release of SparseMatrixColorings)?

@gdalle
Copy link

gdalle commented Apr 5, 2025

Looking good?

@visr
Copy link
Member

visr commented Apr 5, 2025

Looks great! Everything is green. With just the SparseMatrixColorings branch we tried in #2201 (comment) we still had some models become unstable, but it looks like that is now fixed as well, so it probably was related.

@gdalle
Copy link

gdalle commented Apr 5, 2025

I'm not sure I know what caused the instabilities, but that's part of why I didn't want to merge my SMC fix: tolerating different sparsity patterns within in-place Jacobians is a recipe for disaster. Much better to fix from within OrdinaryDiffEq as we did!

@visr
Copy link
Member

visr commented Apr 5, 2025

Indeed, thanks for digging in and ensuring the right problem was fixed!
I'll just merge this now, it doesn't matter much for us that it is on a branch, will go back to the release soon.

@visr visr marked this pull request as ready for review April 5, 2025 18:14
@visr visr merged commit 1cdb603 into main Apr 5, 2025
20 checks passed
@visr visr deleted the update/julia-manifest branch April 5, 2025 18:14
visr added a commit that referenced this pull request Apr 7, 2025
We temporarily moved to a branch in #2201, but now that's released, go back to the release.
visr added a commit that referenced this pull request Apr 7, 2025
We temporarily moved to a branch in #2201, but now that's released, go
back to the release.
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.

6 participants