nx_substrate_layers.nx
buildroot/runtime/nx_substrate_layers.nx
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
imports: none
imported by: nx_substrate_layers_test.nx
structs
| none |
consts
| 53 | const NX_LAYER_BITS: i64 = 0 |
| 54 | const NX_LAYER_CONTAINERS: i64 = 1 |
| 55 | const NX_LAYER_TRANSFORMS: i64 = 2 |
| 56 | const NX_LAYER_ALGORITHMS: i64 = 3 |
| 57 | const NX_LAYER_COMPOSITES: i64 = 4 |
| 58 | const NX_LAYER_SURFACES: i64 = 5 |
| 59 | const NX_LAYER_N: i64 = 6 |
| 112 | const NX_HANDOFF_CLEAN: i64 = 0 |
| 113 | const NX_HANDOFF_DERIVED: i64 = 1 |
| 114 | const NX_HANDOFF_LEAKY: i64 = 2 |
| 115 | const NX_HANDOFF_BROKEN: i64 = 3 |
| 116 | const NX_HANDOFF_N: i64 = 4 |
functions
| 61 | func nx_layer_is_valid(L: i64) -> i64 called by 1: main |
| 68 | func nx_layer_name(L: i64) -> *u8 called by 1: main |
| 78 | func nx_layer_name_len(L: i64) -> i64 |
| 89 | func nx_layer_tag(L: i64) -> *u8 called by 1: main |
| 100 | func nx_layer_parse_tag(buf: *u8, n: i64) -> i64 called by 1: main |
| 118 | func nx_handoff_is_valid(H: i64) -> i64 |
| 124 | func nx_handoff_name(H: i64) -> *u8 called by 1: main |
| 132 | func nx_handoff_name_len(H: i64) -> i64 |
| 142 | func nx_handoff_severity(H: i64) -> i64 |
| 149 | func nx_handoff_is_sss_gating(H: i64) -> i64 called by 1: main |