code wiki / (root) / nx_engram.nx

nx_engram.nx

buildroot/runtime/nx_engram.nx

4259 B130 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_engram.nx -- short-term memory / cache (hippocampal-class). Biology: an engram is a physical/chemical change that represents a stored memory. Hippocampal short-term memory consolidates into long-term storage via repeated activation.

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_engram.nx nx_engram_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_engram_test.nx

structs

17struct NxEngramEntry
28struct NxEngramCache

consts

10const NX_EG_V_OK: nx_int = 0
11const NX_EG_V_HIT: nx_int = 1
12const NX_EG_V_MISS: nx_int = 2
13const NX_EG_V_EVICTED: nx_int = 3
14const NX_EG_V_NULL: nx_int = 4
15const NX_EG_V_N: nx_int = 5
26const NX_EG_ENT_BYTES: nx_int = 40
35const NX_EG_CACHE_BYTES: nx_int = 32

functions

37func nx_eg_v_is_valid(v: nx_int) -> nx_int
called by 1: main
43func _eg_at(c: *NxEngramCache, idx: nx_int) -> *NxEngramEntry
49func nx_eg_cache_new(capacity: nx_int) -> *NxEngramCache
called by 1: main calls 1: sys_mmap
60func nx_eg_find(c: *NxEngramCache, key_hash: nx_size) -> *NxEngramEntry
71func nx_eg_insert(c: *NxEngramCache,
called by 1: main calls 2: nx_eg_find_eg_at
103func nx_eg_lookup(c: *NxEngramCache,
called by 1: main calls 1: nx_eg_find
117func nx_eg_value_of(c: *NxEngramCache, key_hash: nx_size) -> nx_size
called by 1: main calls 1: nx_eg_find
124func nx_eg_should_consolidate(c: *NxEngramCache, key_hash: nx_size) -> nx_int
called by 1: main calls 1: nx_eg_find