Skip to content

fix[codegen]: fix gas usage of iterators#4485

Merged
charles-cooper merged 2 commits intovyperlang:masterfrom
charles-cooper:fix/gas-list-iter
Feb 22, 2025
Merged

fix[codegen]: fix gas usage of iterators#4485
charles-cooper merged 2 commits intovyperlang:masterfrom
charles-cooper:fix/gas-list-iter

Conversation

@charles-cooper
Copy link
Copy Markdown
Member

@charles-cooper charles-cooper commented Feb 21, 2025

cd31867 (#4462) introduces a gas regression, which is that IRnode.is_literal evaluates to true even for pointers (which are not source-level literals). this commit changes the condition to be not .is_pointer, which should be the correct condition for needing to strictify into memory.

thanks to @pcaversaccio for spotting!

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

cd31867 introduces a gas regression, which is that
`IRnode.is_literal` evaluates to true even for pointers (which are not
source-level literals). this commit changes the condition to be
`not .is_pointer`, which should be the correct condition for needing to
strictify into memory.
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.06%. Comparing base (305813c) to head (5120a33).
Report is 95 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4485   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         120      120           
  Lines       17329    17329           
  Branches     2932     2932           
=======================================
  Hits        15954    15954           
  Misses        957      957           
  Partials      418      418           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@charles-cooper charles-cooper added the release - must release blocker label Feb 21, 2025
@charles-cooper charles-cooper added this to the v0.4.1 milestone Feb 21, 2025
@charles-cooper charles-cooper merged commit ba66226 into vyperlang:master Feb 22, 2025
162 checks passed
@charles-cooper charles-cooper deleted the fix/gas-list-iter branch February 22, 2025 17:51
Copy link
Copy Markdown
Collaborator

@pcaversaccio pcaversaccio left a comment

Choose a reason for hiding this comment

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

Thx for fixing the regression - I would like to highlight one interesting observation. The gas regression was not visible in the venom pipeline; i.e.

  • legacy:
    image

  • venom:
    image

You can see this also here: pcaversaccio/snekmate@f8b5003#diff-833bb263ee4e534b467920b3b014bd0f7f03fc3be1274491a6366991b3a25b99

image

@charles-cooper
Copy link
Copy Markdown
Member Author

Thx for fixing the regression - I would like to highlight one interesting observation. The gas regression was not visible in the venom pipeline; i.e.

thanks -- this is because .is_literal was evaluating to false since they appear in IR as alloca variables instead of raw int pointers when venom is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release - must release blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants