Make the tests independent of polymake's convex hull backend - #28
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 72.00% 72.23% +0.23%
==========================================
Files 15 15
Lines 868 868
==========================================
+ Hits 625 627 +2
+ Misses 243 241 -2 🚀 New features to boost your workflow:
|
fingolfin
force-pushed
the
portable-tests
branch
from
August 16, 2026 20:41
40f3a91 to
495f541
Compare
fingolfin
force-pushed
the
portable-tests
branch
from
August 16, 2026 21:45
495f541 to
6c658b9
Compare
polymake enumerates facets in an order that depends on which convex hull backend it picks -- ppl, cdd, lrs or the built-in beneath_beyond -- and FACETS rows are only determined up to a positive scalar. Four expectations in polymaking.tst encoded one particular backend's answer, so the suite failed for anyone whose polymake was built without ppl. Canonicalise before comparing: sort faces by dimension and then lexicographically, scale each FACETS row to a primitive integer vector keeping its sign, and sort the facet list. ADJACENCY, whose node numbering follows the same facet order, is instead checked structurally: it is the covering relation of FACES, which the same call returns in the same node order. Also stop the suite from rewriting files it does not own. It pointed the data directory at the package's own tst directory and read pplane.poly from there, which polymake upgrades in place, so running the tests dirtied the working tree and made a second run test a different input. Copy to a temporary directory first, and let CI catch a regression with git diff --exit-code. Set POLYMAKING_CHULL to test a specific backend, e.g. POLYMAKING_CHULL=cdd gap tst/testall.g. CI now covers cdd and beneath_beyond in addition to the default. While here, repair visual.tst, which had rotted while excluded from the suite. Fixes #18. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
It was only declared in GAP 4.11, and polymaking still supports older versions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fingolfin
force-pushed
the
portable-tests
branch
from
August 16, 2026 21:51
6c658b9 to
bdb0ad7
Compare
fingolfin
commented
Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18. Stacked on #27.
The failure was caused by different convex hull backends producing different (but equally valid) results.
To fix this, canonicalise before comparing:
FACES-- sort by dimension, then lexicographically, so the expected valuestill reads like a face lattice.
FACETS-- scale each row to a primitive integer vector, then sort. Signsare preserved: every differing pair I checked differs by a positive factor,
and facet orientation is meaningful, so normalising it away would discard
real information.
VERTICES_IN_FACETS-- sort. TheVERTICESorder is stable (thatexpectation already passed).
ADJACENCY-- checked structurally instead. It is the covering relation ofFACES, and the same call returns both in the same node order, so norelabelling is needed:
Canonicalising it by relabelling would have produced a 46-line literal that
nobody could review. A degree-sequence check is included alongside. Note the
relation is directed upward only, so a symmetry check would be wrong.
The suite no longer rewrites checked-in files
polymaking.tstpointed the data directory at the package's owntst/andread
pplane.polyfrom there. polymake upgrades old-format files in place, sorunning the tests dirtied the working tree and made a second run test a
different input. This happens on the CI runner too, not just on Gentoo:
Now copied to a temporary directory first, with
git diff --exit-codein CI tocatch a regression.
Testing
Set
POLYMAKING_CHULLto pick a backend:0 failures under
ppl,cdd,lrs,beneath_beyondand the default, andgit statusis clean afterwards. CI gainscddandbeneath_beyondjobs;beneath_beyondis built into polymake so it is always available, andcddiswhat Debian and Gentoo builds tend to use.
I used an environment variable rather than writing
gap.inibecause I couldnot confirm that
gap-actions/run-pkg-testsreadsgap.ini; an env var isimmune to how CI invokes GAP, and makes local reproduction a single line.
While here, repaired
visual.tst, which had rotted while excluded from thesuite -- it expected no output from
LoadPackageand had a stray trailingspace. It passes when run manually now.
🤖 Generated with Claude Code