code wiki / _hdl_build / nx_sharpgrade.nx
nx_sharpgrade.nx
buildroot/runtime/_hdl_build/nx_sharpgrade.nx
about
nx_sharpgrade.nx -- THE MATH PARTY of the small-sharp-tool grade (operator 2026-07-20: "linux small
sharp philosophy, thats really the grade... out-linux linux... three parties agree: you, the nishi
ecosystem, and the math"). Objective cohesion measure of ONE organ: does it do ONE thing (SHARP) or
several disjoint things that should SPLIT into separate small sharp tools?
THE MATH: parse the organ's functions, build the intra-organ CALL GRAPH, compute CONNECTED COMPONENTS
(union-find). 1 component = one cohesive responsibility = SHARP. K>1 components = K responsibilities.
Refine with VOCABULARY: a component split whose function-name PREFIXES are all one family (sd_*, st_*)
= a cohesive utility lib (SHARP-LIB, theme-cohesion); distinct prefix families across components =
genuinely separate tools = SPLIT-K (the nx_clock time-primitive-vs-scheduler defect, made computable).
Also EMITS the function inventory (name|prefix|component) = the mining-archive substrate (rule 13).
argv: <organ-source.nx>
verdict SHARP | SHARP-LIB | SPLIT-<k>. exit 0 always (a grade is data). Reproducible/deterministic.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_seat_drive_lib.nxnx_deploy_lib.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 18 | const SG_SRCCAP: i64 = 4194304 |
| 19 | const SG_MAXF: i64 = 512 |
functions
| 21 | func sg_isid(c: i64) -> i64 |
| 29 | func sg_find(parent: *i64, x: i64) -> i64 |
| 34 | func sg_union(parent: *i64, a: i64, b: i64) -> i64 |
| 42 | func sg_call_at(buf: *u8, p: i64, n: i64, name: *u8, no: i64, nl: i64) -> i64 |
| 51 | func sg_calls(buf: *u8, s: i64, e: i64, name: *u8, no: i64, nl: i64) -> i64 |
| 60 | func sg_preflen(name: *u8, no: i64, nl: i64) -> i64 called by 1: sg_pref_eq |
| 65 | func sg_pref_eq(name: *u8, ao: i64, al: i64, bo: i64, bl: i64) -> i64 |
| 74 | func main(argc: i64, argv: *i64) -> i64 |