Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aqua.jl for some static testing #437

Merged
merged 8 commits into from
May 24, 2023

Conversation

lgoettgens
Copy link
Member

@lgoettgens lgoettgens commented May 24, 2023

@lgoettgens
Copy link
Member Author

When reviewing this PR, please check the compat versions introduced here for sensibility.

@lgoettgens lgoettgens marked this pull request as ready for review May 24, 2023 10:32
benlorenz added 5 commits May 24, 2023 13:52
the code in here is not really tied to a specific version
and libpolymake_julia brings its own bounds which would make this a mess to maintain

we do need to keep this dependency for now as polymake_jll is imported in the generate_deps_tree.jl file which is not in this repo
@benlorenz
Copy link
Member

A few more changes:

  • Adjusted the compat bounds a little bit (see commit messages for details).
  • Removed one case of type piracy which did come from this repository.
  • Improved comments for the disabled tests.

For type piracy we basically have these two (for various kinds of containers):

[5] isempty(arg1::Union{Ptr{Nothing}, CxxWrap.CxxWrapCore.ConstCxxPtr{<:Polymake.Set{Int64}}, CxxWrap.CxxWrapCore.CxxPtr{<:Polymake.Set{Int64}}}) in Polymake at /home/lorenz/.julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:624
[6] length(arg1::Union{Ptr{Nothing}, CxxWrap.CxxWrapCore.ConstCxxPtr{<:Polymake.Map{CxxWrap.StdLib.StdString, CxxWrap.StdLib.StdString}}, CxxWrap.CxxWrapCore.CxxPtr{<:Polymake.Map{CxxWrap.StdLib.StdString, CxxWrap.StdLib.StdString}}}) in Polymake at /home/lorenz/.julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:624

Unless someone wants to dig into how CxxWrap generates these signatures this will stay disabled.

Ambiguities is somewhat similar except that there are thousands instead of just 40 cases and Aqua doesn't seem to provide any way to work with the results (which are just dumped on the screen...).

@lgoettgens
Copy link
Member Author

lgoettgens commented May 24, 2023

Thanks for your changes!
For ambiguities, you could change the =false to =(recursive=false,) to only consider ambiguities that arise from at least one method contained in Polymake.jl. Maybe this then ignores most of the CxxWrap stuff and leaves only some few things to fix.

The Aqua-function is basically only a wrapper around Test.detect_ambiguities
https://github.com/JuliaTesting/Aqua.jl/blob/76443b2f5e52fed5b9354305af7cd32883ada15e/src/ambiguities.jl#L180

I think this would be the way to go and investigate.

If there are some certain functions with ambiguities coming from CxxWrap, one could disable those in the Aqua check (cf. exclude in https://juliatesting.github.io/Aqua.jl/dev/#Aqua.test_ambiguities-Tuple{Any}).

@benlorenz
Copy link
Member

benlorenz commented May 24, 2023

recursive=false doesn't seem to change anything, probably because these are functions that are generated inside Polymake.jl (we write some c++ code for these in libpolymake_julia and when Polymake.jl is loaded this compiled c++ code is turned, by CxxWrap, into julia functions).

If anyone wants to look into this, a lot of the output looks like this (again with varying types), but there are also a bunch of other function names involved:

Ambiguity #23384
__delete(arg1::Union{Ptr{Nothing}, CxxWrap.CxxWrapCore.CxxPtr{<:CxxWrap.StdLib.UniquePtr{CxxWrap.CxxWrapCore.CxxBool}}}) in CxxWrap.StdLib at /home/lorenz/.julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:624
__delete(arg1::Union{Ptr{Nothing}, CxxWrap.CxxWrapCore.CxxPtr{<:Polymake.IncidenceMatrix{Polymake.Symmetric}}}) in Polymake at /home/lorenz/.julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:624

Possible fix, define
  __delete(::Union{Ptr{Nothing}, CxxWrap.CxxWrapCore.CxxPtr{Union{}}})

For now I will just keep piracy and ambiguities checks disabled.

Warning (for anyone trying to look into this): That ambiguities check might take about half an hour.

@benlorenz benlorenz merged commit 4d763e8 into oscar-system:master May 24, 2023
@lgoettgens lgoettgens deleted the lg/aqua branch May 24, 2023 17:10
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