Discovery context
Architect/Critic review of #1435 found that materialization-cache pinning can be implemented independently, but relation-view correctness needs a separate generation contract. Arrangement bucket generations do not cover same-row-count mutation, row permutation, compaction, rollback, COW transitions, or worker-copy ownership.
Scope
- Add explicit rowset/order and storage-buffer generations to
col_rel_t.
- Increment the appropriate generation on append, permutation, compaction, rollback, COW unshare, and replacement-buffer publication.
- Store source generations in materialization, filtered, sorted, and differential cache entries where applicable.
- Reject stale views and force rebuild/miss even when
nrows is unchanged.
- Define worker clone/reset behavior for every generation field and validate teardown under sanitizers.
Acceptance criteria
- Same-row-count mutation, permutation, retraction/rollback, compaction, and COW transitions invalidate the correct cached view.
- Cache lookup validates source generations rather than relying only on row count or arrangement bucket generation.
- Worker create/destroy with populated relation views has no stale-view, double-free, or use-after-free failure under ASan/UBSan.
- Existing arrangement, filtered, differential, sorted, materialization, retraction, compaction, and worker tests remain green.
- No public API/ABI, spill implementation, or suspended-reader subsystem is added.
Dependency
Depends on the materialization-cache pin/deferred-destruction unit in #1435 and feeds #1371, #1372, #1382, and #1383.
Discovery context
Architect/Critic review of #1435 found that materialization-cache pinning can be implemented independently, but relation-view correctness needs a separate generation contract. Arrangement bucket generations do not cover same-row-count mutation, row permutation, compaction, rollback, COW transitions, or worker-copy ownership.
Scope
col_rel_t.nrowsis unchanged.Acceptance criteria
Dependency
Depends on the materialization-cache pin/deferred-destruction unit in #1435 and feeds #1371, #1372, #1382, and #1383.