Skip to content

Downstream Move upstream e33e3c1 - #368

Draft
areshand wants to merge 261 commits into
m1-clonefrom
ma/move-upgrade-e33e3c1
Draft

Downstream Move upstream e33e3c1#368
areshand wants to merge 261 commits into
m1-clonefrom
ma/move-upgrade-e33e3c1

Conversation

@areshand

Copy link
Copy Markdown
Collaborator

Summary

Downstream the Aptos upstream pre-license Move toolchain/runtime changes through commit e33e3c1 onto Movement m1.

Scope is restricted to third_party/move. .github is intentionally untouched.

Preserved Movement fixes

  • move-bytecode-verifier meter keeps mod_bounds.max using max_per_mod_meter_units.
  • Move VM verified-module cache remains keyed by verifier_config_digest while using upstream's refactored VERIFIED_MODULES_CACHE API shape.
  • Rebased onto origin/m1 and preserved Movement VM backports for value depth checks and closure mask equality/comparison.

Validation

  • Verified branch merge-base is origin/m1.
  • Verified diff has no files outside third_party/move.
  • Verified .github diff is empty.
  • Verified no conflict markers under third_party/move.

Full Cargo validation may require repo-level workspace dependency updates in later layers of the broader upstream downstreaming work.

@areshand
areshand force-pushed the ma/move-upgrade-e33e3c1 branch from adda5b6 to 1f937eb Compare May 27, 2026 22:09
georgemitenkov and others added 29 commits May 27, 2026 15:24
* [vm] Gas charge for PackClosure instructions

Logic for charging gas when packing closures, as well as new gas parameters.

* Addressing reviewer comments

* Addressing reviewer comments.

* Fixing AbstractValueSizeGasParams key dup error

Downstreamed-from: 8ea5ffe
…s-labs#16576)

- Function values cannot capture aggregators: added a special error code
- Layouts for storable closures constructed at pack time

Downstreamed-from: 52f1a92
…bs#17004)

Co-authored-by: Wolfgang Grieskamp <wg@aptoslabs.com>
Downstreamed-from: 4498246
* - Refactored fuzzing targets to utilize new serialization methods and maintain consistency in error handling.
- Enhanced mock implementations for testing and serialization in `function_values_impl.rs` and related test files.
- Update dependencies in Cargo.lock

* small fix

* Update golden outputs after upgrading prop-test

* Refactor ClosureMask impl to return Result for error handling.

* fmt

* Update third_party/move/move-core/types/src/function.rs

Co-authored-by: Vineeth Kashyap <vineeth.rv@gmail.com>

* Add module replacement functionality and improve fuzzing tests

- Updated fuzzing tests to handle deserialization errors more robustly, ensuring that only malformed modules are rejected.
- Refactored value property tests to improve variant handling in struct layouts.
- Enhanced error reporting in the lambda lifter for better debugging of compiler issues.
- Implemented `replace_module` method in `BuiltPackage` to allow replacing a module by name with a new `CompiledModule`.

* Fix conversion(?)

* Minor fixes

---------

Co-authored-by: Vineeth Kashyap <vineeth.rv@gmail.com>
Downstreamed-from: 8f74ada
The old versions we are currently using do not implement `Clone`, which makes it
inconvenient to use in tests.

Downstreamed-from: be5609e
* Handle the unlikely case of overall_push overflow

* fmt

Downstreamed-from: 6c9d41c
wrwg and others added 24 commits May 27, 2026 15:39
* [move value annotator] Cache FatType computation

This caches the conversion from `StructTag` to `FatStructTag` inside of the annotator. It also wraps an Rc around the `FatStructTag` to avoid cloning when taken from the cache. Computation of `FatStructTag` is supposedly the bottleneck in value annotation, because it needs to fetch transitively all struct definitions from the bytecode. However, it isn't clear yet whether the cache and annotator lifetime is long enough to have a visible effect.

* Addressing reviewer comments

Downstreamed-from: c5fd2db
…8055)

The name `gen` is reserved now, and this undos some automatic renaming to `r#gen` using a better name.

Downstreamed-from: f60b058
Use the new MASM notation in baselines, consistent with what also transactional tests do.

Downstreamed-from: 5405a47
* get_or_insert! macro in frame type cache

* inline charge() inside its callsites

Downstreamed-from: 0e1bbd4
* feat: add fail-fast mode to move test

* fix: review comment

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: review comment

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: avoid code duplication

* fix: no need to change the method signature

* fix: nicer error handling

* fix: formatting

* feat: add tests for fail_fast feature

* chore: add comment

* chore: nicer parse handling

* fix: use datatest_stable for fail-fast tests

* fix: also fail-fast in case of unexpected success

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Downstreamed-from: d8b0e9f
* feat: allow to suppress printing errors to stderr

* fix: review comment: avoid code duplication

* fix: move-package unit tests

Downstreamed-from: fa75af3
* [compiler] Avoid jumps to pure exit blocks

This is extends the `ControlFlowGraphSimplifier` to optimize jumps to blocks which simply exit the function into the source block. This
simplification may result in dead code which is removed in later stages. Example

```
    L1: ...; goto L2;
    L2: return|abort

    ==>

    L1: ...; return|abort;
    L2: return|abort       // might be dead code now

```

Adding a test demonstrating the effect for matches

* Addressing reviewer comments

Downstreamed-from: c6ae38e
…labs#18070)

If looking at `match (e) { V => true, _ => false }`, we reduce this to `e is V`, which is more efficient.

Downstreamed-from: e7b2c9d
Downstreamed-from: 64cb9ff
…bs#18022)

* add visibility

* update tests

* change version

Downstreamed-from: b5aa9ee
…s-labs#18105)

* override option in move unit tests

* set enable_capture_option to true

Downstreamed-from: 236dc1c
…labs#18088)

This adds a new function to the annotator whether a given type is or transitively contains tables. Based on that, the code in `db_v2.rs` avoids creating an annotated value if its known to contain no tables.

Consider `vector<T>`, before this change, indexer would visit any value in the vector scanning for table handles even if its known that `T` doesn't has tables.

The information whether tables are in a type is computed during FatType construction and shared between cached structs, as well as cached in the annotator itself.

One step further then this PR goes, would be move table handle scanning into the annotator and avoid to construct annotated values in the first place, but this here might already have significant effects.

Downstreamed-from: 663d6f6
Given PR was merged, missing some changes, which are in this PR :-/

Downstreamed-from: c31852e
…-labs#18147)

* split git calls into its own file

* formatting

* remove unused imports

Downstreamed-from: 0921493
* Move `Instruction` to `move_vm_types`

* Move VM profiler

* Do not derive serialize

* Lints

* Fix imports

* Better documentation

* Make function name lazy

* Profile functions called from functions

* Integrate profiler into `e2e-benchmark`

* Reorder modules

* Newline

* Improve README

* Do not measure loading time for closures

* Add comment

* Lints

* Remove `trace_vm_all.d`

* Rename fields

* Use instruction name instead of debug formatting

* Rename structs

* Documentation

* Pre-commit hook

* Rename functions

* Fix bug found by Cursor

* Remove unused import

* Make script take binary as argument

* Remove name from exit probes

* Use relative paths

* Add flamegraph

* More documentation

* Fix toml

Downstreamed-from: 200e844
@areshand
areshand force-pushed the ma/move-upgrade-e33e3c1 branch from 1f937eb to 4147976 Compare May 27, 2026 22:48
@areshand
areshand changed the base branch from m1 to m1-clone June 15, 2026 21:13
Comment thread crates/aptos/Cargo.toml Outdated
name = "movement"
description = "Movement tool for management of nodes and interacting with Movement"
version = "7.4.0"
name = "aptos"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change should be reverted

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.