TileState

Struct TileState 

Source
#[repr(C)]
pub struct TileState { pub tile_id: u8, pub status: u8, pub tick: u32, pub generation: u16, pub _reserved: [u8; 2], pub graph: CompactGraph, pub evidence: EvidenceAccumulator, pub delta_buffer: [Delta; 64], pub delta_count: u16, pub delta_head: u16, pub last_report: TileReport, }
Expand description

Tile state containing all local state for a worker tile

Fields§

§tile_id: u8

Tile identifier (0-255)

§status: u8

Status flags

§tick: u32

Current tick number

§generation: u16

Generation number (incremented on structural changes)

§_reserved: [u8; 2]

Reserved padding

§graph: CompactGraph

Local graph shard

§evidence: EvidenceAccumulator

Evidence accumulator

§delta_buffer: [Delta; 64]

Delta ingestion buffer

§delta_count: u16

Number of deltas in buffer

§delta_head: u16

Buffer head pointer

§last_report: TileReport

Last report produced

Implementations§

Source§

impl TileState

Source

pub const STATUS_INITIALIZED: u8 = 1u8

Status: tile is initialized

Source

pub const STATUS_HAS_DELTAS: u8 = 2u8

Status: tile has pending deltas

Source

pub const STATUS_DIRTY: u8 = 4u8

Status: tile needs recomputation

Source

pub const STATUS_ERROR: u8 = 128u8

Status: tile is in error state

Source

pub fn new(tile_id: u8) -> Self

Create a new tile state

Source

pub fn ingest_delta(&mut self, delta: &Delta) -> bool

Ingest a delta into the buffer

Returns true if the delta was successfully buffered. Returns false if the buffer is full.

Source

pub unsafe fn ingest_delta_raw(&mut self, ptr: *const u8) -> bool

Ingest a delta from raw bytes

§Safety

The caller must ensure that ptr points to a valid Delta structure and that the pointer is properly aligned.

Source

pub fn tick(&mut self, tick_number: u32) -> TileReport

Process one tick of the kernel

This is the main entry point for the tick loop. It:

  1. Processes all buffered deltas
  2. Updates the evidence accumulator
  3. Recomputes graph connectivity if needed
  4. Produces a tile report
Source

pub fn get_witness_fragment(&self) -> WitnessFragment

Get the current witness fragment

Source

pub const fn memory_size() -> usize

Get total memory size of tile state

Source

pub fn reset(&mut self)

Reset the tile to initial state

Source

pub fn has_pending_deltas(&self) -> bool

Check if tile has pending deltas

Source

pub fn is_error(&self) -> bool

Check if tile is in error state

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.