code wiki / (root) / nx_presence_gate.nx

nx_presence_gate.nx

buildroot/runtime/nx_presence_gate.nx

6820 B174 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_presence_gate.nx -- REFEREE for MEDIA-STUDIO R2 (nx_presence). 64x64 RGB frames, neutral-gray background (128,128,128), skin = (200,120,90). PERSON : a 32x32 skin blob -> high skin + high concentration -> PRESENT. EMPTY : bare gray room -> ~0 skin -> ABSENT. OBJECT : a 32x32 BLUE block (40,80,200) moving in -> not skin -> ABSENT. (operator's case: something moving but NOT a person = dead air.) SCATTER : the SAME number of skin pixels as PERSON, sprinkled across the whole frame. NEG-CONTROL: equal skin fraction but low concentration -> ABSENT. Proves presence needs a coherent blob, not merely skin-coloured pixels (metric != raw skin count). Plus unit checks of the skin classifier on known colours. Every measured value PRINTED. stdout + knowledge/status/presence_gate.log. Exit 0 GREEN / 1 RED. Sovereign: syscalls + nx_image + nx_presence. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

syscalls.nx nx_image.nx nx_presence.nx nx_presence_gate.nx

imports: syscalls.nxnx_image.nxnx_presence.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_append gp gn nx_image_alloc sys_mmap fill_rgb nx_image_set block_rgb nx_image_set ↻ scatter_skin nx_image_set ↻ nx_presence_scan nx_image_get nx_skin_is_pixel nx_presence_classify report gp ↻ gn ↻ nx_skin_is_pixel ↻

structs

none

consts

21const W: i64 = 64
22const H: i64 = 64
23const MIN_SKIN: i64 = 50
24const MIN_CONC: i64 = 500

functions

26func gp(logfd: i64, s: *u8) -> i64
called by 2: reportmain
33func gn(logfd: i64, v: i64) -> i64
called by 2: reportmain
48func fill_rgb(img: *Image, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 1: nx_image_set
62func block_rgb(img: *Image, x0: i64, y0: i64, bw: i64, bh: i64, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 1: nx_image_set
77func scatter_skin(img: *Image, count: i64, seed: i64) -> i64
called by 1: main calls 1: nx_image_set
93func report(logfd: i64, label: *u8, o: *i64, cls: i64) -> i64
called by 1: main calls 2: gpgn
104func main() -> i64