Expand description
Qualia-native compute universe fabric (Track B2).
This is not a generic GPU scheduler. Universes U0/U1/U2 map to QualiaDB primitives:
- Graph–tensor duality —
NQuingraph andTensor10DSOA share one resident substrate (U1 pin). - Phase-8 bifurcation — lock-free SPSC rings between U0 (LLM), Sentinel, and U1 (tensor).
- Sentinel governance —
DenyRollbackon the control ring before the next token matmul. - VramLedger pins — Full / Eco / Reserve per universe; U0 KV protected in Reserve.
One physical wgpu::Device (gpu_context::shared_gpu); logical parallelism via queues + rings.
Structs§
- Attention
Route Mask - U1 output: sparse attention routing bitmask for U0 matmul (10D kNN filter).
- Context
Inject Ring - Fixed-capacity SPSC context ring (producer U1, consumer U0).
- Context
Inject Token - Lightweight pointer pushed U1→U0 (48 B
NQuinstays in SOA; ring carries index + hash). - Graph
Tensor Substrate - Resident graph↔tensor SOA visible to U1 (write/search), U0 (read/inject), U2 (render).
- Topology
Draft Batch - Draft batch pushed U1→U0 for parallel verify (no draft-model weights).
- Topology
Draft Ring - Universe
Fabric - Qualia fabric: ledger orchestration + shared substrate + Phase-8 context ring.
Enums§
- Phase8
Channel - Phase-8 bifurcation ring (see
llm_agent.rsLogitStream / ControlStream + U1 inject). - Qualia
Primitive - Qualia engine primitive exploited by a compute universe (not portable DB semantics).
Constants§
- ATTENTION_
MASK_ WORDS - CONTEXT_
INJECT_ RING_ CAP - KV_
ATTENTION_ MASK_ WORDS - KV cache bitmask for
fused_attention.wgsl(1024 context slots). - MAX_
DRAFT_ LEN - TOPOLOGY_
DRAFT_ RING_ CAP
Functions§
- attention_
kv_ mask_ u32 - Map U1 route mask (tensor indices) → KV slot mask for attention (B3.2b light).
- attention_
mask_ seq - attention_
route_ mask - build_
attention_ route_ mask - B3.2a — kNN hits → sparse attention bitmask (zero-heap).
- context_
inject_ ring - extrapolate_
topology_ draft - Extrapolate γ concept hashes from kNN trajectory (B3.1b); optional
TopologyDraftMapper(B3.1c). - extrapolate_
topology_ draft_ mapped - load_
query_ tensor - pop_
tensor_ context - U0 decode loop pulls injected graph context (non-blocking).
- pop_
topology_ draft - publish_
attention_ route_ mask - Publish U1 route mask snapshot (producer / tests).
- publish_
decode_ hint - U0 publishes the active decode position for the U1 producer (non-blocking).
- publish_
query_ tensor - U0 publishes the 10D query anchor U1 should search around.
- push_
tensor_ context - Record a tensor kNN hit for async U0 consumption (continuous RAG path).
- push_
tensor_ search_ hits - B2.4 producer hook: push kNN indices from
visit_tensor_search/tensor_search_into. - query_
subject_ hash - run_
tensor_ search_ producer_ cycle - One U1 producer cycle: search resident SOA, push ring, refresh mask, draft topology.
- sentinel_
allows_ topology_ draft - Phase-8 Sentinel gate for U1→U0 topology drafts (B3.1d polish).
- start_
tensor_ search_ producer - B3.3a — spawn background U1 tensor search producer (idempotent).
- stop_
tensor_ search_ producer - topology_
draft_ ring