|
|
@@ -0,0 +1,101 @@
|
|
|
+# Session 2026-10-24 — open-array M5 (record fields and constructors)
|
|
|
+
|
|
|
+Continuation of the 2026-10-23 M1–M4 open-array session. M5 moves
|
|
|
+rank-2/3 array fields inside records/classes to the flat+view layout
|
|
|
+and makes constructors produce/consume that layout.
|
|
|
+
|
|
|
+**Branch:** `master`. **Feature state:** `v3-open-arrays-m5`.
|
|
|
+**Gates at the end:** suite **299/299**, fixpoint **OK
|
|
|
+(3,534,072 bytes)**, corpus **518/612 compile-OK, 0 crashes**.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## Numbers
|
|
|
+
|
|
|
+| gate | start (M4) | end (M5) |
|
|
|
+| --- | --- | --- |
|
|
|
+| suite (`compiler/run_tests.sh`) | 295/295 | **299/299** |
|
|
|
+| fixpoint (`bootstrap/fixpoint.sh`) | 3,480,366 B | **3,534,072 B** |
|
|
|
+| corpus (`tools/v3-corpus/corpus.sh`) | 518/612 | **518/612, 0 crashes** |
|
|
|
+
|
|
|
+The corpus is compile-only and has no new cases for record-field
|
|
|
+layout; the new coverage is in the suite.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## What landed
|
|
|
+
|
|
|
+### Record layout
|
|
|
+
|
|
|
+- `SymTab.ArrayFieldFootprint` selects the inline field size:
|
|
|
+ - rank-2/3 arrays: `ArrayPayloadSize` (flat payload only);
|
|
|
+ - 1-D arrays: legacy `ArrObjSize` descriptor.
|
|
|
+- `TypeSizeD`, variant-record sizing and `FieldSize` use that helper, so
|
|
|
+ record offsets/sizes match the new data layout.
|
|
|
+- Record static data (`RecItems`, `RecStatics`, `ArrBodyItems`,
|
|
|
+ `ArrData`) writes flat zero payloads for multi fields and no longer
|
|
|
+ emits per-row sub-descriptors.
|
|
|
+- `InitHeap` zeroes local/heap record multi fields with `InitMultiField`;
|
|
|
+ array-of-record templates/`InitRecArray` inherit the same layout.
|
|
|
+
|
|
|
+### Field access
|
|
|
+
|
|
|
+- `Lower.LowerDesign` synthesizes a view chain with
|
|
|
+ `QbeGen.MakeFieldView` when a multi-dimensional field is selected
|
|
|
+ (including `WITH` fields and fields reached through arrays/pointers).
|
|
|
+- The synthesized outer view points at the inline field payload; lower
|
|
|
+ levels are stack templates, so `ViewIndex`, row subviews, open-array
|
|
|
+ calls, `SIZE`, `ADR`, and row assignment work unchanged.
|
|
|
+- `t_nestarr` (record array with nested CHAR field) now uses the flat
|
|
|
+ field layout and remains green.
|
|
|
+
|
|
|
+### Constructors
|
|
|
+
|
|
|
+- Static record constructors (`CtorRecStatic`) receive a flattened
|
|
|
+ payload for multi fields. Nested array-constructor text is parsed
|
|
|
+ and flattened by `FlattenCtorText`/`FlattenArrayText`; missing fields
|
|
|
+ become `z payload`.
|
|
|
+- Runtime record constructors build a field view with `MakeFieldView`
|
|
|
+ and copy the source constructor through `CopyArray`; absent multi
|
|
|
+ fields are zeroed with `ClearMultiField`.
|
|
|
+- Static array-of-record constructors inline record elements instead of
|
|
|
+ storing pointers; runtime array-of-record constructors copy child
|
|
|
+ records and zero absent records.
|
|
|
+- `CtorArrStatic`/`CtorEnd` continue to support ordinary 1-D/scalar
|
|
|
+ constructors; existing `t_ctor3`, `t_ctor7` and `showcase20` behavior
|
|
|
+ is unchanged.
|
|
|
+
|
|
|
+### Tests added
|
|
|
+
|
|
|
+- `t_record_multidim` — global/local records, record arrays, field
|
|
|
+ indexing, open-array pass, `SIZE` and `ADR`.
|
|
|
+- `t_record_multidim_ctor` — runtime record constructor with a 2-D
|
|
|
+ field.
|
|
|
+- `t_record_multidim_const` — static `CONST` record constructor.
|
|
|
+- `t_record_multidim_arrctor` — static and runtime array-of-record
|
|
|
+ constructors with 2-D fields.
|
|
|
+- Existing `t_nestarr` now exercises the migrated field layout.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## Remaining
|
|
|
+
|
|
|
+- Optional pointer-based 1-D view migration: row → 1-D internal calls
|
|
|
+ still use the copy-in/copy-back legacy descriptor, so row `ADR`
|
|
|
+ identity is not preserved. Writes are preserved.
|
|
|
+- M6: final docs/gates/tag and any small polish.
|
|
|
+- `unbounded6`/`unbounded8`/`adrunbounded3` remain declaration-order
|
|
|
+ cases under V3 policy.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## Commits and tags
|
|
|
+
|
|
|
+| commit | tag | work |
|
|
|
+| --- | --- | --- |
|
|
|
+| `df72d03` | `v3-open-arrays-m4` | payload `SIZE`/`TSIZE`, view `ADR` |
|
|
|
+| `04ab8b5` | `v3-open-arrays-m5` | flat multi-dimensional record fields and constructors |
|
|
|
+| this docs commit | `v3-open-arrays-m5-summary` | M5 summary/docs |
|
|
|
+| final docs commit | `v3-session-2026-10-24-open-arrays-end` | session tag |
|
|
|
+
|
|
|
+No push was performed.
|