Cone.TabularIR.Row (Cone v0.1.0)

View Source

Defines the schema for a single row in the Causal Table.

⚠️ ARCHITECTURAL CONSTRAINT

This module must be backed by an Erlang Record (Tuple), NOT an Elixir Struct.

  • Struct (Map): Implies a dynamic "Graph Op" with hash-based lookups and memory fragmentation. This is how traditional computation graphs work.
  • Record (Tuple): Implies a static "Database Row" with O(1) offset access and contiguous memory layout.

Using a Record is essential for:

  1. Zig/C Interop: Mapping directly to extern struct without serialization.
  2. Performance: Scanning the ETS table like a register array rather than traversing a graph.

Summary

Types

t()

@type t() ::
  {:row, id :: term(), op :: atom(), subject :: atom(),
   tick :: {integer(), integer()}, payload :: map() | nil,
   ast :: Macro.t() | nil, bitmask :: integer(), offsets :: [integer()],
   ptr :: integer(), status :: atom()}

Functions

is_row(thing)

new(opts \\ [])

ready?(row_record, current_signals_mask)

row(args \\ [])

(macro)

row(record, args)

(macro)