-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[move-vm][closures] Type and Value representation and serialization #15670
Open
wrwg
wants to merge
1
commit into
wrwg/clos_type_conv
Choose a base branch
from
wrwg/clos_values
base: wrwg/clos_type_conv
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
⏱️ 1h 6m total CI duration on this PR
|
This was referenced Jan 4, 2025
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
16 tasks
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 5, 2025 05:50
4972a5c
to
2fed681
Compare
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 6, 2025 02:47
2fed681
to
9c0814c
Compare
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 6, 2025 02:47
9c0814c
to
8b11451
Compare
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 6, 2025 03:25
8b11451
to
dcb6bc5
Compare
wrwg
force-pushed
the
wrwg/clos_values
branch
2 times, most recently
from
January 7, 2025 04:04
95728c9
to
6eea07c
Compare
wrwg
requested review from
georgemitenkov,
runtian-zhou,
vgao1996,
vineethk and
ziaptos
January 8, 2025 06:20
wrwg
requested review from
davidiw,
movekevin,
zekun000,
banool,
gregnazario and
0xmaayan
as code owners
January 8, 2025 06:20
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 13, 2025 07:08
dcb6bc5
to
bfc6f4c
Compare
wrwg
force-pushed
the
wrwg/clos_values
branch
from
January 13, 2025 07:08
6eea07c
to
06363e0
Compare
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 14, 2025 02:32
bfc6f4c
to
355525d
Compare
wrwg
force-pushed
the
wrwg/clos_values
branch
from
January 14, 2025 02:32
06363e0
to
90f0c08
Compare
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
2 times, most recently
from
January 16, 2025 06:45
13dfe03
to
92f22e0
Compare
[PR 3/n vm closures] This implements types and values for functions and closures, as well as serialization. For a detailed discussion, see the design doc. It does not yet implement the interpreter and runtime verification. Overview: - `MoveValue` and `MoveTypeLayout` are extended to represent closures and functions. A closure carries the function name, the closure mask, the function layout, and the captured arguments. The function layout enables serialization of the captured arguments without any context. - Runtime `Type` is extended by functions. - `ValueImpl` is extended by a closure variant. This representation uses `trait AbstractFunction` to represent the function value and implement core functionality like comparison and printing. The existing trait `FunctionValueExtension` is used to create `AbstracFunction` from the serialized representation. - Similar as with `MoveValue`, the serialized representation of `ValueImpl::Closure` contains the full function layout, enabling to deserialize the captured arguments context independently. This design has been chosen for robustness, avoiding a dependency of serialization from loaded functions, and to enable fully 'lazy' deserialization of closures. The later allows a contract to store hundreds of function values and on loading them from storage, avoiding loading the associated code until the moment the closure is actually executed. - `AbstractFunction` is implemented in the loader such that it can be either in 'unresolved' or in `resolved' state.
wrwg
force-pushed
the
wrwg/clos_type_conv
branch
from
January 17, 2025 06:11
92f22e0
to
23f4130
Compare
wrwg
force-pushed
the
wrwg/clos_values
branch
from
January 17, 2025 06:11
90f0c08
to
4ccfa58
Compare
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.
Description
[PR 4/n vm closures]
This implements types and values for functions and closures, as well as serialization. For a detailed discussion, see the design doc. It does not yet implement the interpreter and runtime verification.
Overview:
MoveValue
andMoveTypeLayout
are extended to represent closures and functions. A closure carries the function name, the closure mask, the function layout, and the captured arguments. The function layout enables serialization of the captured arguments without any context.Type
is extended by functions.ValueImpl
is extended by a closure variant. This representation usestrait AbstractFunction
to represent the function value and implement core functionality like comparison and printing. The existing traitFunctionValueExtension
is used to createAbstracFunction
from the serialized representation.MoveValue
, the serialized representation ofValueImpl::Closure
contains the full function layout, enabling to deserialize the captured arguments context independently. This design has been chosen for robustness, avoiding a dependency of serialization from loaded functions, and to enable fully 'lazy' deserialization of closures. The later allows a contract to store hundreds of function values and on loading them from storage, avoiding loading the associated code until the moment the closure is actually executed.AbstractFunction
is implemented in the loader such that it can be either in 'unresolved' or in `resolved' state.How Has This Been Tested?
Testing postponed until e2e wiring is up
Type of Change
Which Components or Systems Does This Change Impact?