Skip to content

Add conversion methods between OSCAR and HomotopyContinuation as a julia extension#5758

Open
antonydellavecchia wants to merge 35 commits into
masterfrom
adv/add-hc-ext
Open

Add conversion methods between OSCAR and HomotopyContinuation as a julia extension#5758
antonydellavecchia wants to merge 35 commits into
masterfrom
adv/add-hc-ext

Conversation

@antonydellavecchia

@antonydellavecchia antonydellavecchia commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

This code will be loaded when HomotopyContinuation.jl is a dependency of the active project.

Conversion code more or less just copied from https://github.com/taboege/OscarHomotopyContinuation

This PR will also resolve taboege/OscarHomotopyContinuation#2 (comment)
In terms of what the extension can handle.

Currently we need HomotopyContinuation 2.15.

Adds a new workflow for testing extensions where the test dependencies for the extensions are injected.
(currently just HomotopyContinuation.jl)

@antonydellavecchia antonydellavecchia added needs tests release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Feb 6, 2026
@antonydellavecchia antonydellavecchia changed the title Adds HomotopyContinuation.jl as a julia extension Adds conversion methods between Oscar and HomotopyContinuation as a julia extension Feb 6, 2026
@thofma

thofma commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

This might become a major pain in the future with versions, since HomotopyContinuation indirectly depends on dependencies of Oscar, like FLINT_jll . This could potentially prevent us from updating FLINT_jll in a timely manner, since we have to wait for the Arblib maintainers (as well as the HomotopyContinuation.jl maintainers). I don't know how I feel about this. Happy to hear what others think about this.

Testing extensions is tricky. I think @benlorenz a while ago gave me the advice to directly inject the optional dependencies during CI: https://github.com/thofma/Hecke.jl/blob/master/.github/workflows/CILong.yml#L44-L48. In runtests.jl there is then a using OptionalDependency behind a try/catch. Things might have become easier on newer versions of julia though.

@Joel-Dahne

Copy link
Copy Markdown

This dependency could indeed become an issue. Usually I'm faster at updating Arblib.jl than in this case, but at least one or two weeks should definitely be expected in the general case. So there will likely be some time when Arblib.jl and Nemo are out of sync.

Due to the tight coupling with Flint we have relatively strict version bounds for FLINT_jll (I think Nemo does the same?). Historically a more permissive version bound would have been fine. The only breaking change for the purposes of Arblib.jl was the change in layout for matrices in Flint 3.2, but even didn't actually give any issues on the Julia side unless you tried to directly use the internal fields. But since it is difficult to know what things might change in the future I would still be hesitant to use a more permissive version.

@antonydellavecchia antonydellavecchia added extensions Adds code as a julia extension and removed needs tests labels Feb 10, 2026
@antonydellavecchia

Copy link
Copy Markdown
Collaborator Author

This might become a major pain in the future with versions, since HomotopyContinuation indirectly depends on dependencies of Oscar, like FLINT_jll . This could potentially prevent us from updating FLINT_jll in a timely manner, since we have to wait for the Arblib maintainers (as well as the HomotopyContinuation.jl maintainers). I don't know how I feel about this. Happy to hear what others think about this.

Testing extensions is tricky. I think @benlorenz a while ago gave me the advice to directly inject the optional dependencies during CI: https://github.com/thofma/Hecke.jl/blob/master/.github/workflows/CILong.yml#L44-L48. In runtests.jl there is then a using OptionalDependency behind a try/catch. Things might have become easier on newer versions of julia though.

I followed your lines regard the injection, but I cant seem to find the other bits of code you are referring to?
It also seems like the issue is the pretty tables in homotopy continuation are too old, maybe I can remove this dependency when test this extension?

@thofma

thofma commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

Something like this:
https://github.com/thofma/Hecke.jl/blob/b1f3ea20a5c8719d6a52a54bf22daab9ed4729bf/test/runtests.jl#L68-L78:

try
  import Polymake
  println("Found Polymake.")
  global _with_polymake = true
catch e
  if !(isa(e, ArgumentError))
    rethrow(e)
  else
    println("using Polymake failed.")
  end
end

I have then some code unter test/ of the form

if _with_polymake
  @test ...
end

@fingolfin

Copy link
Copy Markdown
Member

Some comments from triage:

  1. there was quite some skepticism if this is a wise move, but @benlorenz convinced us (well, at least me) that as long as one doesn't have HC.jl in the environment, one can still use Oscar.jl, even if there are incompatibilities (such as for example if we were to depend on a FLINT_jll that is not yet supported by HC.jl / Arblib)
  2. this PR fails its CI tests due to the PrettyTables dependency being incompatible between Oscar (which requires 3.x) and HC.jl (which requires 2.x).
    • on the upside that kinda proves point 1, yay :-)
    • on the downside this renders this PR unusable right now. There has been a PR changing that dependency in HC.jl since August 2025. So I guess if you want this PR to be useful, someone has to help HC.jl to get that working?
  3. this package extension should have a README.md similar to that in our experimental modules. In particular it should state that this is as of now "experimental" and could be withdrawn if e.g. HC.jl were not being maintained anymore; and it should give a list of "maintainers" for this.

@benlorenz

Copy link
Copy Markdown
Member

Latest version 2.17.2 of HomotopyContinuation.jl supports PrettyTables version 3 and restores compat with julia 1.10.

@benlorenz benlorenz closed this Feb 17, 2026
@benlorenz benlorenz reopened this Feb 17, 2026
Comment thread .github/workflows/CI.yml Outdated
Comment thread test/runtests.jl Outdated
@taboege

taboege commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

I've been put in as a reviewer for this and I just want to say that the extension code itself looks fine to me but that does not seem to be the contentious part of this PR. I have no actual understanding of the maintenance burden that these incompatible dependency versions might create in the long term.

@antonydellavecchia antonydellavecchia marked this pull request as ready for review February 17, 2026 10:31

@lgoettgens lgoettgens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can get rid of most (maybe even all) of the new stub functions by instead of adding methods to the stub functions adding them to the same-named functions of HC instead. This removes some clutter from the Oscar name space (in particular since the names are not really aligned with our naming guidelines), and IMO removes some duplication.

Comment thread ext/HomotopyContinuationExt.jl Outdated
Comment thread ext/HomotopyContinuationExt.jl Outdated
Comment thread ext/HomotopyContinuationExt.jl Outdated
Comment thread ext/HomotopyContinuationExt.jl Outdated
Comment thread ext/HomotopyContinuationExt.jl Outdated
Comment thread .github/workflows/CI.yml Outdated
Comment thread test/exts.jl Outdated
Comment thread test/exts.jl Outdated
Comment thread test/exts.jl Outdated
@@ -0,0 +1,15 @@
using HomotopyContinuation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't this file be rather experimental/Extensions/test/runtests.jl?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

then it would run as experimental test which we dont want. I've added the test to the experimental folder now. and have a test in runtest that just check that errors are thrown.

@antonydellavecchia antonydellavecchia marked this pull request as ready for review February 23, 2026 12:53
Comment thread src/Oscar.jl Outdated
@joschmitt joschmitt changed the title Adds conversion methods between Oscar and HomotopyContinuation as a julia extension Add conversion methods between OSCAR and HomotopyContinuation as a julia extension Mar 31, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.13%. Comparing base (6a727da) to head (d61ab7f).
⚠️ Report is 153 commits behind head on master.

Files with missing lines Patch % Lines
experimental/Extensions/src/Extensions.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5758      +/-   ##
==========================================
+ Coverage   83.93%   84.13%   +0.19%     
==========================================
  Files         753      784      +31     
  Lines      103376   106547    +3171     
==========================================
+ Hits        86773    89638    +2865     
- Misses      16603    16909     +306     
Files with missing lines Coverage Δ
experimental/Extensions/src/Extensions.jl 0.00% <0.00%> (ø)

... and 164 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread Project.toml
f4ncgb_jll = "0.300.401"
julia = "1.10"
lib4ti2_jll = "1.6.10"
HomotopyContinuation = "2.19"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please keep this list sorted alphabetically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions Adds code as a julia extension release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigFloat in HomotopyContinuation.jl

8 participants