Declare the extension hooks public and document their contracts - #28
Merged
Conversation
foreach_support and foreach_support_sym are how a cover algorithm reads a matrix: specializing them is what lets a storage type be covered in time proportional to its support, as the bundled SparseArrays extension does. AbstractCoverPenalty is the supertype of the exported penalties and the first-argument slot of most of the API. All three were reachable and relied upon, but none declared its status, so users had no way to tell a supported extension point from an internal that could move. Each now states what an implementer must guarantee. Two points that the code enforced only by convention are written down: - foreach_support_sym requires A to be symmetric in value, not merely square. It cannot check this cheaply and does not try; the precondition is what makes reporting one member of each index pair sufficient. - Subtyping AbstractCoverPenalty buys cover_objective and nothing more. The solvers dispatch on the concrete built-in penalties, so a custom penalty can score a cover but cannot be minimized. Saying so beats letting a MethodError be the documentation. `public` is parsed as a keyword only from Julia 1.11, so the declaration goes through a VERSION gate rather than a new Compat dependency. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 12 12
Lines 2016 2016
=======================================
Hits 1986 1986
Misses 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
foreach_support and foreach_support_sym are how a cover algorithm reads a
matrix: specializing them is what lets a storage type be covered in time
proportional to its support, as the bundled SparseArrays extension does.
AbstractCoverPenalty is the supertype of the exported penalties and the
first-argument slot of most of the API. All three were reachable and
relied upon, but none declared its status, so users had no way to tell a
supported extension point from an internal that could move.
Each now states what an implementer must guarantee. Two points that the
code enforced only by convention are written down:
square. It cannot check this cheaply and does not try; the precondition
is what makes reporting one member of each index pair sufficient.
The solvers dispatch on the concrete built-in penalties, so a custom
penalty can score a cover but cannot be minimized. Saying so beats
letting a MethodError be the documentation.
publicis parsed as a keyword only from Julia 1.11, so the declarationgoes through a VERSION gate rather than a new Compat dependency.
Assisted-by: Claude Opus 4.8 noreply@anthropic.com