diff options
author | Greg Becker <becker33@llnl.gov> | 2022-05-20 08:27:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 08:27:07 -0700 |
commit | ee04a1ab0b5c37c889aa104945e645b4786c617b (patch) | |
tree | f4ebc5f9c187056851414a1381037dd54f7de988 /.codecov.yml | |
parent | 55f4950ed4bf3aa6cc40fe0d296f99cf2df17903 (diff) | |
download | spack-ee04a1ab0b5c37c889aa104945e645b4786c617b.tar.gz spack-ee04a1ab0b5c37c889aa104945e645b4786c617b.tar.bz2 spack-ee04a1ab0b5c37c889aa104945e645b4786c617b.tar.xz spack-ee04a1ab0b5c37c889aa104945e645b4786c617b.zip |
errors: model error messages as an optimization problem (#30669)
Error messages for the clingo concretizer have proven challenging. The current messages are incredibly vague and often don't help users at all. Unsat cores in clingo are not guaranteed to be minimal, and lead to cores that are either not useful or need to be post-processed for hours to reach a minimal core.
Following up on an idea from a slack conversation with kwryankrattiger on slack, this PR takes a new approach. We eliminate most integrity constraints and minima/maxima on choice rules in clingo, and instead force invalid states to imply an error predicate. The error predicate can include context on the cause of the error (Package, Version, etc). These error predicates are then heavily optimized against, to ensure that we do not include error facts in the solution when a solution with no error facts could be generated. When post-processing the clingo solution to construct specs, any error facts cause the program to raise an exception. This leads to much more legible error messages. Each error predicate includes a priority and an error message. The error message is formatted by the remaining arguments to produce the error message. The priority is used to ensure that when clingo has a choice of which rules to violate, it chooses the one which will be most informative to the user.
Performance:
"fresh" concretizations appear to suffer a ~20% performance penalty under this branch, while "reuse" concretizations see a speedup of around 33%.
Possible optimizations if users still see unhelpful messages:
There are currently 3 levels of priority of the error messages. Additional priorities are possible, and can allow us finer granularity to ensure more informative error messages are provided in lieu of less informative ones.
Future work:
Improve tests to ensure that every possible rule implying an error message is exercised
Diffstat (limited to '.codecov.yml')
0 files changed, 0 insertions, 0 deletions