#[repr(C)]pub struct SenseModule {
pub octree_bits: [u64; 4],
pub directions: [TernaryDir; 8],
pub confidence: f32,
pub kind: SenseKind,
pub version: u8,
pub octree_depth: u8,
pub n_directions: u8,
pub _reserved: u8,
pub commitment: [u8; 32],
}Expand description
Fixed-size sense module: KG latent octree + ternary direction vectors. ~232 bytes. BLAKE3 committed.
Field ordering: u64-aligned first, then f32, then u8 tail.
commitment must remain LAST for the hash-until-end-of-struct pattern.
Fields§
§octree_bits: [u64; 4]Octree occupancy bit-planes (up to depth 3 → 128 nodes in 2×u64).
directions: [TernaryDir; 8]Ternary direction vectors for projection.
confidence: f32Module confidence [0, 1].
kind: SenseKind§version: u8§octree_depth: u8§n_directions: u8§_reserved: u8§commitment: [u8; 32]BLAKE3 commitment over all preceding fields.
Implementations§
Source§impl SenseModule
impl SenseModule
Sourcepub fn project(&self, belief_state: &[f32; 8]) -> f32
pub fn project(&self, belief_state: &[f32; 8]) -> f32
Project belief state onto this module’s ternary directions → sigmoid scalar.
KG weight bridge: output is scaled by module confidence so that high-confidence KG triples produce stronger sense activations and low-confidence triples are attenuated. Confidence 1.0 = unchanged.
Optimized: branch-free bit extraction via shift+AND, flat loop (LLVM auto-vectorizes better than chunked), bounded exp sigmoid.
Sourcepub fn query_octree(&self, level: u8, index: u8) -> Option<bool>
pub fn query_octree(&self, level: u8, index: u8) -> Option<bool>
Query octree occupancy at given level and index. Returns None if indices out of bounds.
Trait Implementations§
Source§impl Clone for SenseModule
impl Clone for SenseModule
Source§fn clone(&self) -> SenseModule
fn clone(&self) -> SenseModule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SenseModule
impl Debug for SenseModule
Auto Trait Implementations§
impl Freeze for SenseModule
impl RefUnwindSafe for SenseModule
impl Send for SenseModule
impl Sync for SenseModule
impl Unpin for SenseModule
impl UnsafeUnpin for SenseModule
impl UnwindSafe for SenseModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more