Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: usort hints integration tests #459

Merged
merged 17 commits into from
Jun 28, 2024

Conversation

TAdev0
Copy link
Member

@TAdev0 TAdev0 commented Jun 12, 2024

@cicr99 i checked hints separately locally and it seems fine, except usortBodyCode which is not detected by our VM, just like signedDivRem

We might need to do like lambda go and declare each hint as a const

@TAdev0 TAdev0 marked this pull request as draft June 12, 2024 23:23
@TAdev0 TAdev0 marked this pull request as ready for review June 17, 2024 19:49
@TAdev0
Copy link
Member Author

TAdev0 commented Jun 17, 2024

@cicr99 @har777 @MaksymMalicki

Usort integration test is finished. I modified a few things in usort hints:

  • There was fp.Element used in 2 places where uint64 should have been used. It saves some computation moreover
  • I hardcoded usort_max_size which is a global(), just like we did for keccak state size or keccak max input size
  • I reorder all the usort hints so that they are in the order they are executed in usort cairo function

Let's wait Finalize Segment to be merged to make sure the memory traces match, but i tested outputs and everything against other VMs and its ok

@TAdev0 TAdev0 self-assigned this Jun 17, 2024
@TAdev0 TAdev0 marked this pull request as draft June 17, 2024 20:07
@TAdev0 TAdev0 marked this pull request as ready for review June 22, 2024 10:43
@TAdev0
Copy link
Member Author

TAdev0 commented Jun 22, 2024

@har777 @cicr99 @MaksymMalicki ready for approval/merging

I added a new test for it to make sure multiplicities works well (lambdaclass didnt cover this)

Copy link
Contributor

@Sh0g0-1758 Sh0g0-1758 left a comment

Choose a reason for hiding this comment

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

Well the integration test looks good. Other than that I believe its mostly relocation with a change in one place where you have converted felt to uint64. I think @cicr99 should have a take on that. I just left one comment on the change in implementation of a hint.

pkg/hintrunner/zero/zerohint_usort.go Show resolved Hide resolved
@TAdev0
Copy link
Member Author

TAdev0 commented Jun 27, 2024

@Sh0g0-1758 we already discussed with Carmen the change to uint64 here. If you check in detail, you'll see i changed it always for variable that represents either a length of array or a index in an array. Its ok then

Copy link
Contributor

@Sh0g0-1758 Sh0g0-1758 left a comment

Choose a reason for hiding this comment

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

LGTM

@Sh0g0-1758 Sh0g0-1758 merged commit 598576d into NethermindEth:main Jun 28, 2024
4 checks passed
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.

None yet

2 participants