Repository: aptos-labs/aptos-core (language: python)

Issue:
[Bug][compiler-v2] Move v2 compiler enum destruction via pattern matching is broken
# Background

@brmataptos @fEst1ck @georgemitenkov @rahxephon89 @runtian-zhou @vineethk @wrwg 

I'm trying to do [enum destuction via pattern matching] but it is
throwing a compiler bug:

```sh
bug: bytecode verification failed with unexpected status code `CONSTRAINT_NOT_SATISFIED`. This is a compiler bug, consider reporting it.
    ┌─ /Users/me/the/code
    │
  1 │ ╭ module hello_wolfgang::red_black_map {
  2 │ │
  3 │ │     use std::vector;
  4 │ │
    · │
135 │ │     }
136 │ │ }
    │ ╰─^
```

Specifically, the problematic code is the simple function `contains` (see
code listing at bottom), because the module compiles just fine without this
function.

```move
        match (self.search(key)) {
            Found { .. } => true,
            NotFound { .. } => false
        }
```

I am unable to use the fully-qualified syntax:

```move
    public fun contains<V>(self: &Map<V>, key: u256): bool {
        match (self.search(key)) {
            Found { node: _, side_as_child: _ } => true,
            NotFound { prospective_parent: _, prospective_side_as_child: _ } => false
        }
    }
```

Nor can I use the `is` keyword:

```move
    public fun contains<V>(self: &Map<V>, key: u256): bool {
        if (self.search(key) is SearchResult::Found) {
            true
        } else {
            false
        }
    }
```

1. Could it be a result of using nested enums?
1. I think I've exhausted all of the syntactical methods for doing this simple
   match compare, so is there something else I can do in the interim while this
   gets patched?

# Code listing


```move
module hello_wolfgang::red_black_map {

    use std::vector;

    enum Color has copy, drop {
        Red,
        Black
    }

    enum Pointer has copy, drop {
        Index(u64),
        Null
    }

    enum Side has copy, drop {
        Left,
        Right,
        Null
    }

    enum SearchResult has copy, drop {
        Found {
            node: Pointer,
            side_as_child: Side
        },
        NotFound {
            prospective_parent: Pointer,
            prospective_side_as_child: Side
        }
    }

    struct Node<V> has drop {
        key: u256,
        value: V,
        color: Color,
        parent: Pointer,
        left: Pointer,
        right: Pointer
    }

    struct Map<V> has drop {
        root: Pointer,
        nodes: vector<Node<V>>
    }

    public fun new<V>(): Map<V> {
        Map { root: Pointer::Null, nodes: vector::empty() }
    }

    public fun contains<V>(self: &Map<V>, key: u256): bool {
        match (self.search(key)) {
            Found { .. } => true,
            NotFound { .. } => false
        }
    }

    public fun insert<V: drop>(self: &mut Map<V>, key: u256, value: V) {
        match(self.root) {
            Null => {
                self.nodes.push_back(
                    Node {
                        key: key,
                        value: value,
                        color: Color::Black,
                        parent: Pointer::Null,
                        left: Pointer::Null,
                        right: Pointer::Null
                    }
                );
                self.root = Pointer::Index(0);
            }
            _ => {}
        }
    }

    fun search<V: drop>(self: &Map<V>, key: u256): SearchResult {
        let side_as_child = Side::Null;
        match(self.root) {
            Null => {
                return SearchResult::NotFound {
                    prospective_parent: Pointer::Null,
                    prospective_side_as_child: side_as_child
                }
            }
            Index(index) => {
                loop {
                    let node = &self.nodes[index];
                    if (key < node.key) {
                        match(node.left) {
                            Index(next_index) => {
                                index = next_index;
                                side_as_child = Side::Left;
                            }
                            Null => {
                                return SearchResult::NotFound {
                                    prospective_parent: Pointer::Index(index),
                                    prospective_side_as_child: Side::Left
                                };
                            }
                        }
                    } else if (key > node.key) {
                        match(node.right) {
                            Index(next_index) => {
                                index = next_index;
                                side_as_child = Side::Right;
                            }
                            Null => {
                                return SearchResult::NotFound {
                                    prospective_parent: Pointer::Index(index),
                                    prospective_side_as_child: Side::Right
                                };
                            }
                        }
                    } else {
                        return SearchResult::Found {
                            node: Pointer::Index(index),
                            side_as_child: side_as_child
                        };
                    }
                }
            }
        }
    }

    public fun length<V>(self: &Map<V>): u64 {
        self.nodes.length()
    }

    #[test]
    fun test_insert_length() {
        let map = new();
        assert!(map.length() == 0);
        map.insert(1, 1);
        assert!(map.length() == 1);
    }
}
```

[enum destuction via pattern matching]: https://aptos.dev/en/build/smart-contracts/book/enums#destroying-enums-via-pattern-matching


Discussion / hints:
This is actually a bug in the v2 compiler ability checker (which is then caught by the bytecode verifier which is run at end of compilation. The minimal repro is:

```
module 0x815::red_black_map {

    struct Map<phantom V> has drop {
    }

    public fun contains<V>(self: &Map<V>, key: u256): bool {
        self.search(key)
    }

    fun search<V: drop>(self: &Map<V>, key: u256): bool {
        true
    }
}
```

`search` can't be called since the contains `V` does not have the drop ability. The compiler should have complained but it did not.

So no need to stop using enums. 

Thanks for reporting, we send out fix soon.

Fix patch:
diff --git a/third_party/move/move-bytecode-verifier/src/signature_v2.rs b/third_party/move/move-bytecode-verifier/src/signature_v2.rs
index 77388dec740ad..764a850c72679 100644
--- a/third_party/move/move-bytecode-verifier/src/signature_v2.rs
+++ b/third_party/move/move-bytecode-verifier/src/signature_v2.rs
@@ -812,7 +812,13 @@ impl<'a, const N: usize> SignatureChecker<'a, N> {
         for (offset, instr) in code.code.iter().enumerate() {
             let map_err = |res: PartialVMResult<()>| {
                 res.map_err(|err| {
-                    err.append_message_with_separator(' ', format!("at offset {}", offset))
+                    err.append_message_with_separator(
+                        ' ',
+                        format!(
+                            "missing abilities for `{:?}` at code offset {}",
+                            instr, offset
+                        ),
+                    )
                 })
             };
             match instr {
diff --git a/third_party/move/move-compiler-v2/src/lib.rs b/third_party/move/move-compiler-v2/src/lib.rs
index f1c9ab6ba0394..ae0f454fc95e5 100644
--- a/third_party/move/move-compiler-v2/src/lib.rs
+++ b/third_party/move/move-compiler-v2/src/lib.rs
@@ -570,7 +570,10 @@ fn report_bytecode_verification_error(
         let debug_info = if command_line::get_move_compiler_backtrace_from_env() {
             format!("\n{:#?}", e)
         } else {
-            "".to_string()
+            format!(
+                "\nError message: {}",
+                e.message().cloned().unwrap_or_else(|| "none".to_string())
+            )
         };
         env.diag(
             Severity::Bug,
diff --git a/third_party/move/move-model/src/builder/exp_builder.rs b/third_party/move/move-model/src/builder/exp_builder.rs
index 7c7e49313931f..a6e0cf223a8fb 100644
--- a/third_party/move/move-model/src/builder/exp_builder.rs
+++ b/third_party/move/move-model/src/builder/exp_builder.rs
@@ -785,7 +785,8 @@ impl<'env, 'builder, 'module_builder> UnificationContext
             .lookup_receiver_function(ty, name)
             .cloned()
         {
-            let type_inst = self.fresh_type_vars(entry.type_params.len());
+            let type_params = entry.type_params.clone();
+            let type_inst = self.fresh_type_vars(type_params.len());
             let arg_types = entry
                 .params
                 .iter()
@@ -794,6 +795,8 @@ impl<'env, 'builder, 'module_builder> UnificationContext
             let result_type = entry.result_type.instantiate(&type_inst);
             Some(ReceiverFunctionInstance {
                 id: entry.module_id.qualified(entry.fun_id),
+                fun_name: name,
+                type_params,
                 type_inst,
                 arg_types,
                 result_type,
@@ -2159,8 +2162,8 @@ impl<'env, 'translator, 'module_translator> ExpTranslator<'env, 'translator, 'mo
                     &inst.result_type,
                 )
                 .map_err(|_| ok = false);
-            // `type.inst` is now unified with the actual types,
-            // annotate the instance. Since this post processor
+            // `type_inst` is now unified with the actual types,
+            // annotate the instance.  Since this post processor
             // is run after type finalization, we need to finalize
             // it to report any un-inferred type errors. However,
             // to avoid follow-up errors, only do if unification
@@ -2173,6 +2176,8 @@ impl<'env, 'translator, 'module_translator> ExpTranslator<'env, 'translator, 'mo
                     .iter()
                     .map(|t| self.finalize_type(id, t, &mut BTreeSet::new()))
                     .collect();
+                // Also need to evaluate type constraints on type parameters
+
                 self.env().set_node_instantiation(id, inst)
             }
         }
diff --git a/third_party/move/move-model/src/ty.rs b/third_party/move/move-model/src/ty.rs
index e19f9172b3868..bebda5886ab8d 100644
--- a/third_party/move/move-model/src/ty.rs
+++ b/third_party/move/move-model/src/ty.rs
@@ -1513,6 +1513,10 @@ pub trait UnificationContext: AbilityContext {
 pub struct ReceiverFunctionInstance {
     /// Qualified id
     pub id: QualifiedId<FunId>,
+    /// Function name
+    pub fun_name: Symbol,
+    /// Type parameters
+    pub type_params: Vec<TypeParameter>,
     /// Type instantiation of the function
     pub type_inst: Vec<Type>,
     /// Types of the arguments, instantiated
@@ -1786,6 +1790,7 @@ impl Substitution {
                     if let Some(receiver) = context.get_receiver_function(ty, *name) {
                         self.eval_receiver_function_constraint(
                             context,
+                            loc,
                             variance,
                             ty_args_opt,
                             args_loc,
@@ -1951,6 +1956,7 @@ impl Substitution {
     fn eval_receiver_function_constraint(
         &mut self,
         context: &mut impl UnificationContext,
+        loc: &Loc,
         variance: Variance,
         ty_args_opt: &Option<(Vec<Loc>, Vec<Type>)>,
         args_loc: &[Loc],
@@ -1978,6 +1984,24 @@ impl Substitution {
                 &receiver.type_inst,
             )?;
         }
+        // Need to add any constraints for type parameters.
+        for (tparam, targ) in receiver.type_params.iter().zip(&receiver.type_inst) {
+            for ctr in Constraint::for_type_parameter(tparam) {
+                self.eval_constraint(
+                    context,
+                    loc,
+                    &self.specialize(targ),
+                    Variance::NoVariance,
+                    WideningOrder::LeftToRight,
+                    ctr,
+                    Some(ConstraintContext::default().for_type_param(
+                        false,
+                        receiver.fun_name,
+                        tparam.clone(),
+                    )),
+                )?
+            }
+        }
         self.unify_vec(
             context,
             variance,


Test patch:
diff --git a/third_party/move/move-compiler-v2/tests/bytecode-verify-failure/equality.exp b/third_party/move/move-compiler-v2/tests/bytecode-verify-failure/equality.exp
index 2dc489f6b900f..3c99d92a1d3b8 100644
--- a/third_party/move/move-compiler-v2/tests/bytecode-verify-failure/equality.exp
+++ b/third_party/move/move-compiler-v2/tests/bytecode-verify-failure/equality.exp
@@ -16,6 +16,7 @@ B0:
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `EQUALITY_OP_TYPE_MISMATCH_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
   ┌─ tests/bytecode-verify-failure/equality.move:3:9
   │
 3 │         x == y
diff --git a/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.exp b/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.exp
new file mode 100644
index 0000000000000..8fbc43e7b01e6
--- /dev/null
+++ b/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.exp
@@ -0,0 +1,12 @@
+
+Diagnostics:
+error: type `V` is missing required ability `drop`
+  ┌─ tests/checking/abilities/bug_14813_fun_call_ability.move:6:9
+  │
+6 │         self.search(key)
+  │         ^^^^^^^^^^^^^^^^
+  ·
+9 │     fun search<V: drop>(self: &Map<V>, key: u256): bool {
+  │                - declaration of type parameter `V`
+  │
+  = required by instantiating type parameter `V:drop` of function `search`
diff --git a/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.move b/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.move
new file mode 100644
index 0000000000000..ad63e9b4eee8c
--- /dev/null
+++ b/third_party/move/move-compiler-v2/tests/checking/abilities/bug_14813_fun_call_ability.move
@@ -0,0 +1,12 @@
+module 0x815::red_black_map {
+
+    struct Map<phantom V> has drop {}
+
+    public fun contains<V>(self: &Map<V>, key: u256): bool {
+        self.search(key)
+    }
+
+    fun search<V: drop>(self: &Map<V>, key: u256): bool {
+        true
+    }
+}
diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/bug_12817_order_dependency.old.exp b/third_party/move/move-compiler-v2/tests/reference-safety/bug_12817_order_dependency.old.exp
index 9d25e8fb98a70..f3f27ea2ae0c6 100644
--- a/third_party/move/move-compiler-v2/tests/reference-safety/bug_12817_order_dependency.old.exp
+++ b/third_party/move/move-compiler-v2/tests/reference-safety/bug_12817_order_dependency.old.exp
@@ -3,6 +3,7 @@
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `READREF_EXISTS_MUTABLE_BORROW_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
    ┌─ tests/reference-safety/bug_12817_order_dependency.move:14:9
    │
 14 │         *r2 + *r1 // <- changed order here
diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/bug_13149.old.exp b/third_party/move/move-compiler-v2/tests/reference-safety/bug_13149.old.exp
index 76f872ecaac28..9a0a2cacf5264 100644
--- a/third_party/move/move-compiler-v2/tests/reference-safety/bug_13149.old.exp
+++ b/third_party/move/move-compiler-v2/tests/reference-safety/bug_13149.old.exp
@@ -3,6 +3,7 @@
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `WRITEREF_EXISTS_BORROW_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
   ┌─ tests/reference-safety/bug_13149.move:7:9
   │
 7 │         *r2 = 2;
diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/bug_13976.old.exp b/third_party/move/move-compiler-v2/tests/reference-safety/bug_13976.old.exp
index 88a6a551180a7..85d919f0dea5a 100644
--- a/third_party/move/move-compiler-v2/tests/reference-safety/bug_13976.old.exp
+++ b/third_party/move/move-compiler-v2/tests/reference-safety/bug_13976.old.exp
@@ -3,6 +3,7 @@
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `CALL_BORROWED_MUTABLE_REFERENCE_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
    ┌─ tests/reference-safety/bug_13976.move:12:13
    │
 12 │             lifted_lambda(&mut a, z))
diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/mutable_borrow_local_twice_invalid.old.exp b/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/mutable_borrow_local_twice_invalid.old.exp
index b9b06da4e11e7..4b5538887ea05 100644
--- a/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/mutable_borrow_local_twice_invalid.old.exp
+++ b/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/mutable_borrow_local_twice_invalid.old.exp
@@ -3,6 +3,7 @@
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `WRITEREF_EXISTS_BORROW_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
   ┌─ tests/reference-safety/v1-borrow-tests/mutable_borrow_local_twice_invalid.move:6:9
   │
 6 │         *r2 = 2;
diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/writeref_borrow_invalid.old.exp b/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/writeref_borrow_invalid.old.exp
index 5f9081c6fde07..781744ed45a72 100644
--- a/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/writeref_borrow_invalid.old.exp
+++ b/third_party/move/move-compiler-v2/tests/reference-safety/v1-borrow-tests/writeref_borrow_invalid.old.exp
@@ -3,6 +3,7 @@
 
 Diagnostics:
 bug: bytecode verification failed with unexpected status code `WRITEREF_EXISTS_BORROW_ERROR`. This is a compiler bug, consider reporting it.
+Error message: none
    ┌─ tests/reference-safety/v1-borrow-tests/writeref_borrow_invalid.move:10:18
    │
 10 │         *g_mut = G { v: 0 };
diff --git a/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.no-optimize.exp b/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.no-optimize.exp
index 6c0273afde077..c63116464c275 100644
--- a/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.no-optimize.exp
+++ b/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.no-optimize.exp
@@ -4,6 +4,7 @@ comparison between v1 and v2 failed:
 + task 0 'publish'. lines 1-15:
 + Error: compilation errors:
 +  bug: bytecode verification failed with unexpected status code `VALUE_STACK_OVERFLOW`. This is a compiler bug, consider reporting it.
++ Error message: none
 +   ┌─ TEMPFILE:5:24
 +   │
 + 5 │         let v = vector[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026];
diff --git a/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.optimize-no-simplify.exp b/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.optimize-no-simplify.exp
index 6c0273afde077..c63116464c275 100644
--- a/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.optimize-no-simplify.exp
+++ b/third_party/move/move-compiler-v2/transactional-tests/tests/constants/large_vectors.optimize-no-simplify.exp
@@ -4,6 +4,7 @@ comparison between v1 and v2 failed:
 + task 0 'publish'. lines 1-15:
 + Error: compilation errors:
 +  bug: bytecode verification failed with unexpected status code `VALUE_STACK_OVERFLOW`. This is a compiler bug, consider reporting it.
++ Error message: none
 +   ┌─ TEMPFILE:5:24
 +   │
 + 5 │         let v = vector[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026];