Use the pending tasks cache in the circular dependency check. - #4179
Merged
Conversation
Signed-off-by: ashprice <gitcommit1@sl.ashprice.co.uk>
djmitche
approved these changes
Aug 25, 2026
| auto& tdb2 = Context::getContext().tdb2; | ||
|
|
||
| std::unordered_set<std::string> visited{task_uuid}; | ||
| std::vector<std::string> stack; |
Collaborator
There was a problem hiding this comment.
I'm curious why the switch from stack to vector?
Contributor
Author
There was a problem hiding this comment.
If there was a reason for this I have forgotten it, I guess I thought it might be more memory efficient at the time but I don't see any reason to think that.
I wrote the original code this PR was based on in early July or late June so I might have had another reason and forgotten about it, it seems I had originally used stack.
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.
Introduced ahead of the other work to address #4178 .
Main changes:
find_pending().Three tests are introduced:
test_completed_not_circular()checks that completed tasks do not cause a positive circularity check.test_circular_with_visited_sibling()makes sure that visited siblings do not get overwritten when the unvisited sibling is popped.test_dependency_modify_with_cold_pending_cache()checks that the pending cache is initialized during modifications. It uses an empty filter because most modify commands warm the cache, but this one doesn't.There are still remaining issues with empty filters, bulk modifications of completed tasks, and bulk modifications of dependencies in other regards, I plan to address these in a future PR.
Also, this won't bring broader performance improvement on its own, because it doesn't touch the stuff relevant for eg.
task ready.