concretization: improve error messages for requirements#45800
concretization: improve error messages for requirements#45800tgamblin merged 88 commits intospack:developfrom
Conversation
…y less useful error message
…as config or in the package.py (what's strange is that sometimes, error messages from requirements are traceable)
…of external error)
…ternal at all: better to pick one and show the resulting conflicts from that
also add positive assertions to error message test (make sure the error message contains certain pieces of info)
|
@becker33 I think all your requests are addressed now. I also cleaned up some of the comments in the tests It may be arguable whether and now it is better, but perhaps still not good. |
| { attr("version", node(ID, Package), Version) } :- | ||
| requirement_group_member(ConditionID, Package, RequirementID), | ||
| activate_requirement(node(ID, Package), RequirementID), | ||
| pkg_fact(Package, condition_effect(ConditionID, EffectID)), | ||
| imposed_constraint(EffectID, "node_version_satisfies", Package, Version). |
There was a problem hiding this comment.
Some timing with requirements on would have been nice in this PR, so to know if there is any slow-down / speed-up to be expected.
There was a problem hiding this comment.
Apologies yes benchmarking would be useful: How do I do that? (i.e. how do I produce the before/after stats that you add to some PRs)?
This particular rule can be removed (although your comment likely does not apply to it specifically): I looked into it and this was originally added (in 75730ec) for 344d77a, but an intervening merge removed that logic and it appears that as a result this doesn't actually improve error output for any of the tests (nor any that I can come up with)
There was a problem hiding this comment.
How do I do that? (i.e. how do I produce the before/after stats that you add to some PRs)?
We have a Spack extension here https://github.com/spack/spack-benchmark In the README you'll find the commands.
|
I noticed a general slowdown of concretization yesterday, with respect to the last time I measured on my machine. I performed a test on a reduced set of specs (just because it takes a lot of time to do the full test). Here are the results of this PR compared to the previous commit on develop (ecde809 vs 3949a27) benchmark.pr.csv
It seems this PR caused a general slowdown of concretization. For |
|
Benchmarking is reporting a regression for me comparing this with prior commit - the following is just the solve times (as the total times are much closer):
Is this average output as part of There is likewise a regression when comparing ecde809 with 4170858 |
|
After 4170858, the only logic that isn't changing weights is If I revert that part on top of 4170858, then the benchparks show no significant timing change. This part is useful for error messages, but it only needs to exist when mixing in EDIT: my initial attempt at this in #51576 does not work. |
No, it's the result of
Yes, it's the two extra rules that increased the time. Once v1.1 is released, I'll try to check if profiling with latest development version of clingo helps identifying better what to change. Unfortunately, using development version of clingo is also prone to trip into bugs (see potassco/clingo#583) |
|
I've found that this PR makes the concretizer hang when given a deprecated spec. For example, If I manually update the python package to remove the deprecation, I get - with default_args(deprecated=True):
+ with default_args(deprecated=False):I have confirmed this is not related to #51599 as I'm able to concretize openmpi without issue. It might be similar to #51279, but that issue was filed in early September before this PR was merged. Update: |
|
@hainest Can you check #51612 ? That should solve the performance regressions of this PR, and more. With that I get: $ time spack solve [email protected]
==> Error: failed to concretize `[email protected]` for the following reasons:
1. Cannot satisfy '[email protected]' 1(3.14.0)
2. Cannot satisfy '[email protected]' 4(3.14.0)
required because [email protected] requested explicitly
real 0m21,530s
user 0m20,953s
sys 0m0,521sWithout instead: $ time spack solve [email protected]
^C
==> Error: Keyboard interrupt.
^C
real 1m30,229s
user 1m29,591s
sys 0m0,519s |


This is intended to test out concretization error messages. Each test culminates in a concretization attempt that must fail (because the problem is over-constrained by design).
Some of these tests add constraints to package definitions, and some add requirements to configuration. The error messages vary in quality but the tests are here to help experiment with tweaks to the
.lpfiles to improve the messages. The tests do not include any enforcement of what appears in the error message: that has to be done manually, with something likespack unit-test -k error_messages.py -s -v.Updates
test_version_range_null,test_null_variant_for_requested_versionerror_messages.lp.TODOs
(old)
All the tests here fail (on purpose)(old)
All current tests added here do this by adding constraints to the package definition, but should probably also check mixing in config/command-line requirements.