Conversation
5 tasks
5 tasks
Collaborator
Author
This was referenced Jan 27, 2026
eytan-starkware
approved these changes
Jan 27, 2026
Contributor
eytan-starkware
left a comment
There was a problem hiding this comment.
@eytan-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @TomerStarkware).
Since the size of the stack increase is known, using a vec is easy. SIERRA_UPDATE_PATCH_CHANGE_TAG=No interface change.
8f204b9 to
9ad4ccf
Compare
6201638 to
a12181a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Improved the validation of stack top variables in the Sierra to CASM compiler by replacing the
UnorderedHashMapwith a more efficient vector-based approach. Also replacedzip_eqwith standardzipfor better compatibility and added a new parameter tovalidate_stack_topto track stack top size more accurately.Type of change
Please check one:
Why is this change needed?
The current implementation uses an
UnorderedHashMapto track stack top variables, which is less efficient than a direct vector-based approach. This change optimizes the validation process by using a vector with direct indexing instead of hash map lookups, improving performance in the Sierra to CASM compilation process.What was the behavior or documentation before?
Previously, the code used an
UnorderedHashMapto track stack top variables and relied onzip_eqfor strict iteration, which could be unnecessarily restrictive in some cases.What is the behavior or documentation after?
Now the code uses a more efficient vector-based approach to track stack top variables, with direct indexing instead of hash map lookups. It also uses standard
zipinstead ofzip_eqfor better compatibility, and tracks stack top size more accurately with an explicit parameter.Additional context
This change is part of ongoing efforts to optimize the Sierra to CASM compilation process, which is a critical part of the Cairo compiler pipeline.