Optimize unit propagation with IncompatibilityIndex and binary clause fast-skipping - #4882
Draft
sigurdm wants to merge 2 commits into
Draft
Optimize unit propagation with IncompatibilityIndex and binary clause fast-skipping#4882sigurdm wants to merge 2 commits into
sigurdm wants to merge 2 commits into
Conversation
… fast-skipping - Extract IncompatibilityIndex to encapsulate clause indexing and candidate iteration. - Fast-skip binary clauses where neither term is satisfied by the partial solution. - Update doc/solver.md to describe binary clause specialization. - Add unit tests for IncompatibilityIndex.
… without redundant checks - Provide IncompatibilityIndex.forPackage() returning reverse-chronological iterable. - Eliminate redundant relation checks and per-package closure allocations. - Revert binary clause specialization text in doc/solver.md. - Update tests for IncompatibilityIndex.
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.
Summary
Optimizes PubGrub unit propagation in
VersionSolverby introducing a specializedIncompatibilityIndexand binary clause fast-skipping:IncompatibilityIndex: Encapsulates incompatibility indexing and candidate iteration out ofVersionSolver, reducingVersionSolver._propagateto a clean ~20-line loop.{foo ^1.0.0, not bar ^2.0.0}). During propagation, candidate binary clauses where neither term is satisfied by the partial solution are skipped immediately, avoiding redundant_propagateIncompatibilityevaluations while preserving exact PubGrub resolution semantics and reverse-chronological ordering.doc/solver.mdwith an explanation of binary clause specialization.test/incompatibility_index_test.dart.