-
Notifications
You must be signed in to change notification settings - Fork 23
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] Make online and offline memory use vectors of pages instead of hashmaps #1224
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cd79e9e
feat: PagedVec struct
zlangley 27d2096
Make offline memory use paged vec
Golovanov399 ba97321
Make `PAGE_SIZE` const generic
Golovanov399 928ccf4
Fix tests
Golovanov399 5070149
Fix something
Golovanov399 8bd38da
Fix
Golovanov399 29245d4
Update online memory so that it now uses pagevecs
Golovanov399 95b16be
Refactor
Golovanov399 dd02303
Update crates/vm/src/system/memory/merkle/tests/mod.rs
Golovanov399 877e00d
Some comments
Golovanov399 0db1666
Try removing `initial_memory` from the arguments of `OfflineMemory::new`
Golovanov399 24e17ea
Merge branch 'feat/offline-memory-paged-vec' of github.com:openvm-org…
Golovanov399 82ecab5
Revert "Try removing `initial_memory` from the arguments of `OfflineM…
Golovanov399 91ca222
Merge branch 'main' into feat/offline-memory-paged-vec
Golovanov399 7389127
Change the memory config in the test builder to `default()`
Golovanov399 3f8a365
Hopefully speed something up using unsafe trickery
Golovanov399 8ce871d
Also (hopefully) speed up `set_range_array`
Golovanov399 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the bound just
pointer < (CHUNK << address_height)
? The boundary chip won't supportpointer
outside this range.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless
pointer
is from the last page that was padded toPAGE_SIZE
elements and therefore it exceeds the supposed memoryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that would still be an invalid
pointer
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If address_height is 27 and CHUNK is 8, then the max addressable cell is 2^30 - 1. If I understand correctly, this assertion might allow me to address into 2^30 or higher, if the
PAGE_SIZE
doesn't evenly divide 2^30. From the perspective of PagedVec, that's a fine index. But from the perspective of memory, that's not a valid pointer.Or what am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but how does it break anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test, so I'm not really that concerned. But the point of the assertion is to assert that
pointer
is a valid pointer. And valid pointers are in the range0..CHUNK << address_height
and, in particular, have nothing to do with thePAGE_SIZE
of the underlyingPagedVec
.