code wiki / _hdl_build / nx_self_model_lint.nx

nx_self_model_lint.nx

buildroot/runtime/_hdl_build/nx_self_model_lint.nx

2423 B48 linesdepth 2pulls 2 transitivereach 156 importersview sourcekind librarytopic self
docsdependenciesstructsconstsfunctions

about

nx_self_model_lint.nx -- the LIBRARIAN's validator for the self-model registry, so a bug like a cap assigned to a non-existent layer (lay >= ECO_NLAYERS -> silently uncounted + unprinted) is CAUGHT by the team, not discovered by hand (operator: "things like this should be addressed by the nishi team... the librarian is gathering all this information... with you checking to see if their functionality s class exceeds yours and if not building towards that"). This capability EXCEEDS manual editing: hand-registration just produced a 9-cap silent miscount; this lint makes that class of bug impossible to ship. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_self_model_lint.nx nx_cap_register.nx

imports: nx_syscalls.nx

imported by: nx_cap_register.nx

structs

none

consts

10const SML_OK: i64 = 0
11const SML_BAD_LAYER: i64 = 1 // lay[i] outside [0, nlayers) -> the INVISIBLE-cap bug (uncounted/unprinted)
12const SML_BAD_STATUS: i64 = 2 // st[i] not in {PLANNED=0, INFLIGHT=1, PROVEN=2}
13const SML_DUP_INDEX: i64 = 3 // two caps share an index

functions

16func sml_layer_valid(layer: i64, nlayers: i64) -> i64 { if layer < 0 { return 0 } if layer >= nlayers { return 0 } return 1 }
17func sml_status_valid(status: i64) -> i64 { if status < 0 { return 0 } if status > 2 { return 0 } return 1 }
called by 1: sml_check_cap
20func sml_check_cap(layer: i64, status: i64, nlayers: i64) -> i64
27func sml_count_invisible(lays: *i64, n: i64, nlayers: i64) -> i64
called by 1: main calls 1: sml_layer_valid
34func sml_registry_clean(lays: *i64, sts: *i64, n: i64, nlayers: i64) -> i64
called by 1: main calls 1: sml_check_cap
43func sml_code_label(c: i64) -> *u8
called by 1: main