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: math hints integration tests #440

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

TAdev0
Copy link
Contributor

@TAdev0 TAdev0 commented Jun 6, 2024

Not te be merged now.
Will add cairo files one after the other after testing.

For now, these cairo files are not detected when doing make integration as i created new folders to store them. Will adapte the make integration command input fetching once Finalize Segment PR is merged

  • : isQuadResidue
  • : signedDivRem
  • : pow
  • : splitFelt
  • : is_positive: also corrected an issue with the operander name
  • : cmp hints (tests include isNN, isNNOutOfRange, isLeFelt, assertLtFelt, assertLefelt, assertNN hints, and also pow)
  • : assertNotZero
  • : assertNotEqual
  • : assert250Bits

@TAdev0 TAdev0 self-assigned this Jun 6, 2024
@TAdev0 TAdev0 marked this pull request as draft June 12, 2024 14:24
@TAdev0
Copy link
Contributor Author

TAdev0 commented Jun 12, 2024

@cicr99 i tried copy pasting the lambda go VM but it still doesnt work.

Lambda uses const instead of string:

const SIGNED_DIV_REM = "from starkware.cairo.common.math_utils import as_int, assert_integer\n\nassert_integer(ids.div)\nassert 0 < ids.div <= PRIME // range_check_builtin.bound, \\\n    f'div={hex(ids.div)} is out of the valid range.'\n\nassert_integer(ids.bound)\nassert ids.bound <= range_check_builtin.bound // 2, \\\n    f'bound={hex(ids.bound)} is out of the valid range.'\n\nint_value = as_int(ids.value, PRIME)\nq, ids.r = divmod(int_value, ids.div)\n\nassert -ids.bound <= q < ids.bound, \\\n    f'{int_value} / {ids.div} = {q} is out of the range [{-ids.bound}, {ids.bound}).'\n\nids.biased_q = q + ids.bound"

when i do

signedPowCode string = "from starkware.cairo.common.math_utils import as_int, assert_integer\n\nassert_integer(ids.div)\nassert 0 < ids.div <= PRIME // range_check_builtin.bound, \\\n    f'div={hex(ids.div)} is out of the valid range.'\n\nassert_integer(ids.bound)\nassert ids.bound <= range_check_builtin.bound // 2, \\\n    f'bound={hex(ids.bound)} is out of the valid range.'\n\nint_value = as_int(ids.value, PRIME)\nq, ids.r = divmod(int_value, ids.div)\n\nassert -ids.bound <= q < ids.bound, \\\n    f'{int_value} / {ids.div} = {q} is out of the range [{-ids.bound}, {ids.bound}).'\n\nids.biased_q = q + ids.bound"

it doesnt work

@TAdev0
Copy link
Contributor Author

TAdev0 commented Jun 12, 2024

there is probably a trick to make it work with string , any idea?

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