From 86b696d26d2fef8a62e61740abf54f30741da4b6 Mon Sep 17 00:00:00 2001 From: igor-aptos <110557261+igor-aptos@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:11:17 -0800 Subject: [PATCH] ungate native memory operations (#15532) ungate native memory operations --- .../e2e-benchmark/data/calibration_values.tsv | 2 + aptos-move/e2e-benchmark/src/main.rs | 60 ++++++----- aptos-move/framework/move-stdlib/doc/bcs.md | 4 +- .../framework/move-stdlib/doc/vector.md | 4 +- .../framework/move-stdlib/sources/bcs.move | 7 +- .../framework/move-stdlib/sources/vector.move | 7 +- .../src/publishing/prebuild_packages.rs | 4 +- .../src/move_workloads.rs | 2 +- .../src/raw_module_data.rs | 99 ++++++++++--------- .../sources/vector_example.move | 18 ++-- 10 files changed, 109 insertions(+), 98 deletions(-) diff --git a/aptos-move/e2e-benchmark/data/calibration_values.tsv b/aptos-move/e2e-benchmark/data/calibration_values.tsv index 87dcf3bb84ab4..bdd6d9d7a895f 100644 --- a/aptos-move/e2e-benchmark/data/calibration_values.tsv +++ b/aptos-move/e2e-benchmark/data/calibration_values.tsv @@ -29,5 +29,7 @@ VectorTrimAppend { vec_len: 3000, element_len: 1, index: 100, repeats: 1000 } 11 VectorTrimAppend { vec_len: 3000, element_len: 1, index: 2990, repeats: 1000 } 119 0.947 1.093 18431.4 VectorRemoveInsert { vec_len: 3000, element_len: 1, index: 100, repeats: 1000 } 119 0.943 1.107 29034.8 VectorRemoveInsert { vec_len: 3000, element_len: 1, index: 2998, repeats: 1000 } 119 0.954 1.149 20047.3 +VectorRangeMove { vec_len: 3000, element_len: 1, index: 1000, move_len: 500, repeats: 1000 } 6 0.925 1.001 32535.4 VectorTrimAppend { vec_len: 100, element_len: 100, index: 0, repeats: 0 } 119 0.909 1.201 293.5 VectorTrimAppend { vec_len: 100, element_len: 100, index: 10, repeats: 1000 } 119 0.951 1.143 12571.2 +VectorRangeMove { vec_len: 100, element_len: 100, index: 50, move_len: 10, repeats: 1000 } 6 0.925 1.001 5316.2 diff --git a/aptos-move/e2e-benchmark/src/main.rs b/aptos-move/e2e-benchmark/src/main.rs index 8dc111a1aa31c..a4d4d1aadc40e 100644 --- a/aptos-move/e2e-benchmark/src/main.rs +++ b/aptos-move/e2e-benchmark/src/main.rs @@ -86,6 +86,8 @@ const ABSOLUTE_BUFFER_US: f64 = 2.0; struct CalibrationInfo { // count: usize, expected_time_micros: f64, + min_ratio: f64, + max_ratio: f64, } fn get_parsed_calibration_values() -> HashMap { @@ -100,6 +102,8 @@ fn get_parsed_calibration_values() -> HashMap { (parts[0].to_string(), CalibrationInfo { // count: parts[1].parse().unwrap(), expected_time_micros: parts[parts.len() - 1].parse().unwrap(), + min_ratio: parts[2].parse().unwrap(), + max_ratio: parts[3].parse().unwrap(), }) }) .collect() @@ -206,13 +210,13 @@ fn main() { index: 2998, repeats: 1000, }, - // EntryPoints::VectorRangeMove { - // vec_len: 3000, - // element_len: 1, - // index: 1000, - // move_len: 500, - // repeats: 1000, - // }, + EntryPoints::VectorRangeMove { + vec_len: 3000, + element_len: 1, + index: 1000, + move_len: 500, + repeats: 1000, + }, // vectors with large elements EntryPoints::VectorTrimAppend { // baseline, only vector creation @@ -227,13 +231,13 @@ fn main() { index: 10, repeats: 1000, }, - // EntryPoints::VectorRangeMove { - // vec_len: 100, - // element_len: 100, - // index: 50, - // move_len: 10, - // repeats: 1000, - // }, + EntryPoints::VectorRangeMove { + vec_len: 100, + element_len: 100, + index: 50, + move_len: 10, + repeats: 1000, + }, ]; let mut failures = Vec::new(); @@ -246,10 +250,10 @@ fn main() { for (index, entry_point) in entry_points.into_iter().enumerate() { let entry_point_name = format!("{:?}", entry_point); - let expected_time_micros = calibration_values + let cur_calibration = calibration_values .get(&entry_point_name) - .expect(&entry_point_name) - .expected_time_micros; + .expect(&entry_point_name); + let expected_time_micros = cur_calibration.expected_time_micros; let publisher = executor.new_account_at(AccountAddress::random()); let mut package_handler = @@ -317,17 +321,23 @@ fn main() { "test_index": index, })); - if elapsed_micros > expected_time_micros * (1.0 + ALLOWED_REGRESSION) + ABSOLUTE_BUFFER_US { + let max_regression = f64::max( + expected_time_micros * (1.0 + ALLOWED_REGRESSION) + ABSOLUTE_BUFFER_US, + expected_time_micros * cur_calibration.max_ratio, + ); + let max_improvement = f64::min( + expected_time_micros * (1.0 - ALLOWED_IMPROVEMENT) - ABSOLUTE_BUFFER_US, + expected_time_micros * cur_calibration.min_ratio, + ); + if elapsed_micros > max_regression { failures.push(format!( - "Performance regression detected: {:.1}us, expected: {:.1}us, diff: {}%, for {:?}", - elapsed_micros, expected_time_micros, diff, entry_point + "Performance regression detected: {:.1}us, expected: {:.1}us, limit: {:.1}us, diff: {}%, for {:?}", + elapsed_micros, expected_time_micros, max_regression, diff, entry_point )); - } else if elapsed_micros + ABSOLUTE_BUFFER_US - < expected_time_micros * (1.0 - ALLOWED_IMPROVEMENT) - { + } else if elapsed_micros < max_improvement { failures.push(format!( - "Performance improvement detected: {:.1}us, expected {:.1}us, diff: {}%, for {:?}. You need to adjust expected time!", - elapsed_micros, expected_time_micros, diff, entry_point + "Performance improvement detected: {:.1}us, expected {:.1}us, limit {:.1}us, diff: {}%, for {:?}. You need to adjust expected time!", + elapsed_micros, expected_time_micros, max_improvement, diff, entry_point )); } } diff --git a/aptos-move/framework/move-stdlib/doc/bcs.md b/aptos-move/framework/move-stdlib/doc/bcs.md index 0a73d39902341..fcc176e1751c0 100644 --- a/aptos-move/framework/move-stdlib/doc/bcs.md +++ b/aptos-move/framework/move-stdlib/doc/bcs.md @@ -85,7 +85,7 @@ On the other hand, if function has returned None for some type, it might change in the future to return Some() instead, if size becomes "known". -
public(friend) fun constant_serialized_size<MoveValue>(): option::Option<u64>
+
public fun constant_serialized_size<MoveValue>(): option::Option<u64>
 
@@ -94,7 +94,7 @@ it might change in the future to return Some() instead, if size becomes "known". Implementation -
native public(friend) fun constant_serialized_size<MoveValue>(): Option<u64>;
+
native public fun constant_serialized_size<MoveValue>(): Option<u64>;
 
diff --git a/aptos-move/framework/move-stdlib/doc/vector.md b/aptos-move/framework/move-stdlib/doc/vector.md index 18512424c38e8..8e9411e10f129 100644 --- a/aptos-move/framework/move-stdlib/doc/vector.md +++ b/aptos-move/framework/move-stdlib/doc/vector.md @@ -372,7 +372,7 @@ Move prevents from having two mutable references to the same value, so fro vectors are always distinct. -
public(friend) fun move_range<T>(from: &mut vector<T>, removal_position: u64, length: u64, to: &mut vector<T>, insert_position: u64)
+
public fun move_range<T>(from: &mut vector<T>, removal_position: u64, length: u64, to: &mut vector<T>, insert_position: u64)
 
@@ -381,7 +381,7 @@ vectors are always distinct. Implementation -
native public(friend) fun move_range<T>(
+
native public fun move_range<T>(
     from: &mut vector<T>,
     removal_position: u64,
     length: u64,
diff --git a/aptos-move/framework/move-stdlib/sources/bcs.move b/aptos-move/framework/move-stdlib/sources/bcs.move
index 7721d69653f6e..aef159598ba6a 100644
--- a/aptos-move/framework/move-stdlib/sources/bcs.move
+++ b/aptos-move/framework/move-stdlib/sources/bcs.move
@@ -13,11 +13,6 @@ module std::bcs {
     /// Aborts with `0x1c5` error code if there is a failure when calculating serialized size.
     native public fun serialized_size(v: &MoveValue): u64;
 
-    // TODO - function `constant_serialized_size1 is `public(friend)` here for one release,
-    // and to be changed to `public` one release later.
-    #[test_only]
-    friend std::bcs_tests;
-
     /// If the type has known constant (always the same, independent of instance) serialized size
     /// in BCS (Binary Canonical Serialization) format, returns it, otherwise returns None.
     /// Aborts with `0x1c5` error code if there is a failure when calculating serialized size.
@@ -28,7 +23,7 @@ module std::bcs {
     /// If this function returned Some() for some type before - it is guaranteed to continue returning Some().
     /// On the other hand, if function has returned None for some type,
     /// it might change in the future to return Some() instead, if size becomes "known".
-    native public(friend) fun constant_serialized_size(): Option;
+    native public fun constant_serialized_size(): Option;
 
     // ==============================
     // Module Specification
diff --git a/aptos-move/framework/move-stdlib/sources/vector.move b/aptos-move/framework/move-stdlib/sources/vector.move
index e4d018e4f0b21..a4408db3f2a7b 100644
--- a/aptos-move/framework/move-stdlib/sources/vector.move
+++ b/aptos-move/framework/move-stdlib/sources/vector.move
@@ -68,11 +68,6 @@ module std::vector {
     /// Aborts if `i` or `j` is out of bounds.
     native public fun swap(self: &mut vector, i: u64, j: u64);
 
-    // TODO - function `move_range` here is `public(friend)` for one release,
-    // and to be changed to `public` one release later.
-    #[test_only]
-    friend std::vector_tests;
-
     /// Moves range of elements `[removal_position, removal_position + length)` from vector `from`,
     /// to vector `to`, inserting them starting at the `insert_position`.
     /// In the `from` vector, elements after the selected range are moved left to fill the hole
@@ -82,7 +77,7 @@ module std::vector {
     ///  elements is kept).
     /// Move prevents from having two mutable references to the same value, so `from` and `to`
     /// vectors are always distinct.
-    native public(friend) fun move_range(
+    native public fun move_range(
         from: &mut vector,
         removal_position: u64,
         length: u64,
diff --git a/crates/transaction-generator-lib/src/publishing/prebuild_packages.rs b/crates/transaction-generator-lib/src/publishing/prebuild_packages.rs
index 72585677e0683..654f013a9ef28 100644
--- a/crates/transaction-generator-lib/src/publishing/prebuild_packages.rs
+++ b/crates/transaction-generator-lib/src/publishing/prebuild_packages.rs
@@ -50,9 +50,9 @@ pub fn create_prebuilt_packages_rs_file(
     writeln!(
         string_buffer,
         "
+use aptos_transaction_generator_lib::entry_point_trait::PreBuiltPackages;
 use once_cell::sync::Lazy;
-use std::collections::HashMap;
-use aptos_transaction_generator_lib::entry_point_trait::PreBuiltPackages;",
+use std::collections::HashMap;",
     )
     .expect("Use directive failed");
     writeln!(string_buffer).expect("Empty line failed");
diff --git a/crates/transaction-workloads-lib/src/move_workloads.rs b/crates/transaction-workloads-lib/src/move_workloads.rs
index 7f062773a1de5..5a88880163cce 100644
--- a/crates/transaction-workloads-lib/src/move_workloads.rs
+++ b/crates/transaction-workloads-lib/src/move_workloads.rs
@@ -545,7 +545,7 @@ impl EntryPointTrait for EntryPoints {
                 repeats,
             } => get_payload(
                 module_id,
-                ident_str!("test_middle_range_move").to_owned(),
+                ident_str!("test_middle_move_range").to_owned(),
                 vec![
                     bcs::to_bytes(vec_len).unwrap(),
                     bcs::to_bytes(element_len).unwrap(),
diff --git a/crates/transaction-workloads-lib/src/raw_module_data.rs b/crates/transaction-workloads-lib/src/raw_module_data.rs
index 781f0c2c35e16..4dff3d5b78653 100644
--- a/crates/transaction-workloads-lib/src/raw_module_data.rs
+++ b/crates/transaction-workloads-lib/src/raw_module_data.rs
@@ -276,11 +276,11 @@ pub static MODULES_SIMPLE: Lazy>> = Lazy::new(|| { vec![
 pub static PACKAGE_FRAMEWORK_USECASES_METADATA: Lazy> = Lazy::new(|| {
 	vec![
 		17, 70, 114, 97, 109, 101, 119, 111, 114, 107, 85, 115, 101, 99, 97, 115, 101, 115,
-		1, 0, 0, 0, 0, 0, 0, 0, 0, 64, 67, 51, 69, 57, 51, 69, 69, 54,
-		70, 68, 66, 54, 67, 65, 65, 55, 52, 70, 50, 48, 50, 55, 70, 56, 68, 54,
-		65, 51, 55, 70, 69, 70, 68, 50, 65, 69, 69, 54, 56, 70, 56, 65, 57, 57,
-		70, 54, 55, 70, 65, 48, 57, 52, 65, 48, 68, 50, 67, 56, 57, 70, 54, 56,
-		48, 55, 215, 1, 31, 139, 8, 0, 0, 0, 0, 0, 2, 255, 165, 144, 187, 142,
+		1, 0, 0, 0, 0, 0, 0, 0, 0, 64, 67, 52, 70, 68, 56, 67, 50, 49,
+		56, 51, 69, 66, 52, 70, 55, 48, 70, 70, 65, 52, 66, 69, 56, 65, 48, 67,
+		57, 54, 68, 53, 50, 67, 70, 69, 52, 53, 68, 55, 48, 49, 68, 49, 52, 57,
+		55, 56, 57, 50, 51, 53, 55, 69, 55, 70, 55, 57, 50, 68, 70, 55, 68, 56,
+		66, 50, 215, 1, 31, 139, 8, 0, 0, 0, 0, 0, 2, 255, 165, 144, 187, 142,
 		194, 64, 12, 69, 251, 249, 10, 107, 182, 38, 236, 15, 108, 193, 238, 138, 150, 6,
 		170, 8, 33, 51, 49, 33, 100, 176, 163, 241, 240, 144, 16, 255, 78, 44, 30, 130,
 		22, 100, 23, 215, 246, 189, 167, 112, 217, 97, 104, 177, 166, 185, 99, 220, 18, 252,
@@ -874,47 +874,56 @@ pub static MODULE_FRAMEWORK_USECASES_TOKEN_V1: Lazy> = Lazy::new(|| {
 #[rustfmt::skip]
 pub static MODULE_FRAMEWORK_USECASES_VECTOR_EXAMPLE: Lazy> = Lazy::new(|| {
 	vec![
-		161, 28, 235, 11, 7, 0, 0, 10, 8, 1, 0, 4, 3, 4, 46, 4, 50, 8,
-		5, 58, 77, 7, 135, 1, 97, 8, 232, 1, 64, 16, 168, 2, 31, 12, 199, 2,
-		213, 2, 0, 0, 1, 3, 0, 1, 0, 1, 0, 1, 0, 2, 5, 6, 0, 1,
-		1, 4, 7, 8, 1, 0, 1, 1, 5, 9, 6, 1, 0, 1, 0, 6, 5, 6,
-		0, 1, 1, 7, 7, 11, 1, 0, 1, 1, 8, 12, 6, 1, 0, 1, 2, 3,
-		3, 3, 5, 3, 6, 3, 2, 3, 3, 1, 10, 10, 3, 1, 3, 1, 10, 3,
-		9, 10, 3, 3, 1, 10, 10, 3, 3, 1, 3, 10, 3, 7, 3, 4, 3, 3,
-		3, 3, 0, 2, 7, 10, 9, 0, 3, 1, 9, 0, 3, 7, 10, 9, 0, 3,
-		9, 0, 3, 10, 10, 3, 1, 10, 3, 1, 10, 9, 0, 2, 7, 10, 9, 0,
-		10, 9, 0, 3, 10, 10, 3, 1, 10, 10, 3, 14, 118, 101, 99, 116, 111, 114,
-		95, 101, 120, 97, 109, 112, 108, 101, 12, 103, 101, 110, 101, 114, 97, 116, 101, 95,
-		118, 101, 99, 18, 116, 101, 115, 116, 95, 114, 101, 109, 111, 118, 101, 95, 105, 110,
-		115, 101, 114, 116, 6, 118, 101, 99, 116, 111, 114, 6, 114, 101, 109, 111, 118, 101,
-		6, 105, 110, 115, 101, 114, 116, 16, 116, 101, 115, 116, 95, 116, 114, 105, 109, 95,
-		97, 112, 112, 101, 110, 100, 4, 116, 114, 105, 109, 6, 97, 112, 112, 101, 110, 100,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 205, 0, 0, 0, 0,
+		161, 28, 235, 11, 7, 0, 0, 10, 8, 1, 0, 4, 3, 4, 59, 4, 63, 10,
+		5, 73, 103, 7, 176, 1, 131, 1, 8, 179, 2, 64, 16, 243, 2, 31, 12, 146,
+		3, 184, 3, 0, 0, 1, 3, 0, 1, 0, 1, 0, 1, 0, 2, 5, 6, 0,
+		1, 1, 4, 7, 6, 1, 0, 1, 0, 5, 9, 6, 0, 1, 1, 6, 10, 11,
+		1, 0, 1, 1, 7, 12, 6, 1, 0, 1, 0, 8, 9, 6, 0, 1, 1, 9,
+		10, 14, 1, 0, 1, 1, 10, 15, 6, 1, 0, 1, 2, 3, 4, 3, 5, 3,
+		7, 3, 8, 3, 2, 3, 3, 1, 10, 10, 3, 1, 3, 1, 10, 3, 9, 10,
+		3, 3, 1, 10, 10, 3, 3, 1, 3, 10, 3, 7, 3, 5, 3, 3, 3, 3,
+		3, 0, 5, 7, 10, 9, 0, 3, 3, 7, 10, 9, 0, 3, 3, 10, 10, 3,
+		10, 10, 3, 1, 4, 3, 3, 3, 3, 2, 7, 10, 9, 0, 3, 1, 9, 0,
+		3, 7, 10, 9, 0, 3, 9, 0, 3, 10, 10, 3, 1, 10, 3, 1, 10, 9,
+		0, 2, 7, 10, 9, 0, 10, 9, 0, 3, 10, 10, 3, 1, 10, 10, 3, 14,
+		118, 101, 99, 116, 111, 114, 95, 101, 120, 97, 109, 112, 108, 101, 12, 103, 101, 110,
+		101, 114, 97, 116, 101, 95, 118, 101, 99, 22, 116, 101, 115, 116, 95, 109, 105, 100,
+		100, 108, 101, 95, 109, 111, 118, 101, 95, 114, 97, 110, 103, 101, 6, 118, 101, 99,
+		116, 111, 114, 10, 109, 111, 118, 101, 95, 114, 97, 110, 103, 101, 18, 116, 101, 115,
+		116, 95, 114, 101, 109, 111, 118, 101, 95, 105, 110, 115, 101, 114, 116, 6, 114, 101,
+		109, 111, 118, 101, 6, 105, 110, 115, 101, 114, 116, 16, 116, 101, 115, 116, 95, 116,
+		114, 105, 109, 95, 97, 112, 112, 101, 110, 100, 4, 116, 114, 105, 109, 6, 97, 112,
+		112, 101, 110, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 205,
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20, 99, 111, 109, 112, 105, 108, 97,
-		116, 105, 111, 110, 95, 109, 101, 116, 97, 100, 97, 116, 97, 9, 0, 3, 50, 46,
-		48, 3, 50, 46, 49, 0, 0, 0, 0, 4, 65, 64, 2, 0, 0, 0, 0, 0,
-		0, 0, 0, 12, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, 9, 12,
-		4, 5, 8, 5, 23, 10, 4, 4, 62, 11, 3, 6, 1, 0, 0, 0, 0, 0,
-		0, 0, 22, 12, 3, 10, 3, 10, 1, 35, 3, 19, 5, 23, 13, 2, 10, 3,
-		68, 2, 5, 6, 64, 3, 0, 0, 0, 0, 0, 0, 0, 0, 12, 5, 6, 0,
-		0, 0, 0, 0, 0, 0, 0, 12, 6, 9, 12, 7, 11, 0, 12, 8, 5, 33,
-		5, 57, 10, 7, 4, 59, 11, 6, 6, 1, 0, 0, 0, 0, 0, 0, 0, 22,
-		12, 6, 10, 6, 10, 8, 35, 3, 44, 5, 57, 10, 2, 12, 9, 13, 9, 6,
-		0, 0, 0, 0, 0, 0, 0, 0, 67, 2, 12, 10, 10, 6, 11, 10, 21, 13,
-		5, 11, 9, 68, 3, 5, 31, 11, 5, 2, 8, 12, 7, 5, 39, 8, 12, 4,
-		5, 14, 1, 1, 4, 0, 10, 34, 11, 0, 11, 1, 17, 0, 12, 4, 6, 0,
-		0, 0, 0, 0, 0, 0, 0, 12, 0, 9, 12, 5, 5, 10, 5, 30, 10, 5,
-		4, 31, 11, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 22, 12, 0, 10, 0,
-		10, 3, 35, 3, 21, 5, 30, 13, 4, 10, 2, 56, 0, 12, 6, 13, 4, 10,
-		2, 11, 6, 56, 1, 5, 8, 2, 8, 12, 5, 5, 16, 4, 1, 4, 0, 13,
-		33, 11, 0, 11, 1, 17, 0, 12, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0,
-		12, 0, 9, 12, 5, 5, 10, 5, 29, 10, 5, 4, 30, 11, 0, 6, 1, 0,
-		0, 0, 0, 0, 0, 0, 22, 12, 0, 10, 0, 10, 3, 35, 3, 21, 5, 29,
-		13, 4, 10, 2, 56, 2, 12, 6, 13, 4, 11, 6, 56, 3, 5, 8, 2, 8,
-		12, 5, 5, 16, 0,
-	]
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20, 99, 111, 109,
+		112, 105, 108, 97, 116, 105, 111, 110, 95, 109, 101, 116, 97, 100, 97, 116, 97, 9,
+		0, 3, 50, 46, 48, 3, 50, 46, 49, 0, 0, 0, 0, 4, 65, 64, 2, 0,
+		0, 0, 0, 0, 0, 0, 0, 12, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0,
+		12, 3, 9, 12, 4, 5, 8, 5, 23, 10, 4, 4, 62, 11, 3, 6, 1, 0,
+		0, 0, 0, 0, 0, 0, 22, 12, 3, 10, 3, 10, 1, 35, 3, 19, 5, 23,
+		13, 2, 10, 3, 68, 2, 5, 6, 64, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+		12, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 12, 6, 9, 12, 7, 11, 0,
+		12, 8, 5, 33, 5, 57, 10, 7, 4, 59, 11, 6, 6, 1, 0, 0, 0, 0,
+		0, 0, 0, 22, 12, 6, 10, 6, 10, 8, 35, 3, 44, 5, 57, 10, 2, 12,
+		9, 13, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 67, 2, 12, 10, 10, 6,
+		11, 10, 21, 13, 5, 11, 9, 68, 3, 5, 31, 11, 5, 2, 8, 12, 7, 5,
+		39, 8, 12, 4, 5, 14, 1, 1, 4, 0, 8, 42, 10, 0, 10, 1, 17, 0,
+		12, 5, 11, 0, 11, 1, 17, 0, 12, 6, 6, 0, 0, 0, 0, 0, 0, 0,
+		0, 12, 0, 9, 12, 7, 5, 14, 5, 38, 10, 7, 4, 39, 11, 0, 6, 1,
+		0, 0, 0, 0, 0, 0, 0, 22, 12, 0, 10, 0, 10, 4, 35, 3, 25, 5,
+		38, 13, 5, 10, 2, 10, 3, 13, 6, 10, 2, 56, 0, 13, 6, 10, 2, 10,
+		3, 13, 5, 10, 2, 56, 0, 5, 12, 2, 8, 12, 7, 5, 20, 3, 1, 4,
+		0, 13, 34, 11, 0, 11, 1, 17, 0, 12, 4, 6, 0, 0, 0, 0, 0, 0,
+		0, 0, 12, 0, 9, 12, 5, 5, 10, 5, 30, 10, 5, 4, 31, 11, 0, 6,
+		1, 0, 0, 0, 0, 0, 0, 0, 22, 12, 0, 10, 0, 10, 3, 35, 3, 21,
+		5, 30, 13, 4, 10, 2, 56, 1, 12, 6, 13, 4, 10, 2, 11, 6, 56, 2,
+		5, 8, 2, 8, 12, 5, 5, 16, 6, 1, 4, 0, 16, 33, 11, 0, 11, 1,
+		17, 0, 12, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 9, 12, 5,
+		5, 10, 5, 29, 10, 5, 4, 30, 11, 0, 6, 1, 0, 0, 0, 0, 0, 0,
+		0, 22, 12, 0, 10, 0, 10, 3, 35, 3, 21, 5, 29, 13, 4, 10, 2, 56,
+		3, 12, 6, 13, 4, 11, 6, 56, 4, 5, 8, 2, 8, 12, 5, 5, 16, 0,
+			]
 });
 
 #[rustfmt::skip]
diff --git a/testsuite/module-publish/src/packages/framework_usecases/sources/vector_example.move b/testsuite/module-publish/src/packages/framework_usecases/sources/vector_example.move
index 6dbff776a0d8f..3746c4d318e33 100644
--- a/testsuite/module-publish/src/packages/framework_usecases/sources/vector_example.move
+++ b/testsuite/module-publish/src/packages/framework_usecases/sources/vector_example.move
@@ -35,13 +35,13 @@ module 0xABCD::vector_example {
         };
     }
 
-    // public entry fun test_middle_range_move(vec_len: u64, element_len: u64, index: u64, move_len: u64, repeats: u64) {
-    //     let vec1 = generate_vec(vec_len, element_len);
-    //     let vec2 = generate_vec(vec_len, element_len);
-
-    //     for (i in 0..repeats) {
-    //         vector::move_range(&mut vec1, index, move_len, &mut vec2, index);
-    //         vector::move_range(&mut vec2, index, move_len, &mut vec1, index);
-    //     };
-    // }
+    public entry fun test_middle_move_range(vec_len: u64, element_len: u64, index: u64, move_len: u64, repeats: u64) {
+        let vec1 = generate_vec(vec_len, element_len);
+        let vec2 = generate_vec(vec_len, element_len);
+
+        for (i in 0..repeats) {
+            vector::move_range(&mut vec1, index, move_len, &mut vec2, index);
+            vector::move_range(&mut vec2, index, move_len, &mut vec1, index);
+        };
+    }
 }