Skip to content

Fix thoth consuming one extra op per iteration - #1352

Merged
Robotgiggle merged 4 commits into
mainfrom
thoth-opcount
Oct 26, 2026
Merged

Robotgiggle merged 4 commits into
mainfrom
thoth-opcount

Conversation

@Robotgiggle

@Robotgiggle Robotgiggle commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Fixes #1351. Also changes Thoth to automatically generate the output list and return it (without actually iterating) if the pattern list is empty, for efficiency purposes.

@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Hex Casting Oct 22, 2026
@Robotgiggle Robotgiggle added 1.20 optimization Improvement to existing features or performance (no new features or design work) labels Oct 22, 2026

@IridescentVoid IridescentVoid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the op increment is fine, but there's a logic error in the code here. (This also needs a bit of extra attention when porting to 1.21 since thoth's behavior changes there.)

@github-project-automation github-project-automation Bot moved this from 📋 Backlog to 🏗 In progress in Hex Casting Oct 22, 2026

@IridescentVoid IridescentVoid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'd prefer if another set of eyes could check over the logic too.

@Robotgiggle

Copy link
Copy Markdown
Member Author

I just extensively tested all three potential cases (normal thoth, no-patterns thoth with empty stack, no-patterns thoth with other stuff on the stack) and everything worked exactly as expected, so I think this is good to go.

@Robotgiggle
Robotgiggle added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit c22c3a6 Oct 26, 2026
9 checks passed
@Robotgiggle
Robotgiggle deleted the thoth-opcount branch October 26, 2026 23:31
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in Hex Casting Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20 optimization Improvement to existing features or performance (no new features or design work)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Thoth silently consumes an extra op every iteration

2 participants