code wiki / (root) / nx_substrate_layers.nx

nx_substrate_layers.nx

buildroot/runtime/nx_substrate_layers.nx

6040 B153 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic substrate
docsdependenciesstructsconstsfunctions

about

nx_substrate_layers.nx -- bits-up layer enum + handoff quality. User directive 2026-05-16: "from the bits to bytes up handoffs so we can get extreme precision on how capable we build out nishi lang". Cardinal feedback-bits-up-canonical-layer-no-reinventing already names the layer stack as an audit discipline ("audit L0(bits) -> L1(containers) -> L2(transforms) -> L3(algorithms)"). This file makes that stack a SEALED-ENUM PRIMITIVE so every substrate file can self-declare its layer + the coverage scanner can produce a bits-up roll-up that shows EVERY layer handoff. The six S-class substrate layers: L0 BITS raw i64 / u8 / pointer arithmetic; no containers L1 CONTAINERS *u8 buffer + length, NxArena, Image, NxTensor, NxStream -- typed shapes over L0 bits L2 TRANSFORMS nx_scale_*, nx_image_*, nx_hash_*, nx_pk_eq_ci -- pure functions over L1 containers L3 ALGORITHMS nx_aes, nx_sha3, nx_ssim, parse, codegen -- stateful or multi-step over L2 transforms L4 COMPOSITES racing primitives, capability audit, gauntlet -- orchestrators over L3 algorithms L5 SURFACES visualizer output, dashboards, CLI wrappers -- user-facing presentation over L4 composites Handoff quality (the precision-of-handoff axis the user named): CLEAN typed, no leakage, sealed-enum verdict DERIVED composed correctly, higher layer omits some typing LEAKY lower-layer details leak through (e.g., raw *i64 where *Image was canonical; the F-meta-4 syscall coupling) BROKEN handoff doesn't compile or has a known regression Per cardinal user-owns-every-bit: substrate carries the SEALED ENUMS (6 layers + 4 handoff verdicts). Which layers a particular user-built substrate slice exercises is caller-driven. nx_capability_claims:

dependencies 0 imports · 1 importers

nx_substrate_layers.nx nx_substrate_layers_test.nx

imports: none

imported by: nx_substrate_layers_test.nx

structs

none

consts

53const NX_LAYER_BITS: i64 = 0
54const NX_LAYER_CONTAINERS: i64 = 1
55const NX_LAYER_TRANSFORMS: i64 = 2
56const NX_LAYER_ALGORITHMS: i64 = 3
57const NX_LAYER_COMPOSITES: i64 = 4
58const NX_LAYER_SURFACES: i64 = 5
59const NX_LAYER_N: i64 = 6
112const NX_HANDOFF_CLEAN: i64 = 0
113const NX_HANDOFF_DERIVED: i64 = 1
114const NX_HANDOFF_LEAKY: i64 = 2
115const NX_HANDOFF_BROKEN: i64 = 3
116const NX_HANDOFF_N: i64 = 4

functions

61func nx_layer_is_valid(L: i64) -> i64
called by 1: main
68func nx_layer_name(L: i64) -> *u8
called by 1: main
78func nx_layer_name_len(L: i64) -> i64
89func nx_layer_tag(L: i64) -> *u8
called by 1: main
100func nx_layer_parse_tag(buf: *u8, n: i64) -> i64
called by 1: main
118func nx_handoff_is_valid(H: i64) -> i64
124func nx_handoff_name(H: i64) -> *u8
called by 1: main
132func nx_handoff_name_len(H: i64) -> i64
142func nx_handoff_severity(H: i64) -> i64
called by 1: main calls 1: nx_handoff_is_valid
149func nx_handoff_is_sss_gating(H: i64) -> i64
called by 1: main