Fat Pointer Hardening: All 17 Journeys to 10/10
5 sections
Overview
Fix 3 CRITICAL bugs and 1 HIGH codegen issue discovered by the fat pointer code journeys (J14-J17), then harden the compiler with a combinatorial test matrix that crosses fat pointer types with every language feature. The goal: all 17 code journeys score 10.0/10, and the test matrix prevents future regressions at any intersection of fat pointers with other features.
Completed
5 sections
Iterator–Collection Ownership Contract
Fix the ownership contract between iterators and collections so that [T] where T has Drop never double-frees elements
Monomorphization of Captured Types
Closures capturing any non-scalar type (str, [T], structs, closures) compile correctly in AOT with fully resolved types
Aggregate Value Emission
Fat pointer values (str, [T], closures) are copied with aggregate load/store instead of field-by-field GEP+load+insertvalue, eliminating 3-6x instruction bloat
Combinatorial Test Matrix
Every cell of {type categories} x {language features} is covered by an AOT test, ensuring no intersection of fat pointers with any feature is untested
Verification
All 17 code journeys score 10.0/10, test-all.sh green, Valgrind clean