Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/gate-2-aggregates.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Gate 2 extends the verified QBE path from scalar SSA values to heap-free,
static-layout values. It implements existing TypeRB record, payload-enum, and
`Result` semantics without introducing a native-only language feature.

## Implementation status

The backend-neutral layout model, aggregate Native MIR, verifier, and
hand-authored QBE vertical slice are implemented. The QBE adapter uses
caller-owned result storage, borrowed aggregate parameters, separate transfer
and value slots for aggregate block parameters, and checked payload projection.
It initializes aggregate storage before construction so padding and inactive
payload bytes never carry indeterminate data.

The source snapshot producer, strict version 3 decoder, source differential
corpus, and Gate 2 measurements remain active work. This document records the
complete checkpoint rather than treating the hand-authored vertical slice as
the gate result.

## Checkpoint boundary

The supported value graph is finite and known at compile time:
Expand Down Expand Up @@ -37,6 +51,12 @@ semantics remain value semantics even though the disposable target ABI passes
addresses internally. A later allocation strategy can therefore add escaping
storage without changing TypeRB record or enum behavior.

Aggregate construction zero-initializes its complete slot and uses the system
`memcpy`/`memset` ABI for fixed-size copies and initialization. These dynamic
system-library dependencies are counted with the executable in Gate 2 reports.
Block arguments use distinct transfer and value slots so control-flow edges
retain parallel-copy semantics, including aggregate swaps and back edges.

## Exit evidence

Gate 2 completes when:
Expand Down
Loading