Skip to content

Accept request records and optional providers for Voronoi complexes - #167

Merged
grahamknockillaree merged 4 commits into
gap-packages:masterfrom
dimpase:optional-voronoi-backends
Oct 23, 2026
Merged

grahamknockillaree merged 4 commits into
gap-packages:masterfrom
dimpase:optional-voronoi-backends

Conversation

@dimpase

@dimpase dimpase commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

This enables Voronoi-complex and group-homology computations entirely from a Julia session, without Magma. ArithmeticVoronoi uses Julia/OSCAR to construct the complexes for arithmetic groups (currently quadratic GL₂ and imaginary-quadratic SL₂ over maximal orders on the free rank-two lattice), then calls HAP through GAP.jl to compute homology.

The group range can be extended, it's just what we have working now.


HAP's existing Voronoi constructors use Magma/VMH. This adds VoronoiComplex(request : backend := name) and a provider registry, so external implementations can supply HAP non-free resolution objects.

Providers receive one record:

RegisterVoronoiBackend("julia", provider);
request := rec(
    group := "GL", rank := 2,
    field := rec(kind := "quadratic", discriminant := -7),
    order := rec(kind := "maximal"),
    lattice := rec(kind := "free"));
K := VoronoiComplex(request : backend := "julia");
R := FreeGResolution(K,3);
Homology(TensorWithIntegers(R),2);

HAP passes the record unchanged. Providers interpret and validate its contents, including any field polynomials, order bases, lattice ideals or subgroup data they support. The dispatcher imposes no field-degree, rank or group-family restriction. A provider returns a HAP non-free resolution, returns fail, or raises an explanatory error for unsupported requests; there is no automatic fallback.

The general constructor requires an explicit registered backend. VoronoiComplexGL(n,d) and VoronoiComplexSL(n,d) become convenience wrappers when a provider is selected, building quadratic records with field.radicand := d. Their default Magma path, including explicit backend := "magma", is unchanged.

The patch loads the entry points during HAP initialization, adds a mock-provider GAP test, and documents the interface. The test checks arbitrary records, higher ranks, convenience wrappers, replacement of providers, and fail propagation; it needs neither Julia nor Magma.

A separate Julia Voronoi example (GL2, D=-7) CI job runs a small executable example against the HAP PR checkout, using a pinned ArithmeticVoronoi commit and Julia environment. It constructs a fresh complex for GL(2,O) over the integers of Q(sqrt(-7)) through the record interface, then checks the cell-orbit counts [1,2,1] and integral homology H1 = (Z/2)^3, H2 = Z/2 + Z/12. Dependency precompilation is a separate CI step using Julia's default parallelism, and the example reports package-loading time. The job log shows the request, enumeration progress and computed invariant factors. It needs no Magma, C++ exporter build or stored complexes. The ordinary GAP matrix keeps its existing dependencies.

The external Julia adapter uses the same request records and JSON experiment runners as its enumerator and presentation pipeline. It validates its current quadratic, rank-two, maximal-order, free-lattice scope explicitly. It supplies stabilizers, orientation actions and equivariant boundaries; a contracting homotopy is not supplied. HAP gains no Julia runtime dependency.

Validation on GAP 4.16.1, Julia 1.13.2 and OSCAR 1.8.2:

  • The new GAP test passes with the full patched checkout (HAP 1.80). GAPDoc parses and validates the complete updated tutorial.
  • The small Julia example passes both locally and in HAP's CI: all five checks succeed, including the public dispatcher, HAP object type, cell-orbit counts and H1/H2. All three GAP-version jobs and the documentation build also pass.
  • All 55 downstream HAP integration assertions pass separately with this checkout and released HAP 1.78 plus the compatibility wrapper, including exact boundary and independent homology comparisons.
  • All 41 request-validation checks and 1,185 native/presentation regression assertions pass.
  • Ten end-to-end runner checks pass: fresh JSON-driven presentations at discriminants 5 and -7, H1/H2 for GL at both fields and SL at -7, and resume behavior.
  • git diff --check passes. The full upstream HAP suite has not been run locally; GitHub CI runs it.

Opening as a draft for discussion of the provider API and its integration into HAP.

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.15%. Comparing base (91bd7ba) to head (f1347b0).

Files with missing lines Patch % Lines
lib/Voronoi/seb.gi 87.87% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
- Coverage   43.15%   43.15%   -0.01%     
==========================================
  Files         371      372       +1     
  Lines       67887    67974      +87     
==========================================
+ Hits        29296    29331      +35     
- Misses      38591    38643      +52     
Files with missing lines Coverage Δ
lib/Voronoi/seb.gi 40.22% <87.87%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dimpase dimpase changed the title Allow optional backends for Voronoi complex construction Accept request records and optional providers for Voronoi complexes Oct 21, 2026
@dimpase

dimpase commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

To be quick, Julia CI most probably needs a dedicated runner, where starting up Julia with all its needed dependencies (Oscar, Nemo, GAP, etc) takes long time. (Oscar project does have such runners, so it's matter of them lending the use of one of them here). Currently that run took 10 minutes, 7 of them was spent on on loading/compiling dependencies.

@dimpase
dimpase marked this pull request as ready for review October 23, 2026 01:50
@grahamknockillaree
grahamknockillaree merged commit 223c6b0 into gap-packages:master Oct 23, 2026
6 checks passed
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