Crate cognitum_gate_kernel

Crate cognitum_gate_kernel 

Source
Expand description

Cognitum Gate Kernel

A no_std WASM kernel for worker tiles in a 256-tile coherence gate fabric. Each tile maintains a local graph shard, accumulates evidence for sequential testing, and produces witness fragments for aggregation.

§Architecture

The coherence gate consists of 256 worker tiles, each running this kernel. Tiles receive delta updates (edge additions, removals, weight changes) and observations, process them through a deterministic tick loop, and produce reports containing:

  • Local graph state (vertices, edges, components)
  • Evidence accumulation (e-values for hypothesis testing)
  • Witness fragments (for global min-cut aggregation)

§Memory Budget

Each tile operates within a ~64KB memory budget:

  • CompactGraph: ~42KB (vertices, edges, adjacency)
  • EvidenceAccumulator: ~2KB (hypotheses, sliding window)
  • TileState: ~1KB (configuration, buffers)
  • Stack/Control: ~19KB (remaining)

§WASM Exports

The kernel exports three main functions for the WASM interface:

  • ingest_delta: Process incoming delta updates
  • tick: Execute one step of the deterministic tick loop
  • get_witness_fragment: Retrieve the current witness fragment

§Example

// Initialize tile
let tile = TileState::new(42);  // Tile ID 42

// Ingest deltas
tile.ingest_delta(&Delta::edge_add(0, 1, 100));
tile.ingest_delta(&Delta::edge_add(1, 2, 100));

// Process tick
let report = tile.tick(1);

// Get witness
let witness = tile.get_witness_fragment();

Modules§

delta
Delta types for incremental graph updates
evidence
Evidence accumulator for anytime-valid coherence gate
report
Tile report structures for coherence gate coordination
shard
Compact graph shard for tile-local storage

Structs§

TileState
Tile state containing all local state for a worker tile

Constants§

MAX_DELTA_BUFFER
Maximum deltas in ingestion buffer

Functions§

get_memory_usage
Get memory usage in bytes
get_status
Get tile status
get_witness_fragment
Get the current witness fragment
ingest_delta
Ingest a delta from raw memory
init_tile
Initialize the tile with the given ID
reset_tile
Reset the tile state
tick
Execute one tick of the kernel