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

Simplify get_offset_value_reference and add unit tests #1662

Closed

Conversation

tcoratger
Copy link

Simplify get_offset_value_reference and add unit tests

Description

  • The logical test on base_addr and offset to know if we should return null is implicitly already provided by the Relocatable addition in the last step of the get_offset_value_reference function, so that I don't think it's needed is as an overhead.
  • Two unit tests are added to test edge configurations.

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 96.70%. Comparing base (0a39534) to head (99575c7).
Report is 33 commits behind head on main.

Files Patch % Lines
vm/src/hint_processor/hint_processor_utils.rs 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1662      +/-   ##
==========================================
- Coverage   97.12%   96.70%   -0.43%     
==========================================
  Files          91       95       +4     
  Lines       37246    38166     +920     
==========================================
+ Hits        36176    36907     +731     
- Misses       1070     1259     +189     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fmoletta fmoletta added tests Implementation of tests coverage labels Mar 13, 2024
@@ -165,10 +165,6 @@ fn get_offset_value_reference(
apply_ap_tracking_correction(vm.get_ap(), var_ap_trackig, hint_ap_tracking)?
};

if offset.is_negative() && base_addr.offset < offset.unsigned_abs() as usize {
Copy link
Member

Choose a reason for hiding this comment

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

Why are we deleting this check?

Copy link
Author

Choose a reason for hiding this comment

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

Because the logical test on base_addr and offset to know if we should return null is implicitly already provided by the Relocatable addition in the last step of the get_offset_value_reference function, so that I don't think it's needed is as an overhead.

@fmoletta
Copy link
Member

fmoletta commented Jun 4, 2024

This function no longer exists in the main branch

@fmoletta fmoletta closed this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Implementation of tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants