code wiki / _hdl_build / nx_consol_apply_mc.nx

nx_consol_apply_mc.nx

buildroot/runtime/_hdl_build/nx_consol_apply_mc.nx

8246 B170 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic consol
docsdependenciesstructsconstsfunctions

about

nx_consol_apply_mc.nx -- MULTI-CONSUMER consolidation applier (extends nx_consol_apply past the zero-importer soundness limit). To retire a shadow of a LIB that N organs import, rebuild EVERY importer + byte-compare each artifact before/after: CONSOLIDATED only if ALL importers are byte- identical (the retired copy was dead for all of them), else REFUSE + restore (never-brick). This is the COMPLETE behaviour-preservation proof for a multi-consumer shadow -- no consumer can silently change. Importers come from the atlas/funcmine importer histogram (a file, one target per line). argv: <shadow> <retire> <buildonly-elf> <importers-file> Artifact convention: buildonly writes /tmp/<importer>.sov.elf (BEFORE saved to /tmp/<importer>.mcbefore). exit: 0 CONSOLIDATED | 1 REFUSED (restored) | 2 usage/shadow-absent | 3 no buildable importer / move err license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_seat_drive_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_consol_apply_mc.nx

imports: nx_seat_drive_lib.nxnx_seg_store.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 mc_exists sys_openat_rd sys_close sys_mmap mc_read sys_openat_rd ↻ sys_read sys_close ↻ sd_cat mc_build_snap sys_unlinkat sys_mmap ↻ dep_run_capture sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit ↻ sys_wait4 mc_read ↻ ss_writefile sys_openat_wr ↻ sys_write ↻ sys_close ↻ sys_fsync sys_renameat mc_eq sd_num sys_mmap ↻

structs

none

consts

15const MC_MAGIC_1048576: i64 = 1048576
17const MC_CAP: i64 = 4194304
18const MC_MAXI: i64 = 512

functions

20func mc_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd >= 0 { sys_close(fd); return 1 } return 0 }
called by 1: main calls 2: sys_openat_rdsys_close
21func mc_read(path: *u8, buf: *u8, cap: i64) -> i64
30func mc_eq(a: *u8, an: i64, b: *u8, bn: i64) -> i64 { if an != bn { return 0 } var i: i64 = 0; while i < an { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
32func mc_build_snap(buildelf: *u8, tname: *u8, artpath: *u8, snappath: *u8, buf: *u8) -> i64
44func main(argc: i64, argv: *i64) -> i64