Parcourir la source

Fix Series.to_array for value types and split uint64 comparison

Series.to_array allocated a T[] and filled it through ItemDelegate<T>,
which marshals elements as gconstpointer into gpointer slots, while
callers with unboxed element types (bool/int/uint/char/uchar/enum)
expect packed elements - the first element read back correct and the
rest garbage. Rewrite it to walk the linked nodes directly and store
through safely_assign_to_array, the approach the base Enumerable and
Vector already use, under the root lock.

Operators.comparison<T>() treated uint64 boxes as (int64?): casting
18446744073709551615UL through a signed box made it compare as -1, so
PriorityQueue<uint64?>.peek() returned the wrong head and sorted
structures ordered it first. Split into separate signed int64 and
unsigned uint64 sign-compare branches.

Re-enabled the remaining BROKEN-disabled value-type matrix cases:
series for bool/int/uint/char/uchar/enum (fixed by the to_array
rewrite), enumerable for bool and boxed int64?/uint64?/float?, and
priority_queue/sorted_vector/sorted_series for boxed int64?/uint64?/
float? (clean now that the Safety.vala and Comparison fixes are in).
Corrected the bool/enumerable assertion itself: {true,false,true,false}
has exactly 2 distinct values, not the 3-or-4 the ternary claimed.

The reported cross-test contamination (bool/priority_queue failing
only when the full suite ran before it) did not reproduce: three
consecutive full-suite runs, 747 ok, exit 0, no glibc aborts. The
earlier failures ran against the stale pre-installed library that
LD_LIBRARY_PATH shadowed over the build.

Verification: ninja build clean; full suite 747/747 ok, exit 0, three
consecutive runs, no glibc aborts; value-type matrix 156/156.
saddle-fedora il y a 1 mois
Parent
commit
ae9092fadf

+ 13 - 7
src/lib/DataStructures/Series.vala

@@ -33,13 +33,19 @@ namespace Invercargill.DataStructures {
         public override uint length { get { return n_items; }}
 
         public override T[] to_array () {
-            var arr = new T[n_items];
-            var count = 0;
-            iterate(i => {
-                arr[count] = i;
-                count++;
-            });
-            return arr;
+            // Walk nodes directly. Writing through ItemDelegate<T> marshals
+            // values as gconstpointer into gpointer slots, but callers with
+            // unboxed T (bool/int/...) expect packed elements -- the base
+            // class and Vector solved this with safely_assign_to_array.
+            lock(root) {
+                var arr = new T[n_items];
+                var count = 0;
+                for(var node = root; node != null; node = node->next) {
+                    safely_assign_to_array<T>(arr, count, node->value);
+                    count++;
+                }
+                return arr;
+            }
         }
 
         public void add(T item) {

+ 2 - 1
src/lib/Operators/Comparison.vala

@@ -33,7 +33,8 @@ namespace Invercargill.Operators {
         else if(type == typeof(bool)) { return (a, b) => (bool)a == (bool)b ? 0 : ((bool)a ? 1 : -1); }
         else if(type == typeof(char)) { return (a, b) => (char)a > (char)b ? 1 : ((char)a < (char)b ? -1 : 0); }
         else if(type.is_enum()) { return (a, b) => (int)a > (int)b ? 1 : ((int)a < (int)b ? -1 : 0); }
-        else if(type == typeof(int64) || type == typeof(uint64)) { return (a, b) => { var x = (int64?)a; var y = (int64?)b; if(x == null && y == null) { return 0; } if(x == null) { return -1; } if(y == null) { return 1; } return (int64)x > (int64)y ? 1 : ((int64)x < (int64)y ? -1 : 0); }; }
+        else if(type == typeof(int64)) { return (a, b) => { var x = (int64?)a; var y = (int64?)b; if(x == null && y == null) { return 0; } if(x == null) { return -1; } if(y == null) { return 1; } return (int64)x > (int64)y ? 1 : ((int64)x < (int64)y ? -1 : 0); }; }
+        else if(type == typeof(uint64)) { return (a, b) => { var x = (uint64?)a; var y = (uint64?)b; if(x == null && y == null) { return 0; } if(x == null) { return -1; } if(y == null) { return 1; } return (uint64)x > (uint64)y ? 1 : ((uint64)x < (uint64)y ? -1 : 0); }; }
         else if(type == typeof(double)) { return (a, b) => { var x = (double?)a; var y = (double?)b; if(x == null && y == null) { return 0; } if(x == null) { return -1; } if(y == null) { return 1; } return (double)x > (double)y ? 1 : ((double)x < (double)y ? -1 : 0); }; }
         else if(type == typeof(float)) { return (a, b) => { var x = (float?)a; var y = (float?)b; if(x == null && y == null) { return 0; } if(x == null) { return -1; } if(y == null) { return 1; } return (float)x > (float)y ? 1 : ((float)x < (float)y ? -1 : 0); }; }
         else if(type.is_a(typeof(Comparable))) { return (a, b) => ((Comparable<T>)a).compare(b); }

+ 292 - 333
src/tests/Integration/ValueTypeMatrix.vala

@@ -54,20 +54,18 @@ void value_type_matrix_bool_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/bool/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/bool/series", () => {
-//         bool[] items = {true, false, true, false};
-// 
-//         var s = new Series<bool>();
-//         foreach (bool i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/bool/series", () => {
+        bool[] items = {true, false, true, false};
+
+        var s = new Series<bool>();
+        foreach (bool i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/bool/dictionary", () => {
         // bool has only two distinct values, so items[2] == items[0]:
@@ -130,24 +128,23 @@ void value_type_matrix_bool_tests() {
         try { q.pop(); assert_not_reached(); } catch (SequenceError e) { }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/bool/enumerable): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/bool/enumerable", () => {
-//         bool[] items = {true, false, true, false};
-// 
-//         var e = Wrap.array(items);
-//         assert(e.count() == 4);
-//         assert(e.select<bool>(i => i).count() == 4);
-//         assert(e.to_array().length == 4);
-//         assert(e.to_vector().count() == 4);
-//         assert(e.first() == items[0]);
-//         assert(e.last() == items[3]);
-//         assert(e.contains(items[2]));
-//         var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
-//         assert(n == 4);
-//         var uniq = Wrap.array(items).distinct().count();
-//         assert(uniq == (items[0] == items[3] ? 3 : 4));
-//     });
+    Test.add_func("/invercargill/value_type_matrix/bool/enumerable", () => {
+    bool[] items = {true, false, true, false};
+
+    var e = Wrap.array(items);
+    assert(e.count() == 4);
+    assert(e.select<bool>(i => i).count() == 4);
+    assert(e.to_array().length == 4);
+    assert(e.to_vector().count() == 4);
+    assert(e.first() == items[0]);
+    assert(e.last() == items[3]);
+    assert(e.contains(items[2]));
+    var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
+    assert(n == 4);
+    var uniq = Wrap.array(items).distinct().count();
+    // bool has only two possible values: {true,false,true,false} -> 2 distinct.
+    assert(uniq == 2);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/bool/priority_queue", () => {
         bool[] items = {true, false, true, false};
@@ -251,20 +248,18 @@ void value_type_matrix_int_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/int/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/int/series", () => {
-//         int[] items = {5, -3, 2147483647, -2147483648};
-// 
-//         var s = new Series<int>();
-//         foreach (int i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/int/series", () => {
+        int[] items = {5, -3, 2147483647, -2147483648};
+
+        var s = new Series<int>();
+        foreach (int i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/int/dictionary", () => {
         int[] items = {5, -3, 2147483647, -2147483648};
@@ -442,20 +437,18 @@ void value_type_matrix_uint_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/uint/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/uint/series", () => {
-//         uint[] items = {5u, 3u, 4000000000u, 0u};
-// 
-//         var s = new Series<uint>();
-//         foreach (uint i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/uint/series", () => {
+        uint[] items = {5u, 3u, 4000000000u, 0u};
+
+        var s = new Series<uint>();
+        foreach (uint i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/uint/dictionary", () => {
         uint[] items = {5u, 3u, 4000000000u, 0u};
@@ -1081,87 +1074,77 @@ void value_type_matrix_int64_tests() {
         try { q.pop(); assert_not_reached(); } catch (SequenceError e) { }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/int64/enumerable): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/int64/enumerable", () => {
-//         int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
-// 
-//         var e = Wrap.array(items);
-//         assert(e.count() == 4);
-//         assert(e.select<int64?>(i => i).count() == 4);
-//         assert(e.to_array().length == 4);
-//         assert(e.to_vector().count() == 4);
-//         assert(e.first() == items[0]);
-//         assert(e.last() == items[3]);
-//         assert(e.contains(items[2]));
-//         var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
-//         assert(n == 4);
-//         var uniq = Wrap.array(items).distinct().count();
-//         assert(uniq == (items[0] == items[3] ? 3 : 4));
-//     });
-
-    // BROKEN(/invercargill/value_type_matrix/int64/priority_queue): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); comparison<int64?> itself verified correct via direct operator probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     // BROKEN(/invercargill/value_type_matrix/int64/priority_queue): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/int64/priority_queue", () => {
-// //         int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
-// //         int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
-// //
-// //         var q = new PriorityQueue<int64?>((a, b) => Operators.comparison<int64?>()(a, b));
-// //         foreach (int64? i in items) q.push(i);
-// //         assert(q.count() == 4);
-// //         assert(q.peek() == sorted[0]);
-// //         for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
-// //         assert(q.count() == 0);
-// //     });
-//
-//     // BROKEN(/invercargill/value_type_matrix/int64/sorted_vector): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-//     // Keep the original body below for the fix tasks to re-enable:
-// //     Test.add_func("/invercargill/value_type_matrix/int64/sorted_vector", () => {
-// //         int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
-// //         int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
-// //
-// //         var sv = new SortedVector<int64?>();
-// //         foreach (int64? i in items) sv.add(i);
-// //         assert(sv.length == 4);
-// //         for (int i = 0; i < 4; i++) {
-// //             int64? got;
-// //             assert(sv.try_get((uint)i, out got));
-// //             assert(got == sorted[i]);
-// //         }
-// //         var sv2 = new SortedVector<int64?>();
-// //         sv2.add_all(Wrap.array(items));
-// //         assert(sv2.length == 4);
-// //         assert(sv2.get(0) == sorted[0]);
-// //         var srt = Wrap.array(items).sort(Operators.comparison<int64?>()).to_array();
-// //         assert(srt.length == 4);
-// //         for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
-// //     });
-//
-//     // BROKEN(/invercargill/value_type_matrix/int64/sorted_series): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-//     // Keep the original body below for the fix tasks to re-enable:
-// //     Test.add_func("/invercargill/value_type_matrix/int64/sorted_series", () => {
-// //         int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
-// //         int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
-// //
-// //         var ss = new SortedSeries<int64?>();
-// //         foreach (int64? i in items) ss.add(i);
-// //         assert(ss.length == 4);
-// //         var arr = ss.to_array();
-// //         assert(arr.length == 4);
-// //         for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
-// //     });
-//
-//     Test.add_func("/invercargill/value_type_matrix/int64/operators", () => {
-//         int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
-//
-//         var eq = Operators.equality<int64?>();
-//         assert(eq(items[0], items[0]));
-//         assert(!eq(items[0], items[1]));
-//         var st = Operators.stringify<int64?>();
-//         assert(st(items[0]) != null && st(items[0]).length > 0);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/int64/enumerable", () => {
+    int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
+
+    var e = Wrap.array(items);
+    assert(e.count() == 4);
+    assert(e.select<int64?>(i => i).count() == 4);
+    assert(e.to_array().length == 4);
+    assert(e.to_vector().count() == 4);
+    assert(e.first() == items[0]);
+    assert(e.last() == items[3]);
+    assert(e.contains(items[2]));
+    var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
+    assert(n == 4);
+    var uniq = Wrap.array(items).distinct().count();
+    assert(uniq == (items[0] == items[3] ? 3 : 4));
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/int64/priority_queue", () => {
+    int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
+    int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
+
+    var q = new PriorityQueue<int64?>((a, b) => Operators.comparison<int64?>()(a, b));
+    foreach (int64? i in items) q.push(i);
+    assert(q.count() == 4);
+    assert(q.peek() == sorted[0]);
+    for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
+    assert(q.count() == 0);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/int64/sorted_vector", () => {
+    int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
+    int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
+
+    var sv = new SortedVector<int64?>();
+    foreach (int64? i in items) sv.add(i);
+    assert(sv.length == 4);
+    for (int i = 0; i < 4; i++) {
+    int64? got;
+    assert(sv.try_get((uint)i, out got));
+    assert(got == sorted[i]);
+    }
+    var sv2 = new SortedVector<int64?>();
+    sv2.add_all(Wrap.array(items));
+    assert(sv2.length == 4);
+    assert(sv2.get(0) == sorted[0]);
+    var srt = Wrap.array(items).sort(Operators.comparison<int64?>()).to_array();
+    assert(srt.length == 4);
+    for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/int64/sorted_series", () => {
+    int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
+    int64?[] sorted = {-5000000000L, 0L, 5000000000L, 9223372036854775807L};
+
+    var ss = new SortedSeries<int64?>();
+    foreach (int64? i in items) ss.add(i);
+    assert(ss.length == 4);
+    var arr = ss.to_array();
+    assert(arr.length == 4);
+    for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/int64/operators", () => {
+    int64?[] items = {5000000000L, -5000000000L, 9223372036854775807L, 0L};
+
+    var eq = Operators.equality<int64?>();
+    assert(eq(items[0], items[0]));
+    assert(!eq(items[0], items[1]));
+    var st = Operators.stringify<int64?>();
+    assert(st(items[0]) != null && st(items[0]).length > 0);
+    });
 
 }
 
@@ -1280,87 +1263,77 @@ void value_type_matrix_uint64_tests() {
         try { q.pop(); assert_not_reached(); } catch (SequenceError e) { }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/uint64/enumerable): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/uint64/enumerable", () => {
-//         uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
-// 
-//         var e = Wrap.array(items);
-//         assert(e.count() == 4);
-//         assert(e.select<uint64?>(i => i).count() == 4);
-//         assert(e.to_array().length == 4);
-//         assert(e.to_vector().count() == 4);
-//         assert(e.first() == items[0]);
-//         assert(e.last() == items[3]);
-//         assert(e.contains(items[2]));
-//         var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
-//         assert(n == 4);
-//         var uniq = Wrap.array(items).distinct().count();
-//         assert(uniq == (items[0] == items[3] ? 3 : 4));
-//     });
-
-    // BROKEN(/invercargill/value_type_matrix/uint64/priority_queue): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); comparison<uint64?> itself verified correct via direct operator probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     // BROKEN(/invercargill/value_type_matrix/uint64/priority_queue): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/uint64/priority_queue", () => {
-// //         uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
-// //         uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
-// //
-// //         var q = new PriorityQueue<uint64?>((a, b) => Operators.comparison<uint64?>()(a, b));
-// //         foreach (uint64? i in items) q.push(i);
-// //         assert(q.count() == 4);
-// //         assert(q.peek() == sorted[0]);
-// //         for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
-// //         assert(q.count() == 0);
-// //     });
-//
-//     // BROKEN(/invercargill/value_type_matrix/uint64/sorted_vector): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-//     // Keep the original body below for the fix tasks to re-enable:
-// //     Test.add_func("/invercargill/value_type_matrix/uint64/sorted_vector", () => {
-// //         uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
-// //         uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
-// //
-// //         var sv = new SortedVector<uint64?>();
-// //         foreach (uint64? i in items) sv.add(i);
-// //         assert(sv.length == 4);
-// //         for (int i = 0; i < 4; i++) {
-// //             uint64? got;
-// //             assert(sv.try_get((uint)i, out got));
-// //             assert(got == sorted[i]);
-// //         }
-// //         var sv2 = new SortedVector<uint64?>();
-// //         sv2.add_all(Wrap.array(items));
-// //         assert(sv2.length == 4);
-// //         assert(sv2.get(0) == sorted[0]);
-// //         var srt = Wrap.array(items).sort(Operators.comparison<uint64?>()).to_array();
-// //         assert(srt.length == 4);
-// //         for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
-// //     });
-//
-//     // BROKEN(/invercargill/value_type_matrix/uint64/sorted_series): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-//     // Keep the original body below for the fix tasks to re-enable:
-// //     Test.add_func("/invercargill/value_type_matrix/uint64/sorted_series", () => {
-// //         uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
-// //         uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
-// //
-// //         var ss = new SortedSeries<uint64?>();
-// //         foreach (uint64? i in items) ss.add(i);
-// //         assert(ss.length == 4);
-// //         var arr = ss.to_array();
-// //         assert(arr.length == 4);
-// //         for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
-// //     });
-//
-//     Test.add_func("/invercargill/value_type_matrix/uint64/operators", () => {
-//         uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
-//
-//         var eq = Operators.equality<uint64?>();
-//         assert(eq(items[0], items[0]));
-//         assert(!eq(items[0], items[1]));
-//         var st = Operators.stringify<uint64?>();
-//         assert(st(items[0]) != null && st(items[0]).length > 0);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/uint64/enumerable", () => {
+    uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
+
+    var e = Wrap.array(items);
+    assert(e.count() == 4);
+    assert(e.select<uint64?>(i => i).count() == 4);
+    assert(e.to_array().length == 4);
+    assert(e.to_vector().count() == 4);
+    assert(e.first() == items[0]);
+    assert(e.last() == items[3]);
+    assert(e.contains(items[2]));
+    var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
+    assert(n == 4);
+    var uniq = Wrap.array(items).distinct().count();
+    assert(uniq == (items[0] == items[3] ? 3 : 4));
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/uint64/priority_queue", () => {
+    uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
+    uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
+
+    var q = new PriorityQueue<uint64?>((a, b) => Operators.comparison<uint64?>()(a, b));
+    foreach (uint64? i in items) q.push(i);
+    assert(q.count() == 4);
+    assert(q.peek() == sorted[0]);
+    for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
+    assert(q.count() == 0);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/uint64/sorted_vector", () => {
+    uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
+    uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
+
+    var sv = new SortedVector<uint64?>();
+    foreach (uint64? i in items) sv.add(i);
+    assert(sv.length == 4);
+    for (int i = 0; i < 4; i++) {
+    uint64? got;
+    assert(sv.try_get((uint)i, out got));
+    assert(got == sorted[i]);
+    }
+    var sv2 = new SortedVector<uint64?>();
+    sv2.add_all(Wrap.array(items));
+    assert(sv2.length == 4);
+    assert(sv2.get(0) == sorted[0]);
+    var srt = Wrap.array(items).sort(Operators.comparison<uint64?>()).to_array();
+    assert(srt.length == 4);
+    for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/uint64/sorted_series", () => {
+    uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
+    uint64?[] sorted = {0UL, 1UL, 5000000000UL, 18446744073709551615UL};
+
+    var ss = new SortedSeries<uint64?>();
+    foreach (uint64? i in items) ss.add(i);
+    assert(ss.length == 4);
+    var arr = ss.to_array();
+    assert(arr.length == 4);
+    for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/uint64/operators", () => {
+    uint64?[] items = {5000000000UL, 1UL, 0UL, 18446744073709551615UL};
+
+    var eq = Operators.equality<uint64?>();
+    assert(eq(items[0], items[0]));
+    assert(!eq(items[0], items[1]));
+    var st = Operators.stringify<uint64?>();
+    assert(st(items[0]) != null && st(items[0]).length > 0);
+    });
 
 }
 
@@ -1479,75 +1452,67 @@ void value_type_matrix_float_tests() {
         try { q.pop(); assert_not_reached(); } catch (SequenceError e) { }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/float/enumerable): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/float/enumerable", () => {
-//         float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
-// 
-//         var e = Wrap.array(items);
-//         assert(e.count() == 4);
-//         assert(e.select<float?>(i => i).count() == 4);
-//         assert(e.to_array().length == 4);
-//         assert(e.to_vector().count() == 4);
-//         assert(e.first() == items[0]);
-//         assert(e.last() == items[3]);
-//         assert(e.contains(items[2]));
-//         var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
-//         assert(n == 4);
-//         var uniq = Wrap.array(items).distinct().count();
-//         assert(uniq == (items[0] == items[3] ? 3 : 4));
-//     });
-
-    // BROKEN(/invercargill/value_type_matrix/float/priority_queue): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/float/priority_queue", () => {
-//         float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
-//         float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
-//
-//         var q = new PriorityQueue<float?>((a, b) => Operators.comparison<float?>()(a, b));
-//         foreach (float? i in items) q.push(i);
-//         assert(q.count() == 4);
-//         assert(q.peek() == sorted[0]);
-//         for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
-//         assert(q.count() == 0);
-//     });
-
-    // BROKEN(/invercargill/value_type_matrix/float/sorted_vector): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/float/sorted_vector", () => {
-//         float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
-//         float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
-//
-//         var sv = new SortedVector<float?>();
-//         foreach (float? i in items) sv.add(i);
-//         assert(sv.length == 4);
-//         for (int i = 0; i < 4; i++) {
-//             float? got;
-//             assert(sv.try_get((uint)i, out got));
-//             assert(got == sorted[i]);
-//         }
-//         var sv2 = new SortedVector<float?>();
-//         sv2.add_all(Wrap.array(items));
-//         assert(sv2.length == 4);
-//         assert(sv2.get(0) == sorted[0]);
-//         var srt = Wrap.array(items).sort(Operators.comparison<float?>()).to_array();
-//         assert(srt.length == 4);
-//         for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
-//     });
-
-    // BROKEN(/invercargill/value_type_matrix/float/sorted_series): assertions pass but heap corruption aborts at teardown - Safety.vala typed-array storage for always-boxed generics (task 2 scope); Operators.comparison itself verified correct via direct probes
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/float/sorted_series", () => {
-//         float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
-//         float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
-//
-//         var ss = new SortedSeries<float?>();
-//         foreach (float? i in items) ss.add(i);
-//         assert(ss.length == 4);
-//         var arr = ss.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/float/enumerable", () => {
+    float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
+
+    var e = Wrap.array(items);
+    assert(e.count() == 4);
+    assert(e.select<float?>(i => i).count() == 4);
+    assert(e.to_array().length == 4);
+    assert(e.to_vector().count() == 4);
+    assert(e.first() == items[0]);
+    assert(e.last() == items[3]);
+    assert(e.contains(items[2]));
+    var n = Wrap.array(items).aggregate<int>(0, (acc, i) => acc + 1);
+    assert(n == 4);
+    var uniq = Wrap.array(items).distinct().count();
+    assert(uniq == (items[0] == items[3] ? 3 : 4));
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/float/priority_queue", () => {
+    float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
+    float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
+
+    var q = new PriorityQueue<float?>((a, b) => Operators.comparison<float?>()(a, b));
+    foreach (float? i in items) q.push(i);
+    assert(q.count() == 4);
+    assert(q.peek() == sorted[0]);
+    for (int i = 0; i < 4; i++) assert(q.pop() == sorted[i]);
+    assert(q.count() == 0);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/float/sorted_vector", () => {
+    float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
+    float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
+
+    var sv = new SortedVector<float?>();
+    foreach (float? i in items) sv.add(i);
+    assert(sv.length == 4);
+    for (int i = 0; i < 4; i++) {
+    float? got;
+    assert(sv.try_get((uint)i, out got));
+    assert(got == sorted[i]);
+    }
+    var sv2 = new SortedVector<float?>();
+    sv2.add_all(Wrap.array(items));
+    assert(sv2.length == 4);
+    assert(sv2.get(0) == sorted[0]);
+    var srt = Wrap.array(items).sort(Operators.comparison<float?>()).to_array();
+    assert(srt.length == 4);
+    for (int i = 0; i < 4; i++) assert(srt[i] == sorted[i]);
+    });
+
+    Test.add_func("/invercargill/value_type_matrix/float/sorted_series", () => {
+    float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
+    float?[] sorted = {-2.25f, 0.0f, 1.5f, 100.5f};
+
+    var ss = new SortedSeries<float?>();
+    foreach (float? i in items) ss.add(i);
+    assert(ss.length == 4);
+    var arr = ss.to_array();
+    assert(arr.length == 4);
+    for (int i = 0; i < 4; i++) assert(arr[i] == sorted[i]);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/float/operators", () => {
         float?[] items = {1.5f, -2.25f, 100.5f, 0.0f};
@@ -1795,20 +1760,18 @@ void value_type_matrix_char_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/char/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/char/series", () => {
-//         char[] items = {'a', 'Z', '0', '~'};
-// 
-//         var s = new Series<char>();
-//         foreach (char i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/char/series", () => {
+        char[] items = {'a', 'Z', '0', '~'};
+
+        var s = new Series<char>();
+        foreach (char i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/char/dictionary", () => {
         char[] items = {'a', 'Z', '0', '~'};
@@ -1986,20 +1949,18 @@ void value_type_matrix_uchar_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/uchar/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/uchar/series", () => {
-//         uchar[] items = {(uchar)65, (uchar)200, (uchar)0, (uchar)255};
-// 
-//         var s = new Series<uchar>();
-//         foreach (uchar i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/uchar/series", () => {
+        uchar[] items = {(uchar)65, (uchar)200, (uchar)0, (uchar)255};
+
+        var s = new Series<uchar>();
+        foreach (uchar i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/uchar/dictionary", () => {
         uchar[] items = {(uchar)65, (uchar)200, (uchar)0, (uchar)255};
@@ -2177,20 +2138,18 @@ void value_type_matrix_enum_tests() {
         }
     });
 
-    // BROKEN(/invercargill/value_type_matrix/enum/series): known failure at time of writing -- whole case disabled.
-    // Keep the original body below for the fix tasks to re-enable:
-//     Test.add_func("/invercargill/value_type_matrix/enum/series", () => {
-//         ValueTypeFruit[] items = {ValueTypeFruit.APPLE, ValueTypeFruit.BANANA, ValueTypeFruit.CHERRY, ValueTypeFruit.APPLE};
-// 
-//         var s = new Series<ValueTypeFruit>();
-//         foreach (ValueTypeFruit i in items) s.add(i);
-//         assert(s.count() == 4);
-//         var arr = s.to_array();
-//         assert(arr.length == 4);
-//         for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
-//         assert(s.pop_start() == items[0]);
-//         assert(s.count() == 3);
-//     });
+    Test.add_func("/invercargill/value_type_matrix/enum/series", () => {
+        ValueTypeFruit[] items = {ValueTypeFruit.APPLE, ValueTypeFruit.BANANA, ValueTypeFruit.CHERRY, ValueTypeFruit.APPLE};
+
+        var s = new Series<ValueTypeFruit>();
+        foreach (ValueTypeFruit i in items) s.add(i);
+        assert(s.count() == 4);
+        var arr = s.to_array();
+        assert(arr.length == 4);
+        for (int i = 0; i < 4; i++) assert(arr[i] == items[i]);
+        assert(s.pop_start() == items[0]);
+        assert(s.count() == 3);
+    });
 
     Test.add_func("/invercargill/value_type_matrix/enum/dictionary", () => {
         ValueTypeFruit[] items = {ValueTypeFruit.APPLE, ValueTypeFruit.BANANA, ValueTypeFruit.CHERRY, ValueTypeFruit.APPLE};