Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 40002c571ede7ddc84d480b11695fca66c1e8e35)
+++ libcfa/src/Makefile.am	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -48,4 +48,5 @@
 	math.trait.hfa \
 	math.hfa \
+	raii.hfa \
 	time_t.hfa \
 	virtual_dtor.hfa \
Index: libcfa/src/collections/array.hfa
===================================================================
--- libcfa/src/collections/array.hfa	(revision 40002c571ede7ddc84d480b11695fca66c1e8e35)
+++ libcfa/src/collections/array.hfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -131,13 +131,27 @@
 
     static inline void __taglen( tag(arpk(N, S, Timmed, Tbase)), tag(N) ) {}
-
-    // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa)
-    static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) {
-        void ?{}( S (&inner)[N] ) {}
-        ?{}(this.strides);
-    }
-    static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
-        void ^?{}( S (&inner)[N] ) {}
-        ^?{}(this.strides);
+}
+
+// RAII pattern has workarounds for
+//  - Trac 226:  Simplest handling would be, require immediate element to be otype, let autogen
+//    raii happen.  Performance on even a couple dimensions is unacceptable because of exponential
+//    thunk creation: ?{}() needs all four otype funcs from next level, so does ^?{}(), so do the
+//    other two.  This solution offers ?{}() that needs only ?{}(), and similar for ^?{}.
+
+forall( [N], S & | sized(S), Timmed &, Tbase & | { void ?{}( Timmed & ); } )
+static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) {    
+    void ?{}( S (&)[N] ) {}
+    ?{}(this.strides);
+
+    for (i; N) ?{}( (Timmed &) this.strides[i] );
+}
+
+forall( [N], S & | sized(S), Timmed &, Tbase & | { void ^?{}( Timmed & ); } )
+static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
+    void ^?{}( S (&)[N] ) {}
+    ^?{}(this.strides);
+
+    for (i; N ) {
+        ^?{}( (Timmed &) this.strides[N-i-1] );
     }
 }
@@ -147,5 +161,5 @@
 //
 
-forall( Te )
+forall( Te * )
 static inline Te mkar_( tag(Te) ) {}
 
Index: libcfa/src/raii.hfa
===================================================================
--- libcfa/src/raii.hfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ libcfa/src/raii.hfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,109 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2023 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// raii.hfa -- PUBLIC
+// Utilities for advanced RAII (constructor/destructor) patterns
+//
+// Author           : Mike Brooks
+// Created On       : Fri Sep 22 15:00:00 2023
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+#pragma once
+
+// Provides access to unititialized storage.
+// Intended to make cheap delayed intialization possible.
+// Similar to uC++ uNoCtor.
+// Regardless of what constructors T offers, the declaration
+//   uninit(T) x;
+// makes x:
+//   - assignable to T,
+//   - be, at first, uninitialized, and
+//   - receive a T-destructor call when x goes out of scope.
+// This sitation means the user becomes responsible for making a placement constructor call
+// on x before its first use, even if this first use is the implicit destructor call.
+// This sitation contrasts with that of
+//   T y @= {};
+// in that y does not receive an implied destructor call when it goes out of scope.
+// This sitation contrasts with that of
+//   optional(T) z;
+// in that z receives a T-destructor call conditionally upon the runtime-tracked state,
+// and that z's assignability to T is guarded by the runtime-tracked state.
+//
+// Implementation note: the uninit RAII that follows is a parade of cfa-cpp quirk exploitations.
+//
+forall( T* )
+struct uninit {
+    inline T;
+};
+
+// Parameterless ctor: leaves bits within uninitialized.
+forall( T* )
+void  ?{}( uninit(T) & this ) { 
+
+    // Implementation takes advantage of CFA-available unsoundness.
+    // It could be called a bug; if it's fixed, then uninit needs an escape hatch,
+    // or to find a different loophole.
+
+    // Fundamental unsoundness: Here is a constructor for a T, whatever T is.
+    // Sound compiler reaction: We don't know what fields T has,
+    // so the programmer is surely failing to initialize all of T's fields,
+    // for some choice of T.
+    // Current compiler reaction: Ok, it initializes all the fields we know about.
+    void ?{}( T & ) {}
+
+    // Now for some ado about nothing.
+    // We need to call the above constructor on the inline T field.
+    //   Becasue the compiler holds us accountable for intizliing every field of uninit(T).
+    //   We are happy to do so and are not trying to get out of it.
+    // But the compiler doesn't recognize this form as a field initialization
+    //   T & inner = this;
+    //   ( inner ){};
+    // And the compiler doesn't offer this feature
+    //   ( (return T &) this ){};
+    // It does recognize this form...
+
+    ( (T&) this ){};
+
+    // ...though it probably shouldn't.
+    // The problem with this form is that it doesn't actually mean the Plan-9 base field.
+    // It means to reinterpret `this` with type T.
+    // For a plan-9 use in which the base-type field is not first,
+    // this form would send the wrong address to the called ctor.
+    // Fortunately, uninit has the base-type field first.
+    // For an RAII use in which the constructor does something,
+    // getting the wrong address would matter.
+    // Fortunately, ?{}(T&) is a no-op.
+}
+
+// dtor: pass-through
+forall( T* | { void ^?{}( T& ); } )
+void ^?{}( uninit(T) & this) {
+    // an inner dtor call is implied
+
+    // In fact, an autogen'd dtor would have sufficed.
+    // But there is no autogen'd dtor because no T-dtor is asserted on the struct declaration.
+    // Adding assertions to the struct decl would make the intended ctor (implemented above)
+    // a less preferred candidate than the declared, but undefined, (ugh!) autogen ctor.
+}
+
+// Optional explicit inner-ctor invoation helper.
+// Generally optional, because 1 and 2 below are equivalent:
+//   struct Foo;
+//   void ?{}( Foo &, X, Y, Z );
+//   uninit(Foo) uf;
+//   ?( uf ){ x, y, z };      // 1
+//   emplace( uf, x, y, z );  // 2
+// Is necessary for reaching a parameterless constructor 
+//   void ?{}( Foo & );
+//   ?( uf ){};               // calls ?{}( uninit(Foo) & ), which does nothing
+//   emplace( uf );           // calls ?{}( Foo & ), probably what you want
+forall( T*, Args... | { void ?{}( T&, Args ); } )
+void emplace( uninit(T) & this, Args a ) {
+    T & inner = this;
+    ( inner ){ a };
+}
Index: tests/array-collections/.expect/array-raii-c.txt
===================================================================
--- tests/array-collections/.expect/array-raii-c.txt	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ tests/array-collections/.expect/array-raii-c.txt	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,109 @@
+=== builtins
+some nonzero
+silly: some nonzero
+=== custom
+ [1]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [2]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+ctor 5
+func 0 at (0, 0)
+func 1 at (0, 1)
+func 2 at (0, 2)
+func 3 at (1, 0)
+func 4 at (1, 1)
+func 5 at (1, 2)
+dtor 5
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [3]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [4]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+=== uninit
+ [1]
+before ctors
+ctor 0
+ctor 999
+ctor 888
+ctor 3
+ctor 4
+func 0
+func 999
+func 888
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 888
+dtor 999
+dtor 0
+ [2]
+before ctors
+ctor 100
+ctor 101
+ctor 102
+ctor 110
+ctor 999
+ctor 888
+func 100 at (0, 0)
+func 101 at (0, 1)
+func 102 at (0, 2)
+func 110 at (1, 0)
+func 999 at (1, 1)
+func 888 at (1, 2)
+dtor 888
+dtor 999
+dtor 110
+dtor 102
+dtor 101
+dtor 100
Index: tests/array-collections/.expect/array-raii-cfa.txt
===================================================================
--- tests/array-collections/.expect/array-raii-cfa.txt	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ tests/array-collections/.expect/array-raii-cfa.txt	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,109 @@
+=== builtins
+some nonzero
+silly: some nonzero
+=== custom
+ [1]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [2]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+ctor 5
+func 0 at (0, 0)
+func 1 at (0, 1)
+func 2 at (0, 2)
+func 3 at (1, 0)
+func 4 at (1, 1)
+func 5 at (1, 2)
+dtor 5
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [3]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+ [4]
+ctor 0
+ctor 1
+ctor 2
+ctor 3
+ctor 4
+func 0
+func 1
+func 2
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 2
+dtor 1
+dtor 0
+=== uninit
+ [1]
+before ctors
+ctor 0
+ctor 999
+ctor 888
+ctor 3
+ctor 4
+func 0
+func 999
+func 888
+func 3
+func 4
+dtor 4
+dtor 3
+dtor 888
+dtor 999
+dtor 0
+ [2]
+before ctors
+ctor 100
+ctor 101
+ctor 102
+ctor 110
+ctor 999
+ctor 888
+func 100 at (0, 0)
+func 101 at (0, 1)
+func 102 at (0, 2)
+func 110 at (1, 0)
+func 999 at (1, 1)
+func 888 at (1, 2)
+dtor 888
+dtor 999
+dtor 110
+dtor 102
+dtor 101
+dtor 100
Index: tests/array-collections/array-raii-c.cfa
===================================================================
--- tests/array-collections/array-raii-c.cfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ tests/array-collections/array-raii-c.cfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,21 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2023 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// array-raii-c.cfa -- checks RAII on C arrays of initialized elements
+//
+// Author           : Mike Brooks
+// Created On       : Fri Sep 22 15:00:00 2023
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+// C array means like `float x[17];`, as used within CFA
+
+#define ADECL1(X, El, N)    El X[N];
+#define ADECL2(X, El, M, N) El X[M][N];
+
+#include "array-raii.hfa"
Index: tests/array-collections/array-raii-cfa.cfa
===================================================================
--- tests/array-collections/array-raii-cfa.cfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ tests/array-collections/array-raii-cfa.cfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,23 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2023 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// array-raii-cfa.cfa -- checks RAII on CFA arrays of initialized elements
+//
+// Author           : Mike Brooks
+// Created On       : Fri Sep 22 15:00:00 2023
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+// CFA array means like `array(float, 17) x;`
+
+#include <collections/array.hfa>
+
+#define ADECL1(X, El, N)    array(El, N) X;
+#define ADECL2(X, El, M, N) array(El, M, N) X;
+
+#include "array-raii.hfa"
Index: tests/array-collections/array-raii.hfa
===================================================================
--- tests/array-collections/array-raii.hfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ tests/array-collections/array-raii.hfa	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
@@ -0,0 +1,174 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2023 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// array-raii.hfa -- combined test implementation for both -c and -cfa versions
+//
+// Author           : Mike Brooks
+// Created On       : Fri Sep 22 15:00:00 2023
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+
+#include <raii.hfa>
+
+// To keep C- vs CFA-array compatibility simple. these tests
+// - use only single-place subscripting, like `m[1][2]`, while deferring 
+//   equivalence of m[1][2] vs m[1,2] to array-md-sbscr-cases
+// - declare arrays via test-specific ADECL macros
+
+
+
+volatile bool checkme = false;
+char junkref[] = "junk";
+extern "C" {
+    char* strcpy(char* destination, const char* source);
+}
+
+// Array of built-in type does not get zeroed
+//   (Surprised?)
+//   Because it has nothing to do with arrays.
+//   Built-in types have no-op ctors.
+//   (Still surprised?  Me too.)
+// If pigs flew and built-ins zeroed themselves, then
+//   Array of built-in type gets zeroed
+//   Array of user-defined type with autogen ctors gets wrapped builtins zeroed (intended purpose of case2 when originally written)
+//   Expected outcome becomes "all zero" twice
+// As is
+//   case1 pretty much just shows the summary statement above and
+//   verifying the case2-wrapper behaviour is just silly, so
+//   the quality of respecting autogens is checked (for real this time) under test_custom
+void test_builtins() {
+    void writeJunkOnStack(int depth) {
+        if (depth == 0) return;
+        char junk[5];
+        strcpy(junk, junkref);
+        writeJunkOnStack(depth-1);
+        if (checkme) printf("%s\n", junk);
+    }
+    void checkzero(float f0, float f1, float f2, float f3, float f4) {
+        if (f0 == 0.f && f1 == 0.f && f2 == 0.f && f3 == 0.f && f4 == 0.f) {
+            printf("all zero\n");
+        } else {
+            printf("some nonzero\n");
+          //printf("%f %f %f %f %f\n", f0, f1, f2, f3, f4);
+        }
+    }
+    void case1() {
+        ADECL1(x, float, 5)
+        checkzero(x[0], x[1], x[2], x[3], x[4]);
+    }
+    struct ffloat { float f; };
+    void case2() {
+        ADECL1(x, ffloat, 5)
+        checkzero(x[0].f, x[1].f, x[2].f, x[3].f, x[4].f);
+    }
+
+    writeJunkOnStack(5);
+    case1();
+    printf("silly: ");
+    writeJunkOnStack(5);
+    case2();
+}
+
+// Array of type with custom raii sees cdtors called
+// Array of user-defined type with autogen cdtors gets wrapped cdtors called
+void test_custom() {
+    int nctorcalls;
+    struct thing { int mem; };
+    void ?{}( thing & this ) {
+        (this.mem){ nctorcalls++ };
+        printf("ctor %d\n", this.mem);
+    }
+    void ^?{}( thing & this ) {
+        printf("dtor %d\n", this.mem);
+    }
+    struct wrapper1 { thing inner; };
+    forall( T ) struct wrapper2 { T inner; };
+    printf(" [1]\n");
+    {
+        nctorcalls = 0;
+        ADECL1(a, thing, 5)
+        for(i; 5) printf("func %d\n", a[i].mem);
+    }
+    printf(" [2]\n");
+    {
+        // White-box note: For the CFA array, the array cdtor is satisfying
+        // its own assertion, in a two-level recursive setup.
+        nctorcalls = 0;
+        ADECL2(a, thing, 2, 3)
+        for(i; 2) for(j; 3) printf("func %d at (%d, %d)\n", a[i][j].mem, i, j);
+    }
+    printf(" [3]\n");
+    {
+        nctorcalls = 0;
+        ADECL1(a, wrapper1, 5)
+        for(i; 5) printf("func %d\n", a[i].inner.mem);
+    }
+    printf(" [4]\n");
+    {
+        nctorcalls = 0;
+        ADECL1(a, wrapper2(thing), 5)
+        for(i; 5) printf("func %d\n", a[i].inner.mem);
+    }
+}
+
+// Array of uninits sees explicit ctor calls (only), and implied dtor calls
+void test_uninit() {
+    struct thing { int mem; };
+    void ?{}( thing & this, int i ) {
+        (this.mem){ i };
+        printf("ctor %d\n", this.mem);
+    }
+    void ?{}( thing & this ) {
+        (this){ 999 };
+    }
+    void ^?{}( thing & this ) {
+        printf("dtor %d\n", this.mem);
+    }
+    printf(" [1]\n");
+    {
+        ADECL1(a, uninit(thing), 5)
+        printf("before ctors\n");
+        for(i; 5) {
+            if (i == 1)
+                emplace(a[i]);
+            else if (i == 2)
+                emplace(a[i], 888);
+            else
+                (a[i]){i};
+        }
+        for(i; 5) printf("func %d\n", a[i].mem);
+    }
+    printf(" [2]\n");
+    {
+        ADECL2(a, uninit(thing), 2, 3)
+        printf("before ctors\n");
+        for(i; 2) for(j; 3) {
+            if (i == 1 && j == 1)
+                emplace(a[i][j]);
+            else if (i == 1 && j == 2)
+                emplace(a[i][j], 888);
+            else
+                (a[i][j]){100 + 10 * i + j};
+        }
+        for(i; 2) for(j; 3) {
+            printf("func %d at (%d, %d)\n", a[i][j].mem, i, j);
+        }
+    }
+}
+
+int main() {
+    printf("=== builtins\n");
+    test_builtins();
+
+    printf("=== custom\n");
+    test_custom();
+
+    printf("=== uninit\n");
+    test_uninit();
+}
