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

Refactored bounded_int_trim. #7062

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Refactored bounded_int_trim. #7062

merged 1 commit into from
Jan 15, 2025

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 12, 2025

Not updating the given range.
Splitting into bounded_int_trim_min and bounded_int_trim_max.

@orizi orizi requested a review from liorgold2 January 12, 2025 17:56
@reviewable-StarkWare
Copy link

This change is Reviewable

@orizi orizi force-pushed the orizi/minor-trim-updates branch from 3e786b1 to 2031d17 Compare January 12, 2025 18:12
Copy link
Collaborator

@liorgold2 liorgold2 left a comment

Choose a reason for hiding this comment

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

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @orizi)


corelib/src/internal/bounded_int.cairo line 129 at r1 (raw file):

    }
    pub impl Max<T, const MIN: felt252, const MAX: felt252> of super::TrimMaxHelper<T> {
        type Target = super::BoundedInt<MIN, MAX>;

Can't you use MAX - 1 (where MAX is taken from another unrelated trait)? Why do you need all these helpers?


crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 397 at r1 (raw file):

    const STR_ID: &'static str =
        if ABOVE { "bounded_int_trim_max" } else { "bounded_int_trim_min" };

Maybe rename ABOVE to IS_MAX? To be consistent with the min, max naming?

Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @liorgold2)


corelib/src/internal/bounded_int.cairo line 129 at r1 (raw file):

Previously, liorgold2 wrote…

Can't you use MAX - 1 (where MAX is taken from another unrelated trait)? Why do you need all these helpers?

hmm - probably in some way - but probably not for this PR.
additionally, calculations of generic params to be used as generic args is problematic (and definitely not supported on 2.10.* and only partially on main)


crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 397 at r1 (raw file):

Previously, liorgold2 wrote…

Maybe rename ABOVE to IS_MAX? To be consistent with the min, max naming?

Done.

Not updating the given range.
Splitting into `bounded_int_trim_min` and `bounded_int_trim_max`.
@orizi orizi force-pushed the orizi/minor-trim-updates branch from 2031d17 to 3e72a69 Compare January 14, 2025 10:59
Copy link
Collaborator

@liorgold2 liorgold2 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: all files reviewed, 1 unresolved discussion (waiting on @orizi)

Copy link
Collaborator

@liorgold2 liorgold2 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)

@orizi orizi added this pull request to the merge queue Jan 15, 2025
Merged via the queue into dev-v2.10.0 with commit e434a7a Jan 15, 2025
48 checks passed
orizi added a commit that referenced this pull request Jan 15, 2025
@orizi orizi deleted the orizi/minor-trim-updates branch January 15, 2025 15:41
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
…7087)

chore: orthographic correction in file if_else (#7088)

prevents closure parameters from being declared as refrences (#7078)

Refactored bounded_int_trim. (#7062)

Added const for starknet types. (#6961)

feat(corelib): Iterator::fold (#7084)

feat(corelib): Iterator::advance_by (#7059)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)

feat(corelib): storage vectors iterators (#6941)

Extract ModuleHelper from const folding. (#7099)

Added support for basic `Into`s in consts. (#7100)

Removed taking value for `validate_literal`. (#7101)

added closure params to semantic defs in lowering (#7085)

Added support for `downcast` in constant context. (#7102)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
feat(corelib): Iterator::enumerate (#7048)

fix: Fix handling of --skip-first argument Update release_crates.sh (#7087)

chore: orthographic correction in file if_else (#7088)

prevents closure parameters from being declared as refrences (#7078)

Refactored bounded_int_trim. (#7062)

Added const for starknet types. (#6961)

feat(corelib): Iterator::fold (#7084)

feat(corelib): Iterator::advance_by (#7059)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)

feat(corelib): storage vectors iterators (#6941)

Extract ModuleHelper from const folding. (#7099)

Added support for basic `Into`s in consts. (#7100)

Removed taking value for `validate_literal`. (#7101)

added closure params to semantic defs in lowering (#7085)

Added support for `downcast` in constant context. (#7102)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
feat(corelib): Iterator::enumerate (#7048)

fix: Fix handling of --skip-first argument Update release_crates.sh (#7087)

chore: orthographic correction in file if_else (#7088)

prevents closure parameters from being declared as refrences (#7078)

Refactored bounded_int_trim. (#7062)

Added const for starknet types. (#6961)

feat(corelib): Iterator::fold (#7084)

feat(corelib): Iterator::advance_by (#7059)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)

feat(corelib): storage vectors iterators (#6941)

Extract ModuleHelper from const folding. (#7099)

Added support for basic `Into`s in consts. (#7100)

Removed taking value for `validate_literal`. (#7101)

added closure params to semantic defs in lowering (#7085)

Added support for `downcast` in constant context. (#7102)

fix(corelib): Add the #[test] annotation to enumerate test (#7098)
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