Repository navigation
Add diffing engine for dependency autodiscovery in mesa_signals/core.py - #3482
Merged
Merged
Conversation
Collaborator
Author
|
Performance benchmarks:
|
quaquel
reviewed
Mar 9, 2026
codebreaker32
force-pushed
the
diffing_deps
branch
from
March 12, 2026 16:01
e3656c0 to
abbc792
Compare
Collaborator
Author
|
Hi @quaquel |
Member
|
Sorry, I am rather busy at the moment. I had hoped to handle a couple of PRs today, but other stuff cropped up. |
Collaborator
Author
Its perfectly fine, I was just checking up! |
Member
|
@codebreaker32, I guess this still warrants a review? I quickly scanned it and it looks fine to me, but if we still want to merge this, I'll give it a closer look as well. |
Collaborator
Author
Yes and I have also given it a final look, LGTM so far! |
53 of 65 tasks
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
This PR addresses:
from #3227
Motivation
Currently, when a
@computed_propertyre-evaluates, it eagerly callsunobserveon every parent in its graph, executes the function, and then callsobserveon every discovered dependency from scratch. For a stable graph where the code path doesn't branch, this results in a costly and redundant "destroy and rebuild" cycle on every recalculation.We replaced the rebuild cycle with a "diffing" strategy using Python set math.
Key Changes
ComputedState._remove_parents()@computed_property