LessVM Codebase (Run ID: openSVM_lessvm_issue_2_cd25dcd3)#3
Merged
0xrinegade merged 1 commit intomainfrom Mar 10, 2025
Merged
Conversation
Fix VM initialization by introducing DataStructureStore::new() and add various arithmetic and bitwise operations like Mod, Exp, And, Or, Xor, Not, Shl, Shr and Sar. Improve SIMD vector handling and implement dynamic memory allocation.
Closed
Reviewer's Guide by SourceryThis pull request fixes the SIMD vector addition, enhances memory management by using dynamic Vecs, and implements missing opcodes and bitwise operations. The changes improve the VM's functionality and scalability. Sequence diagram for SIMD Vector AdditionsequenceDiagram
participant VM
VM->VM: Load values1 from stack
VM->VM: Pop 4 values from stack
VM->VM: Load values2 from stack
VM->VM: Add values1 and values2
VM->VM: Store result back to stack
Updated class diagram for MemoryclassDiagram
class Memory {
-Vec~u8~ data
-usize size
+new() Memory
+with_capacity(capacity: usize) Memory
+ensure_capacity(required_size: usize) void
+get_byte(offset: usize) Option~u8~
+load(offset: usize, len: usize) Result~Vec~u8~, VMError~
+store(offset: usize, value: []u8) Result~void, VMError~
+store8(offset: usize, value: u8) Result~void, VMError~
+load8(offset: usize) Result~u8, VMError~
+size() usize
+clear() void
+copy(dest: usize, src: usize, len: usize) Result~void, VMError~
+cost(new_size: usize) u64
}
note for Memory "Replaced fixed-size array with dynamic Vec"
Updated class diagram for DataStructureStoreclassDiagram
class DataStructureStore {
-Vec~Option~BTreeMapDS~~ btrees
-Vec~Option~TrieDS~~ tries
-Vec~Option~GraphDS~~ graphs
-Vec~Option~OHLCVDS~~ ohlcvs
-Vec~Option~HypergraphDS~~ hypergraphs
+new() DataStructureStore
+ensure_capacity(data_type: DataStructureType, id: usize) void
}
note for DataStructureStore "Replaced fixed-size arrays with dynamic Vecs"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Deploy Preview for lessvm ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
agent_instance: openSVM_lessvm_issue_2_cd25dcd3 Tries to fix: #2
🛠️ Fixed SIMD Vector Addition and Enhanced Dynamic Memory Allocation
The changes improve scalability through dynamic memory management and bring the VM implementation in line with the opcodes specification. Please review these improvements, particularly the SIMD implementation which resolves issue #2.
Summary by Sourcery
Improves the VM implementation by fixing a bug in the SIMD vector addition, enhancing memory management with dynamic Vecs, and adding missing opcodes and bitwise operations.
New Features:
Bug Fixes:
Enhancements: