Skip to content

Fix exponential overcounting in composite recipe listings#6796

Merged
jkschneider merged 1 commit intomainfrom
jkschneider/fix-recipe-count
Feb 23, 2026
Merged

Fix exponential overcounting in composite recipe listings#6796
jkschneider merged 1 commit intomainfrom
jkschneider/fix-recipe-count

Conversation

@jkschneider
Copy link
Copy Markdown
Member

Summary

  • The BFS loop in RecipeListing.fromDescriptor processed the root descriptor twice (once from the pre-initialized d variable and again when polled from the queue), causing each level of the tree to be re-expanded exponentially
  • Deeply nested composites like UpgradeToJava25 reported 30k+ recipes instead of ~468
  • Fixed by starting the queue with the root's children and counting one vertex per poll

The BFS loop in RecipeListing.fromDescriptor processed the root
descriptor twice—once from the pre-initialized variable and again
when polled from the queue—causing each level of the tree to be
re-expanded, producing counts like 30k+ for deeply nested composites
such as UpgradeToJava25.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Feb 23, 2026
@jkschneider jkschneider merged commit f7120ec into main Feb 23, 2026
1 check failed
@jkschneider jkschneider deleted the jkschneider/fix-recipe-count branch February 23, 2026 11:55
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant