ADR 0001: The 48-byte Qualia-Quin Alignment

Status

Accepted. The internal bit-allocation of the 6 u64 fields (opcode, datatype tags, flags, clock, parity) is governed by ADR 0008: FrameLayout ABI.

Context

Traditional graph databases rely heavily on dynamic heap allocations (pointers, linked lists, string references) to manage nodes and edges. While this provides maximum flexibility, it inevitably triggers cache misses and unpredictable garbage collection pauses, which destroy performance in resource-constrained edge environments.

Our database, Qualia-DB, must run securely on mobile edge devices with strict 512MB RAM constraints and maximize hardware efficiency.

Decision

We enforce a strict #[repr(C, align(16))] alignment, standardizing the QualiaQuin primitive to exactly 48 bytes.

#[repr(C, align(16))]
pub struct QualiaQuin {
    pub subject: u64,
    pub predicate: u64,
    pub object: u64,
    pub context: u64,
    pub metadata: u64,
    pub parity: u64,
}

By ensuring the structural payload maps uniformly, memory operations bypass the heap allocator.

Consequences