code wiki / _hdl_build / nx_depcycle.nx

nx_depcycle.nx

buildroot/runtime/_hdl_build/nx_depcycle.nx

11883 B298 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_depcycle.nx -- ACYCLIC DEPENDENCIES PRINCIPLE checker (industry SOTA, grounded in nishi research: corpus confirms Coupling / Cohesion / Dependency-inversion / Clean-architecture as the canon). Reads the ecosystem IMPORT GRAPH (the atlas edges) and finds circular dependencies: A imports B imports ... imports A. Cycles are the top structural smell -- organs in a cycle can't be built / understood / tested / reused independently, blocking modular OO design (Robert Martin, "Clean Architecture", ADP). Uses KAHN topological reduction (iterative, no recursion): repeatedly remove zero-in-degree nodes; whatever remains with in-degree>0 is trapped in a cycle = the ADP-violation set. Deterministic. argv: <dir> [dir2...] Report: CYCLENODE <basename> (each node still trapped after reduction), then NX-DEPCYCLE nodes=N edges=E cyclic=C verdict=ACYCLIC|CYCLIC-C exit 0 = ran. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_seat_drive_lib.nx nx_deploy_lib.nx nx_syscalls.nx nx_depcycle.nx

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

main sd_w sys_write sys_exit sys_mmap sys_openat_rd sys_getdents64 dirent_type dirent_name dc_ends_nx dc_intern dc_fnv dc_streq dirent_reclen sys_close dc_find dc_fnv ↻ dc_streq ↻ sys_read sys_write ↻ sd_num sys_mmap ↻

structs

none

consts

15const DC_MAGIC_262144: i64 = 262144
16const DC_MAGIC_1024: i64 = 1024
18const DC_MAXN: i64 = 30000
19const DC_MAXE: i64 = 200000
20const DC_NB: i64 = 65536
21const DC_NAMEBUF: i64 = 3145728
22const DC_FILECAP: i64 = 2097152
23const DC_FNV_OFF: i64 = 1469598103934665603
24const DC_FNV_PRIME: i64 = 1099511628211

functions

26func dc_isid(c: i64) -> i64
34func dc_ends_nx(nm: *u8) -> i64
called by 1: main
41func dc_fnv(buf: *u8, s: i64, e: i64) -> i64
called by 2: dc_interndc_find
57func dc_streq(buf: *u8, s: i64, l: i64, name: *u8, no: i64, nl: i64) -> i64
called by 2: dc_interndc_find
64func dc_intern(src: *u8, s: i64, e: i64) -> i64
called by 1: main calls 2: dc_fnvdc_streq
89func dc_find(src: *u8, s: i64, e: i64) -> i64
called by 1: main calls 2: dc_fnvdc_streq
101func main(argc: i64, argv: *i64) -> i64