Skip to content

Conversation

MohamedLaghdafHABIBOULLAH
Copy link
Collaborator

@dpo It seems there is an issue with the newer versions of ADNLPModels. Following @nathanemac’s suggestion, I added a matrix_free parameter to ensure compatibility with the latest version of ADNLPModels.

@nathanemac
Copy link
Contributor

Thank you @MohamedLaghdafHABIBOULLAH
This PR also solves #65.

Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you.

@nathanemac nathanemac mentioned this pull request Sep 12, 2025
src/fh_model.jl Outdated
ADNLPModels.ADNLPModel(misfit, ones(5); kwargs...),
ADNLPModels.ADNLSModel(resid, ones(5), nequ; kwargs...),
ADNLPModels.ADNLPModel(misfit, ones(5); matrix_free = true, kwargs...),
ADNLPModels.ADNLSModel(resid, ones(5), nequ; matrix_free = true, kwargs...),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also need to bump the version of ADNLPModels?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so; I’m now trying to ensure that the tests pass locally.

Copy link
Collaborator Author

@MohamedLaghdafHABIBOULLAH MohamedLaghdafHABIBOULLAH Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's bizarre locally, normally it should work even with the old ADNLPModels versions, however if I test the package as following:

(RegularizedProblems) pkg> activate .
(RegularizedProblems) pkg> instantiate
(RegularizedProblems) pkg> test
Test Summary: | Error  Total   Time
FH            |     1      1  18.6s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/laghdafhacen/Documents/GitHub/RegularizedProblems.jl/test/runtests.jl:26
ERROR: Package RegularizedProblems errored during testing

However if I add both ADNLPModels and DifferentialEquations as dependancies of RegularizedProblems the tests pass:

(RegularizedProblems) pkg> add ADNLPModels
   Resolving package versions...
      Compat entries added for 
  No Changes to `~/Documents/GitHub/RegularizedProblems.jl/Project.toml`
  No Changes to `~/Documents/GitHub/RegularizedProblems.jl/Manifest.toml`

(RegularizedProblems) pkg> add DifferentialEquations
   Resolving package versions...
      Compat entries added for 
  No Changes to `~/Documents/GitHub/RegularizedProblems.jl/Project.toml`
  No Changes to `~/Documents/GitHub/RegularizedProblems.jl/Manifest.toml`

(RegularizedProblems) pkg> test
     Testing RegularizedProblems
      Status `/private/var/folders/sy/rzn9bw2d65b2y46rm6lzjx3w0000gn/T/jl_vmN4mu/Project.toml`
⌅ [54578032] ADNLPModels v0.7.2
  [0c46a032] DifferentialEquations v7.16.1
  [31c24e10] Distributions v0.25.120
  [eb30cadb] MLDatasets v0.7.18
  [30dfa513] ManualNLPModels v0.2.0
  [a4795742] NLPModels v0.21.5
⌅ [81d43f40] Noise v0.2.2
⌅ [a725b495] ProximalOperators v0.15.3
  [f468eda6] QuadraticModels v0.9.13
  [ea076b23] RegularizedProblems v0.1.2 `~/Documents/GitHub/RegularizedProblems.jl`
  [ae029012] Requires v1.3.1
  [d4fd37fa] ShiftedProximalOperators v0.2.2
  [37e2e46d] LinearAlgebra v1.11.0
  [9a3f8284] Random v1.11.0
  [2f01184e] SparseArrays v1.11.0
  [8dfed614] Test v1.11.0
      Status `/private/var/folders/sy/rzn9bw2d65b2y46rm6lzjx3w0000gn/T/jl_vmN4mu/Manifest.toml`
⌅ [54578032] ADNLPModels v0.7.2
...
  [0c46a032] DifferentialEquations v7.16.1
  
       Testing Running tests...
Test Summary: | Pass  Total   Time
FH            |    2      2  16.1s
     Testing RegularizedProblems tests passed```

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see here that ADNLPModels still with the old 0.7 version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put back the ancient code to see if the cirrus will pass, which is not the case locally...

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator Author

@dpo As I suspected, the tests fail even though I literally did not change anything compared to master, so it must be related to some recent updates of some packages.
One way to solve this issue would be to make ADNLPModels and DifferentialEquations direct dependencies, but that might slow down instantiation.

@dpo
Copy link
Member

dpo commented Sep 12, 2025

When I compare the Manifest.toml from the most recent successful CI tests (last week) I do see differences with my local Manifest.toml. The unit tests fail for me locally as well.

One improvement would be to have a test/Project.toml where we can specify a version for every test dependency.

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator Author

Should I address this issue in a different PR?

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator Author

Do you think @dpo that this package might be useful https://github.com/JuliaTesting/Aqua.jl?

@dpo
Copy link
Member

dpo commented Sep 13, 2025

Actually I tried again and the test passes. I now suspect the failure is due to the random nature of the pertubation in the data.

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator Author

MohamedLaghdafHABIBOULLAH commented Sep 13, 2025

So I will put back the matrix_free parameter, do you think it's good idea to add ADNLPModels@0.8 as a version in the project.toml in Line 18-19

[compat]
ADNLPModels = "^0.3, 0.4, 0.7, 0.8"

@dpo
Copy link
Member

dpo commented Sep 13, 2025

Did you test it?

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator Author

The same issue occurs: the tests pass only when ADNLPModels and DifferentialEquations are added as direct dependencies; otherwise, they do not.

@dpo
Copy link
Member

dpo commented Sep 14, 2025

Do you think @dpo that this package might be useful https://github.com/JuliaTesting/Aqua.jl?

Yes, here and in all other packages.

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.

3 participants