CAP: Avoid duplicate methods for primitive replacements - #1868
Merged
mohamed-barakat merged 1 commit intoJul 31, 2026
Conversation
When a primitive CAP operation is replaced by another primitive implementation, update the category operation record without installing another method with identical filters. Installed dispatch methods now consult the current operation record, so the latest implementation is used while preserving the added_functions history. This avoids Julia method-overwrite errors during module precompilation. Add CapOperationInstallationInfo and emit a level-1 message when an accepted primitive installation replaces another primitive implementation. Include the operation, category, and old and new weights. CompilerForCAP previously used the number of accepted Add-functions as the expected number of installed GAP methods. These counts can differ depending on whether implementations are primitive, derived, final derived, or precompiled derived. In particular, replacing one primitive implementation with another changes the function used by the existing GAP method without installing a new method. Track the actual number of methods installed by CAP per operation and use it when checking for manually installed competing methods. Bump CAP to v2026.07-04 and CompilerForCAP to v2026.07-01.
kamalsaleh
force-pushed
the
duplicate_primitive_op
branch
from
July 30, 2026 22:22
3b57adc to
df70a6a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kamalsaleh
marked this pull request as ready for review
July 31, 2026 09:32
mohamed-barakat
approved these changes
Jul 31, 2026
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.
When a primitive CAP operation is replaced by another primitive
implementation, update the category operation record without installing
another method with identical filters.
Installed dispatch methods now consult the current operation record, so
the latest implementation is used while preserving the added_functions
history. This avoids Julia method-overwrite errors during module
precompilation.
Add CapOperationInstallationInfo and emit a level-1 message when an
accepted primitive installation replaces another primitive
implementation. Include the operation, category, and old and new weights.
CompilerForCAP previously used the number of accepted Add-functions as
the expected number of installed GAP methods. These counts can differ
depending on whether implementations are primitive, derived, final
derived, or precompiled derived. In particular, replacing one primitive
implementation with another changes the function used by the existing
GAP method without installing a new method. Track the actual number of
methods installed by CAP per operation and use it when checking for
manually installed competing methods.
Bump CAP to v2026.07-04 and CompilerForCAP to v2026.07-01.