code wiki / _hdl_build / nx_self_model_lint.nx
nx_self_model_lint.nx
buildroot/runtime/_hdl_build/nx_self_model_lint.nx
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
imports: nx_syscalls.nx
imported by: nx_cap_register.nx
structs
| none |
consts
| 10 | const SML_OK: i64 = 0 |
| 11 | const SML_BAD_LAYER: i64 = 1 // lay[i] outside [0, nlayers) -> the INVISIBLE-cap bug (uncounted/unprinted) |
| 12 | const SML_BAD_STATUS: i64 = 2 // st[i] not in {PLANNED=0, INFLIGHT=1, PROVEN=2} |
| 13 | const SML_DUP_INDEX: i64 = 3 // two caps share an index |
functions
| 16 | func sml_layer_valid(layer: i64, nlayers: i64) -> i64 { if layer < 0 { return 0 } if layer >= nlayers { return 0 } return 1 } |
| 17 | func sml_status_valid(status: i64) -> i64 { if status < 0 { return 0 } if status > 2 { return 0 } return 1 } called by 1: sml_check_cap |
| 20 | func sml_check_cap(layer: i64, status: i64, nlayers: i64) -> i64 called by 4: cr_can_registercr_refusal_reasonmainsml_registry_clean calls 2: sml_layer_validsml_status_valid |
| 27 | func sml_count_invisible(lays: *i64, n: i64, nlayers: i64) -> i64 |
| 34 | func sml_registry_clean(lays: *i64, sts: *i64, n: i64, nlayers: i64) -> i64 |
| 43 | func sml_code_label(c: i64) -> *u8 called by 1: main |