Skip to content

solver: support clingo v6 - #52411

Merged
tgamblin merged 7 commits into
developfrom
hs/feature/clingo-v6
May 21, 2026
Merged

tgamblin merged 7 commits into
developfrom
hs/feature/clingo-v6

Conversation

@haampie

@haampie haampie commented May 16, 2026 •

Copy link
Copy Markdown
Member

Clingo v6 is a full rewrite with two changes that affect us:

  • New Python API
  • Deprecation of anonymous variables inside negative literals (like not p(X, _))

With potassco/clingo@a2b3e45 now upstream the tests are passing; at the start of this PR splicing and propagation tests were failing.

Signed-off-by: Harmen Stoppels <[email protected]>
haampie added 3 commits May 17, 2026 00:15
clingo v6 no longer implicitly projects anonymous variables that appear
only in negative body literals (older gringo did, and Spack passed
--project-anonymous to keep that behavior on v6). Replace each
`not foo(..., _, ...)` with a `not foo_aux(...)` against an explicit
auxiliary projection, and drop the flag.

Signed-off-by: Harmen Stoppels <[email protected]>
Works around a clingo v6 fixed-point failure on the splice/depends_on
cycle by deriving the parent->splice-node edge directly from the splice's
preconditions, instead of relying on the
imposed_constraint -> attr("dependency_holds") -> cardinality choice
chain. v5 already finds this atom via the longer path; v6 does not.

Signed-off-by: Harmen Stoppels <[email protected]>
Mirrors the existing clingo-cffi job, but pip-installs the pre-release
clingo v6 from Test PyPI before running the concretization suite. Catches
regressions against the in-development grounder/solver while v6 isn't
yet on stable PyPI. Marked continue-on-error since v6 is pre-release.

Signed-off-by: Harmen Stoppels <[email protected]>
@github-actions github-actions Bot added the ci Issues related to Continuous Integration label May 16, 2026
@haampie
haampie force-pushed the hs/feature/clingo-v6 branch from e8d996c to b149483 Compare May 20, 2026 07:47

@tgamblin tgamblin 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.

This mostly LGTM but can we pull the stuff that is needed for compatibility out of core.py and out of asp.py into some separate compat.py? I think it would help us know what needs to be ripped out when the time comes.

Comment thread lib/spack/spack/solver/concretize.lp Outdated
Signed-off-by: Harmen Stoppels <[email protected]>
@tgamblin
tgamblin merged commit eaca823 into develop May 21, 2026
33 of 34 checks passed
@tgamblin
tgamblin deleted the hs/feature/clingo-v6 branch May 21, 2026 23:36
alalazo added a commit that referenced this pull request Jul 2, 2026
#52411 introduced a regression in the error message reporting mechanism,
because it's not passing `has_provider/1` to `error_message.lp`

Signed-off-by: Massimiliano Culpo <[email protected]>
haampie pushed a commit that referenced this pull request Jul 6, 2026
#52411 introduced a regression in the error message reporting mechanism,
because it's not passing `has_provider/1` to `error_message.lp`

Signed-off-by: Massimiliano Culpo <[email protected]>
haampie pushed a commit that referenced this pull request Jul 6, 2026
#52411 introduced a regression in the error message reporting mechanism,
because it's not passing `has_provider/1` to `error_message.lp`

Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Harmen Stoppels <[email protected]>
becker33 pushed a commit that referenced this pull request Jul 6, 2026
#52411 introduced a regression in the error message reporting mechanism,
because it's not passing `has_provider/1` to `error_message.lp`

Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Harmen Stoppels <[email protected]>
Aiden2244 pushed a commit to Aiden2244/spack that referenced this pull request Jul 20, 2026
Clingo v6 is a full rewrite with two changes that affect us:

* New Python API
* Deprecation of anonymous variables inside negative literals (like `not
p(X, _)`)

With
potassco/clingo@a2b3e45
now upstream the tests are passing; at the start of this PR splicing and
propagation tests were failing.

---------

Signed-off-by: Harmen Stoppels <[email protected]>
Aiden2244 pushed a commit to Aiden2244/spack that referenced this pull request Jul 20, 2026
spack#52411 introduced a regression in the error message reporting mechanism,
because it's not passing `has_provider/1` to `error_message.lp`

Signed-off-by: Massimiliano Culpo <[email protected]>
becker33 pushed a commit that referenced this pull request Sep 29, 2026
…#53124)

Analyzing why a solve failed printed:
```
atom does not occur in any rule head: has_provider(node(X,Virtual))
```
when the failed model had no virtual packages. Declare every predicate
the error rules read with `#defined`.

The message was introduced in #52411, which replaced the declared
`provider/2` with `has_provider/1` in `error_messages.lp`.

Signed-off-by: Massimiliano Culpo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Issues related to Continuous Integration solver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants