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: remove interior mutability #94

Merged
merged 32 commits into from
Aug 5, 2024

Conversation

iammadab
Copy link
Contributor

@iammadab iammadab commented Jul 30, 2024

Removes interior mutability hack introduced in #80, and closes #87.

Also resolves the issue described in #86, see commit

@iammadab iammadab marked this pull request as ready for review July 30, 2024 12:13
@iammadab iammadab requested review from dreamATD and hero78119 July 30, 2024 12:13
Copy link
Collaborator

@hero78119 hero78119 left a comment

Choose a reason for hiding this comment

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

LGTM and thanks for the effort!

singer-utils/src/chips/bytecode.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@dreamATD dreamATD left a comment

Choose a reason for hiding this comment

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

LGTM, we can merge it after @iammadab fixes some small comments.

singer-utils/src/chip_handler.rs Outdated Show resolved Hide resolved
@dreamATD dreamATD merged commit f5cd8b5 into feat/chip_handler_refactor Aug 5, 2024
3 of 4 checks passed
dreamATD pushed a commit that referenced this pull request Aug 7, 2024
* confirm const across file impl

* implement try from cell_id's to uint

* add test for uint from cell ids

* add documentation

* document N_OPERAND_CELLS constant

* wip

* test cell repacking

* add documentation

* update packing test, ensure remaining values are 0s

* add more uint instantiation methods

* add test placeholders

* sketch base plan for cmp

* implement and test pad cells

* modify from_range and from_bytes to use cell padding

* extract logic for uint from arbitrary cell_width to make from_range and from_bytes easier

* add compile time evaluated min function

* introduce new constant  cleans up uint_from*

* update uint from cell id test to test greater than N_OPERANDS

* add test for uint from different sized cells

* implement add_unsafe

* add functions sketch

* wip

* all func

* building

* test compiling

* use range checker

* refactor constants second pass

* document cmp

* wip

* arithmetic second pass

* delete old uint

* refactor arithmetic

* fix documentation

* add test for add

* test add constant unsafe

* add test for add_small_unsafe

* implement handle borrow

* test sub_unsafe

* rename add_small to add_cell

* wip

* change uint mod management

* setup structure for namespacing constants

* refactor counter vector implementation

* introduce difference

* define ram and rom structures

* potential bug

* rom phase 1

* rename

* implement oam handler phase 1

* implement ram handler phase 1

* bytecode chip attempt 1

* implement call data records builder p1

* implement global state chip record generator p1

* implement memory chip record generator

* implement stack chip record generator p1

* wip

* util method for cell to mixed

* start work on range chip

* wip

* document range check uint

* clean up range check uint

* remove range_chip_bit_width injection

* move non-zero

* add interior mutability to range chip

* add interior mutability to bytecode

* add interior mutability to call data chip

* add interior mutability to memory chip

* add interior mutability to stack

* ram handler using single source oam handler

* update signer utils

* big wip

* fix singer compile errors

* fix compile errors

* delete old chip handler

* cleanup

* merge oam handler with ram handler

* fmt

* remove random 7 comments

* feat: remove interior mutability (#94)

* define chip handler structure

* fix calldata chip

* fix global state chip

* fix memory chip

* fix uint arithmetic unit

* fix range chip

* fix stack chip

* fix uint cmp

* fix singer-utils chips

* fix add instruction

* fix calldata chip

* fix dup instruction

* fix jum and jumpdest

* fix jumpi instruction

* fix mstore + pop instruction

* fix push instruction

* fix ret instruction

* fix swap instruction

* fix pro add instruction

* fix pro calldata instruction

* fix pro gt instruction

* fix jumpi inst pro

* fix pro mstore inst

* fix pro ret instruction

* fix bb_final

* fix bb_ret

* fix bb_start

* fix gt inst

* tests passing

* fix constant generation: use max_cell_bit instead of C for computations

* cleanup

* resolve pr commenets
yczhangsjtu pushed a commit that referenced this pull request Aug 12, 2024
* confirm const across file impl

* implement try from cell_id's to uint

* add test for uint from cell ids

* add documentation

* document N_OPERAND_CELLS constant

* wip

* test cell repacking

* add documentation

* update packing test, ensure remaining values are 0s

* add more uint instantiation methods

* add test placeholders

* sketch base plan for cmp

* implement and test pad cells

* modify from_range and from_bytes to use cell padding

* extract logic for uint from arbitrary cell_width to make from_range and from_bytes easier

* add compile time evaluated min function

* introduce new constant  cleans up uint_from*

* update uint from cell id test to test greater than N_OPERANDS

* add test for uint from different sized cells

* implement add_unsafe

* add functions sketch

* wip

* all func

* building

* test compiling

* use range checker

* refactor constants second pass

* document cmp

* wip

* arithmetic second pass

* delete old uint

* refactor arithmetic

* fix documentation

* add test for add

* test add constant unsafe

* add test for add_small_unsafe

* implement handle borrow

* test sub_unsafe

* rename add_small to add_cell

* wip

* change uint mod management

* setup structure for namespacing constants

* refactor counter vector implementation

* introduce difference

* define ram and rom structures

* potential bug

* rom phase 1

* rename

* implement oam handler phase 1

* implement ram handler phase 1

* bytecode chip attempt 1

* implement call data records builder p1

* implement global state chip record generator p1

* implement memory chip record generator

* implement stack chip record generator p1

* wip

* util method for cell to mixed

* start work on range chip

* wip

* document range check uint

* clean up range check uint

* remove range_chip_bit_width injection

* move non-zero

* add interior mutability to range chip

* add interior mutability to bytecode

* add interior mutability to call data chip

* add interior mutability to memory chip

* add interior mutability to stack

* ram handler using single source oam handler

* update signer utils

* big wip

* fix singer compile errors

* fix compile errors

* delete old chip handler

* cleanup

* merge oam handler with ram handler

* fmt

* remove random 7 comments

* feat: remove interior mutability (#94)

* define chip handler structure

* fix calldata chip

* fix global state chip

* fix memory chip

* fix uint arithmetic unit

* fix range chip

* fix stack chip

* fix uint cmp

* fix singer-utils chips

* fix add instruction

* fix calldata chip

* fix dup instruction

* fix jum and jumpdest

* fix jumpi instruction

* fix mstore + pop instruction

* fix push instruction

* fix ret instruction

* fix swap instruction

* fix pro add instruction

* fix pro calldata instruction

* fix pro gt instruction

* fix jumpi inst pro

* fix pro mstore inst

* fix pro ret instruction

* fix bb_final

* fix bb_ret

* fix bb_start

* fix gt inst

* tests passing

* fix constant generation: use max_cell_bit instead of C for computations

* cleanup

* resolve pr commenets
hero78119 pushed a commit that referenced this pull request Sep 30, 2024
* confirm const across file impl

* implement try from cell_id's to uint

* add test for uint from cell ids

* add documentation

* document N_OPERAND_CELLS constant

* wip

* test cell repacking

* add documentation

* update packing test, ensure remaining values are 0s

* add more uint instantiation methods

* add test placeholders

* sketch base plan for cmp

* implement and test pad cells

* modify from_range and from_bytes to use cell padding

* extract logic for uint from arbitrary cell_width to make from_range and from_bytes easier

* add compile time evaluated min function

* introduce new constant  cleans up uint_from*

* update uint from cell id test to test greater than N_OPERANDS

* add test for uint from different sized cells

* implement add_unsafe

* add functions sketch

* wip

* all func

* building

* test compiling

* use range checker

* refactor constants second pass

* document cmp

* wip

* arithmetic second pass

* delete old uint

* refactor arithmetic

* fix documentation

* add test for add

* test add constant unsafe

* add test for add_small_unsafe

* implement handle borrow

* test sub_unsafe

* rename add_small to add_cell

* wip

* change uint mod management

* setup structure for namespacing constants

* refactor counter vector implementation

* introduce difference

* define ram and rom structures

* potential bug

* rom phase 1

* rename

* implement oam handler phase 1

* implement ram handler phase 1

* bytecode chip attempt 1

* implement call data records builder p1

* implement global state chip record generator p1

* implement memory chip record generator

* implement stack chip record generator p1

* wip

* util method for cell to mixed

* start work on range chip

* wip

* document range check uint

* clean up range check uint

* remove range_chip_bit_width injection

* move non-zero

* add interior mutability to range chip

* add interior mutability to bytecode

* add interior mutability to call data chip

* add interior mutability to memory chip

* add interior mutability to stack

* ram handler using single source oam handler

* update signer utils

* big wip

* fix singer compile errors

* fix compile errors

* delete old chip handler

* cleanup

* merge oam handler with ram handler

* fmt

* remove random 7 comments

* feat: remove interior mutability (#94)

* define chip handler structure

* fix calldata chip

* fix global state chip

* fix memory chip

* fix uint arithmetic unit

* fix range chip

* fix stack chip

* fix uint cmp

* fix singer-utils chips

* fix add instruction

* fix calldata chip

* fix dup instruction

* fix jum and jumpdest

* fix jumpi instruction

* fix mstore + pop instruction

* fix push instruction

* fix ret instruction

* fix swap instruction

* fix pro add instruction

* fix pro calldata instruction

* fix pro gt instruction

* fix jumpi inst pro

* fix pro mstore inst

* fix pro ret instruction

* fix bb_final

* fix bb_ret

* fix bb_start

* fix gt inst

* tests passing

* fix constant generation: use max_cell_bit instead of C for computations

* cleanup

* resolve pr commenets
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.

3 participants