StructArrays and ModellingToolkit

StructArrays 0.6.18 works fine with the newest version of ModelingToolkit, but StructArrays 0.6.20 works only with a very old version of MTK. I find this counter-intuitive. Any idea why this is the case?

I never tasted the two together. Worth an MWE. I dont quite understand the use case though since the point of mtk is canonicalization

My package KiteUtils.jl uses StructArrays for logging, and our package KiteModels.jl uses MTK for building a simulation model. I upgraded StructArrays in KiteUtils, and then I could not bump the version of KiteUtils in KiteModels. Now I downgraded it again and I create a new release. Still strange.

The changelog of StructArrays says that the latest versions are backports: Releases · JuliaArrays/StructArrays.jl · GitHub

I do not understand what that means.

That’s probably unrelated or only tangentially related. Backporting is an update for an older version having changes first made in a newer version. I imagine some things in StructArrays v0.7.0 were important enough to be patched into v0.6.20-21.

MWE:

mkdir tmp
cd tmp
julia --project="."

and then in Julia:

using Pkg
pkg"add ModelingToolkit"
pkg"add StructArrays"

gives me:

(tmp) pkg> st
Status `~/tmp/Project.toml`
  [961ee093] ModelingToolkit v9.54.0
⌃ [09ab397b] StructArrays v0.6.18

If I now do:

pkg"add StructArrays@0.6.20"

MTK gets downgraded and I get:

julia> pkg"status"
Status `~/tmp/Project.toml`
⌃ [961ee093] ModelingToolkit v9.25.0
⌃ [09ab397b] StructArrays v0.6.20
Info Packages marked with ⌃ have new versions available and may be upgradable.

Why?

Can you post ]why StructArrays?

(tmp) pkg> why StructArrays
  StructArrays

You can pin MTK to a current version and then try to update StructArrays to 0.7. This shows where the resolver cannot satisfy the constraints:

(jl_0nLgRi) pkg> add StructArrays@0.7
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package SciMLBase [0bca4576]:
 SciMLBase [0bca4576] log:
 ├─possible versions are: 1.0.0 - 2.65.0 or uninstalled
 ├─restricted by compatibility requirements with ModelingToolkit [961ee093] to versions: 2.57.1 - 2.65.0
 │ └─ModelingToolkit [961ee093] log:
 │   ├─possible versions are: 0.0.1 - 9.54.0 or uninstalled
 │   ├─restricted to versions * by project [eb167fc8], leaving only versions: 0.0.1 - 9.54.0
 │   │ └─project [eb167fc8] log:
 │   │   ├─possible versions are: 0.0.0 or uninstalled
 │   │   └─project [eb167fc8] is fixed to version 0.0.0
 │   └─restricted to versions 9.54.0 by an explicit requirement, leaving only versions: 9.54.0
 └─restricted by compatibility requirements with Accessors [7d9f7c33] to versions: 1.0.0 - 2.39.0 or uninstalled — no versions left
   └─Accessors [7d9f7c33] log:
     ├─possible versions are: 0.1.0 - 0.1.38 or uninstalled
     └─restricted by compatibility requirements with StructArrays [09ab397b] to versions: 0.1.0 - 0.1.27 or uninstalled
       └─StructArrays [09ab397b] log:
         ├─possible versions are: 0.0.1 - 0.7.0 or uninstalled
         ├─restricted to versions * by project [eb167fc8], leaving only versions: 0.0.1 - 0.7.0
         │ └─project [eb167fc8] log: see above
         └─restricted to versions 0.7 by an explicit requirement, leaving only versions: 0.7.0

I tried to check the Project tomls of the related packages, Acccesors, SciMLBase and StructArrays but wasn’t able to spot the problem.

1 Like

Ah, Accessors needs a bump. On master it declares compat with StructArrays@0.7 but that’s not released yet.

2 Likes

ufechner7 isn’t asking about 0.7 though, rather going from 0.6.18 to 0.6.20 having such a drastic effect on ModelingToolkit. Here’s the conflict after pinning MTk v9.54.0:

(jl_dsRs74) pkg> add StructArrays@0.6.20
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package DiffEqNoiseProcess [77a26b50]:
 DiffEqNoiseProcess [77a26b50] log:
 ├─possible versions are: 2.0.0 - 5.23.0 or uninstalled
 ├─restricted by compatibility requirements with ModelingToolkit [961ee093] to versions: 5.0.0 - 5.23.0
 │ └─ModelingToolkit [961ee093] log:
 │   ├─possible versions are: 0.0.1 - 9.54.0 or uninstalled
 │   ├─restricted to versions * by project [5488c30d], leaving only versions: 0.0.1 - 9.54.0
 │   │ └─project [5488c30d] log:
 │   │   ├─possible versions are: 0.0.0 or uninstalled
 │   │   └─project [5488c30d] is fixed to version 0.0.0
 │   └─restricted to versions 9.54.0 by an explicit requirement, leaving only versions: 9.54.0
 ├─restricted by compatibility requirements with SciMLBase [0bca4576] to versions: [2.0.0 - 5.8.0, 5.19.0 - 5.23.0] or uninstalled, leaving only versions: [5.0.0 - 5.8.0, 5.19.0 - 5.23.0]
 │ └─SciMLBase [0bca4576] log:
 │   ├─possible versions are: 1.0.0 - 2.65.0 or uninstalled
 │   └─restricted by compatibility requirements with ModelingToolkit [961ee093] to versions: 2.57.1 - 2.65.0
 │     └─ModelingToolkit [961ee093] log: see above
 ├─restricted by compatibility requirements with RecursiveArrayTools [731186ca] to versions: 5.20.0 - 5.23.0 or uninstalled, leaving only versions: 5.20.0 - 5.23.0
 │ └─RecursiveArrayTools [731186ca] log:
 │   ├─possible versions are: 0.16.0 - 3.27.4 or uninstalled
 │   ├─restricted by compatibility requirements with ModelingToolkit [961ee093] to versions: 3.26.0 - 3.27.4
 │   │ └─ModelingToolkit [961ee093] log: see above
 │   └─restricted by compatibility requirements with GPUArraysCore [46192b85] to versions: [0.16.0 - 2.29.2, 3.27.1 - 3.27.4] or uninstalled, leaving only versions: 3.27.1 - 3.27.4
 │     └─GPUArraysCore [46192b85] log:
 │       ├─possible versions are: 0.1.0 - 0.2.0 or uninstalled
 │       ├─restricted by compatibility requirements with StructArrays [09ab397b] to versions: 0.2.0 or uninstalled
 │       │ └─StructArrays [09ab397b] log:
 │       │   ├─possible versions are: 0.0.1 - 0.7.0 or uninstalled
 │       │   ├─restricted to versions * by project [5488c30d], leaving only versions: 0.0.1 - 0.7.0
 │       │   │ └─project [5488c30d] log: see above
 │       │   └─restricted to versions 0.6.20 by an explicit requirement, leaving only versions: 0.6.20
 │       └─restricted by compatibility requirements with RecursiveArrayTools [731186ca] to versions: 0.1.1 - 0.2.0, leaving only versions: 0.2.0
 │         └─RecursiveArrayTools [731186ca] log: see above
 └─restricted by compatibility requirements with GPUArraysCore [46192b85] to versions: 2.0.0 - 5.11.1 or uninstalled — no versions left
   └─GPUArraysCore [46192b85] log: see above

DiffEqNoiseProcess from 5.12.0 onwards depended on GPUArraysCore 0.1. StructArrays from 0.6.18 to 0.6.20 switched from GPUArraysCore 0.1 to 0.2, forcing MTk to downgrade where DiffEqNoiseProcess is 5.11.1 or lower. DiffEqNoiseProcess 5.11.1 depends on GPUArrays 8, which does partially predate the separation of GPUArraysCore.

Incidentally, is there a way to simulate environments without actually installing anything? No point in waiting for downloads and precompilation if I’m just checking version compatibility.

3 Likes

Does anybody understand in which package this issue could/should be fixed?

I think DiffEqNoiseProcess.jl just needed a tag. Let’s see if that fixes it.

1 Like

Best you can do is interrupt the compilation with control-C I think. IIRC there was a dry-run option once but it was removed some time ago.