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: Implement hint on uint256_mul_div_mod #957

Merged
merged 17 commits into from
Apr 14, 2023
Merged

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Apr 10, 2023

@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #957 (432ae24) into main (a1a65fd) will increase coverage by 0.00%.
The diff coverage is 97.94%.

@@           Coverage Diff            @@
##             main     #957    +/-   ##
========================================
  Coverage   97.74%   97.75%            
========================================
  Files          74       74            
  Lines       30392    30538   +146     
========================================
+ Hits        29708    29851   +143     
- Misses        684      687     +3     
Impacted Files Coverage Δ
..._processor/builtin_hint_processor/uint256_utils.rs 99.40% <97.91%> (-0.60%) ⬇️
...int_processor/builtin_hint_processor_definition.rs 98.67% <100.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fmoletta fmoletta changed the title Add missing vm hints from 10.3. whitelist Implement hint on uint256_mul_div_mod Apr 11, 2023
@fmoletta fmoletta marked this pull request as ready for review April 11, 2023 13:45
@fmoletta fmoletta added the whitelisted-hint Implementation of hint on whitelist directory label Apr 11, 2023
@fmoletta fmoletta changed the title Implement hint on uint256_mul_div_mod feat: Implement hint on uint256_mul_div_mod Apr 13, 2023
@fmoletta fmoletta linked an issue Apr 13, 2023 that may be closed by this pull request
Comment on lines +242 to +256
let a_addr = get_relocatable_from_var_name("a", vm, ids_data, ap_tracking)?;
let b_addr = get_relocatable_from_var_name("b", vm, ids_data, ap_tracking)?;
let div_addr = get_relocatable_from_var_name("div", vm, ids_data, ap_tracking)?;
let quotient_low_addr =
get_relocatable_from_var_name("quotient_low", vm, ids_data, ap_tracking)?;
let quotient_high_addr =
get_relocatable_from_var_name("quotient_high", vm, ids_data, ap_tracking)?;
let remainder_addr = get_relocatable_from_var_name("remainder", vm, ids_data, ap_tracking)?;

let a_low = vm.get_integer(a_addr)?;
let a_high = vm.get_integer((a_addr + 1_usize)?)?;
let b_low = vm.get_integer(b_addr)?;
let b_high = vm.get_integer((b_addr + 1_usize)?)?;
let div_low = vm.get_integer(div_addr)?;
let div_high = vm.get_integer((div_addr + 1_usize)?)?;
Copy link
Member

Choose a reason for hiding this comment

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

I think we'll need a getter for this kind of structured data eventually, if possible generic so they're still refs.

@pefontana pefontana added this pull request to the merge queue Apr 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 13, 2023
@fmoletta fmoletta added this pull request to the merge queue Apr 13, 2023
@Oppen Oppen removed this pull request from the merge queue due to a manual request Apr 13, 2023
@Oppen Oppen added this pull request to the merge queue Apr 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 13, 2023
@juanbono juanbono added this pull request to the merge queue Apr 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 14, 2023
@fmoletta fmoletta added this pull request to the merge queue Apr 14, 2023
Merged via the queue into main with commit 5d861c9 Apr 14, 2023
9 checks passed
@fmoletta fmoletta deleted the 10.3-whitelist-hints branch April 14, 2023 15:32
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add normalize address hints

* Revert "Add normalize address hints"

This reverts commit 86077f2.

* Add uint256_mul_div_mod hint

* Add hint to match

* Expand uint256 integration test

* use u128::MAX

* Fix value

* Manage quotient & remainder as BigUint

* Add test for hint

* Add test for hint

* Add misc test

* Add changelog entry

* fmt

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Hint] UINT256_MUL_DIV_MOD
3 participants