Skip to content

bugfix: revert change to transitive dependencies (essential) - #248

Merged
niemeyer merged 1 commit into
canonical:mainfrom
letFunny:bugfix-transitive-essential
Oct 20, 2025
Merged

niemeyer merged 1 commit into
canonical:mainfrom
letFunny:bugfix-transitive-essential

Conversation

@letFunny

@letFunny letFunny commented Oct 14, 2025 •

Copy link
Copy Markdown
Collaborator

This commit reverts the change in
aca3b32 that changed the for loop to
use the new range semantics which was not equivalent because we were
mutating the contents of the array in the loop itself.

A test has been added to detect it.

  • Have you signed the CLA?

For context, the commit was part of PR #215 which introduced cosmetic changes to the code. The lesson here is that we should not change the code for the sake of cosmetics unless it is strictly necessary, subtle changes in semantics can introduce hard to find bugs.

This commit reverts the change in
aca3b32 that changed the for loop to
use the new range semantics which was not equivalent because we were
mutating the contents of the array in the loop itself.

A test has been added to detect it.
@letFunny
letFunny requested a review from niemeyer October 14, 2025 15:33
@letFunny letFunny added Simple Nice for a quick look on a minute or two Priority Look at me first Bug An undesired feature ;-) labels Oct 14, 2025
@github-actions

Copy link
Copy Markdown
Command Mean [s] Min [s] Max [s] Relative
BASE 8.545 ± 0.023 8.509 8.587 1.00
HEAD 8.553 ± 0.018 8.531 8.577 1.00 ± 0.00

@zhijie-yang zhijie-yang 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.

Thanks for the quick fix @letFunny . The new test looks good to me.

@niemeyer niemeyer 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.

Makes sense, thanks for the fix.

@niemeyer
niemeyer merged commit 3e6e615 into canonical:main Oct 20, 2025
@lczyk

lczyk commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

just spend about 1/2 a day thinking i found a bug in chisel, and i did. i found this one 😅 (i was on 1.2.0) glad it's fixed and just wanted to +1 this PR from the future. @zhijie-yang you've beat me to it by a month ;)

@lczyk

lczyk commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

also @letFunny

The lesson here is that we should not change the code for the sake of cosmetics

the lesson is also that we should not mutate an array while iterating over it 😉 i know this code is using a slice kindof like a queue, but then i'd make it an actual datastructure (which, yes, would likely be backed by a slice)

@letFunny
letFunny deleted the bugfix-transitive-essential branch November 21, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug An undesired feature ;-) Priority Look at me first Simple Nice for a quick look on a minute or two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants