[WIP] Improve satask() performance#11789
Conversation
(note: tautology corner cases handled incorrectly)
|
The changes look fine at a glance. I can't comment much on the changes to the DPLL code. I guess the sorting in And makes instantiating And very slow. I don't think any of the APIs that you changed are public, so I wouldn't worry about backwards compatibility. This whole code is supposed to be experimental anyway, so we should feel free to change it and its API as much as is needed. |
|
Re: bottleneck in converting to CNF. I haven't done any benchmarking, but I suspect we should abstract better in sathandlers.py to always return CNF clauses. We may want to "compile" them somehow. I do want to keep the facts themselves (the big for loop at the bottom) as readable as possible (it could be even potentially more readable, e.g., a pattern matching API had been suggested), but there are also opportunities to avoid duplicate computation. Pure compilation is more difficult than what the old assumptions do because of the generality of the facts (e.g., they apply to |
|
The test failures here definitely need to be fixed. I do seem to recall adding sufficient test cases for this code that I'd be fairly confident that it still works correctly once the tests are passing. |
|
Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. ❌ There was an issue with the release notes. Please do not close this pull request; instead edit the description after reading the guide on how to write release notes.
Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed. |
|
🚨🚨🚨ERROR🚨🚨🚨 There was an error automatically updating the release notes. Normally it should not have been possible to merge this pull request. You might want to open an issue about this at https://github.com/sympy/sympy-bot/issues. In the meantime, you will need to update the release notes on the wiki manually. The error message was: The pull request was merged even though the release notes bot had a failing status. |
|
It seems that the release notes were updated via #17144. |
This branch makes satask() about 20 times faster. There are no real algorithmic changes, this simply uses explicit data structures to avoid expensive operations such as
Andinstantiations,to_cnf()orknown_facts.rcall(). The bottleneck now appears to be converting the "relevant facts" to CNF.To do: