code wiki / (root) / nx_canon_solver.nx

nx_canon_solver.nx

buildroot/runtime/nx_canon_solver.nx

8377 B198 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tooltopic canon
docsdependenciesstructsconstsfunctions

about

nx_canon_solver.nx -- ★B1a of the published plan (/world/procgen): the CANON → CONSTRAINT bridge, i.e. the canon's BEAUTY LINTER. Reads a body/face canon (P part headers + R control rings -- field semantics read FROM nx_body_gen.nx bg_parse_canon, the emitter that owns the format: P <mirror> <rotX> <ox> <oy> <oz> [mat] [rotZ] [rotY]; R <y> <x0> <z0> <a> <b>. This is the SECOND reader of that format -- extract a shared canon lib on the THIRD, per the rule of three), emits `part p<i> <ox> <oy> <oz> <r>` rows, appends a RULES file (an nx_part_solver conf referencing p<i> names: station/inside/clear/band/ratio -- the anatomical + beauty bands as DATA), solves, and reports per-part TYPED vs SOLVED deltas. nx_canon_solver <canon.dat> <rules.conf> Outcomes: exit 0 CLEAN (every delta 0 -- the typed canon already satisfies the rules) | exit 0 ADJUSTED (SOLVED with deltas>0: each delta is a NAMED lint finding and a writeback candidate) | exit 4 INCONSISTENT (rules unsatisfiable -- worst constraint named, never fabricated) | 3 parse | 1 io | 2 usage. Bilateral symmetry is BY CONSTRUCTION in the emitter (mirror=1 emits both sides), so the rules carry the OTHER relations: stations, containment, clearance, φ-band ratios between parts. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_part_solver_lib.nx nx_canon_solver.nx

imports: nx_syscalls.nxnx_part_solver_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ps_err sys_write ps_slen sys_exit sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close cs_parse sys_mmap ↻ ps_err ↻ cs_rdint ps_out sys_write ↻ ps_slen ↻ ps_outn sys_write ↻ sys_mmap ↻ cs_cats cs_catn sys_mmap ↻

structs

none

consts

17const CS_MAGIC_4096: i64 = 4096
19const CS_MAXP: i64 = 256

functions

22func cs_rdint(b: *u8, pos: *i64, end: i64) -> i64
called by 1: cs_parse
47func cs_parse(b: *u8, len: i64, tx: *i64, ty: *i64, tz: *i64, tr: *i64, tm: *i64, nring: *i64) -> i64
called by 1: main calls 3: sys_mmapps_errcs_rdint
93func cs_cats(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p }
called by 1: main
94func cs_catn(d: *u8, o: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
107func main(argc: i64, argv: *i64) -> i64