Skip to content

Ensure peer_traverser does not unnecessarily expand the graph#477

Merged
Ralith merged 1 commit intoRalith:masterfrom
patowen:fix-peer-traverser-unnecessary-generation
Jan 27, 2026
Merged

Ensure peer_traverser does not unnecessarily expand the graph#477
Ralith merged 1 commit intoRalith:masterfrom
patowen:fix-peer-traverser-unnecessary-generation

Conversation

@patowen
Copy link
Collaborator

@patowen patowen commented Jan 27, 2026

Although I thought I caught this bug in #454 (comment), it was still present in the final version of the PR I merged.

The bug: When finding all parent nodes of the base node, I accidentally expand the graph in all directions from the base node when looking for descenders (by calling ensure_neighbor instead of neighbor and then comparing the "length" of the two nodes). This results in the graph having several times more nodes than it needs to have.

I've added a test case to ensure this bug does not show up again, in addition to simplifying the logic somewhat to make it easier to follow.

@patowen patowen requested a review from Ralith January 27, 2026 02:52
@Ralith Ralith merged commit 0773c2c into Ralith:master Jan 27, 2026
4 checks passed
@patowen patowen deleted the fix-peer-traverser-unnecessary-generation branch January 27, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants