Skip to content

fix: Don't skip for loops with negative literal ranges#8103

Merged
aakoshh merged 12 commits intoaf/8009-fix-range-modulofrom
af/8011-for-negative-range
Apr 22, 2025
Merged

fix: Don't skip for loops with negative literal ranges#8103
aakoshh merged 12 commits intoaf/8009-fix-range-modulofrom
af/8011-for-negative-range

Conversation

@aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Apr 16, 2025

Description

Problem*

Resolves #8011

Summary*

Fixes codegen_for to use try_convert_field_element_to_signed_integer instead of comparing the Field representations of the loop boundaries.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@aakoshh aakoshh requested a review from a team April 16, 2025 00:07
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 02d81e0 Previous: 3024dd3 Ratio
rollup-block-root 16.2 s 11.5 s 1.41

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@michaeljklein michaeljklein left a comment

Choose a reason for hiding this comment

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

LGTM

While looking for bugs, I found an unrelated panic when u1 is used as a for loop range: #8107

@aakoshh aakoshh merged commit f1299c5 into af/8009-fix-range-modulo Apr 22, 2025
54 of 57 checks passed
@aakoshh aakoshh deleted the af/8011-for-negative-range branch April 22, 2025 12:24
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.

3 participants