8000 Remove bitwise usage in split. by ilyalesokhin-starkware · Pull Request #1033 · starkware-libs/stwo-cairo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove bitwise usage in split. #1033

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

Merged
merged 1 commit into from
Jun 25, 2025
Merged

Remove bitwise usage in split. #1033

merged 1 commit into from
Jun 25, 2025

Conversation

ilyalesokhin-starkware
Copy link
Collaborator
@ilyalesokhin-starkware ilyalesokhin-starkware commented Jun 24, 2025

This change is Reviewable

@ilyalesokhin-starkware
Copy link
Collaborator Author

stwo_cairo_verifier/crates/cairo_air/src/utils.cairo line 138 at r1 (raw file):

        // If we need more bits to fill, take from next word.
        if n_bits_in_word < memory_id_to_big::N_BITS_PER_FELT {
            segment = segment | ((WrappingMul::wrapping_mul(word, pow2(n_bits_in_word))) & mask);

I'm not sure I understand this code.
shouldn't we shit segment before the or?
is there an overlap in the bits here?

Code quote:

segment = segment | ((WrappingMul::wrapping_mul(word, pow2(n_bits_in_word))) & mask);

@ilyalesokhin-starkware
Copy link
Collaborator Author

stwo_cairo_verifier/crates/cairo_air/src/utils.cairo line 138 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

I'm not sure I understand this code.
shouldn't we shit segment before the or?
is there an overlap in the bits here?

I guess the missing bits are addes as the most significant bits and there is no overlap.

Copy link
Collaborator
@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @anatgstarkware, @andrewmilson, @DavidLevitGurevich, and @shaharsamocha7)

@ilyalesokhin-starkware ilyalesokhin-starkware changed the base branch from sharp7 to main June 25, 2025 09:43
@ilyalesokhin-starkware ilyalesokhin-starkware enabled auto-merge (squash) June 25, 2025 09:43
Copy link
Collaborator Author
@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @anatgstarkware, @andrewmilson, @DavidLevitGurevich, and @shaharsamocha7)

@ilyalesokhin-starkware ilyalesokhin-starkware merged commit 6c856c4 into main Jun 25, 2025
20 checks passed
@ilyalesokhin-starkware ilyalesokhin-starkware deleted the ilya/split branch June 25, 2025 10:01
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.

2 participants
0