Repository navigation
Clear stale task tags when overriding factories - #573
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
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.
Fixes #572.
Failure
TaggedTasks(allow_overriding_keys=True)permits a new factory to replace an existing one with the same function name. Previously,add()updated the primary task map and inserted the replacement into its new tags, but did not remove registrations under its old tags. A factory re-registered undernewtherefore remained discoverable throughtagged('old'), even though its current registration did not includeold.Overriding with no tags also left obsolete entries in
tags(). Because the tag index holds factory references, this could retain replaced callables and produce incorrect tag-based task selections.Change
When overriding an existing key, remove that key from all previous tag memberships before installing the replacement. Remove tag buckets that become empty. Then add the new factory under the newly supplied tags.
The change preserves the registration order in the primary task map and leaves all other factories untouched. The existing duplicate-name rejection with
allow_overriding_keys=Falseis unchanged.Validation
main: stale tags after changed registration, obsolete tags after an untagged replacement, and unwanted membership when another factory shares an old tag.containers,rewardsandxml_toolsutility test selection: 50 passed on Python 3.12/macOS.git diff --checkpass.Scope
Only replacement registrations change. New registrations, lookups, tag intersections and the no-overrides mode retain their behaviour. The broader physics and rendering test suites were not run for this utility-level change.