code wiki / (root) / nx_partloft_capture_t319.nx

nx_partloft_capture_t319.nx

buildroot/runtime/nx_partloft_capture_t319.nx

19314 B344 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_partloft_gate.nx -- THE LOFTED PART (nx_partloft_lib) HELD TO KNOWN ANSWERS (procgen PG59 / anatomy AN19, 2026-09-19). A straight cylinder of known radius decomposes into the genes the source's decompose_nurbs_handles would produce (centred skeleton, equal proportions, zero pitch, zero lateral drift, a unit-circle profile facing +x), recomposes to its own handles within the millimetre quantisation, evaluates as a cubic B-spline whose radius is constant around the ring and clamped to the end rows, and writes a WATERTIGHT NXMSH2 whose every directed edge has exactly one reverse twin. A bent part built from genes survives the decompose-recompose round trip in its pitch. The gene mutation is the identity at var = 0 (byte-identical genes), moves the radii at var = 1, keeps its pitch noise zero-mean, and is deterministic per seed. Surface coordinates (t, yaw, rad) land where apply_attach_transform's ray would: yaw 0 is straight down, a half turn is +y, rad 0 is the skeleton itself. NEG-CONTROLS: a cone must read as a cone (the decomposer discriminates radii), a shape the cubic cannot carry must be refused by name, and a face size that leaves no cap fan must be refused rather than floored. license_tier: ORIGINAL. No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_partloft_lib.nx nx_partloft_capture_t319.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_partloft_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr 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 ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap sys_mmap ↻ pg_tube pl_new sys_mmap ↻ pl_knots pl_decompose pl_rdiv sys_mmap ↻ pl_tangents pl_len3 vm_isqrt pl_rdiv ↻

structs

none

consts

16const PG_NU: i64 = 6
17const PG_NV: i64 = 8
18const PG_R: i64 = 200 // u10: a 20 mm radius
19const PG_LEN: i64 = 1000 // u10: a 100 mm part along +x
20const PG_CONE_END: i64 = 100
21const PG_PROP: i64 = 13107 // PL_FQ / 5 = 13107.2
22const PG_TOL_U10: i64 = 2
23const PG_TOL_PROF: i64 = 200 // Q16: the fixture octagon's own radial spread (141 for 141.42 at 45 deg) is 0.3 percent
24const PG_TOL_BASIS: i64 = 8
25const PG_TOL_RING: i64 = 3
26const PG_TOL_PROP: i64 = 80 // Q16: a ring centre rounded to 1 u10 on a 200 u10 segment is 0.5 percent
27const PG_RMIN_PERMIL: i64 = 850 // a periodic cubic through a regular octagon of radius R lies between 0.85 R and R
28const PG_PERMIL: i64 = 1000
29const PG_FACE: i64 = 100 // u10: a 10 mm face size
30const PG_NT_EXPECT: i64 = 220 // 11 rows x 10 ring points: 2*10*10 tube + 2*10 caps
31const PG_SS_EXPECT: i64 = 11
32const PG_KU4: i64 = 21845 // PL_FQ / 3
33const PG_KU5: i64 = 43690 // 2 PL_FQ / 3
34const PG_KV3: i64 = 17873 // 3 PL_FQ / 11
35const PG_KV14: i64 = 83409 // PL_FQ + 3 PL_FQ / 11
36const PG_THETA30: i64 = 2144 // VM_PI / 6
37const PG_TOL_THETA: i64 = 40 // about half a degree
38const PG_TOL_COS: i64 = 16 // Q16: the ray and its hit agree to a few milliradians
39const PG_SEED: i64 = 7
40const PG_LOAD_HDR: i64 = 16
41const PG_EDGE_W: i64 = 6
42const PG_MESH: *u8 = "/tmp/nx_partloft_gate.nxmesh"
43const PG_PART: *u8 = "/tmp/nx_partloft_gate.part"
44const PG_ABSENT: *u8 = "/tmp/nx_partloft_gate.absent"

functions

46func pg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
48func pg_tube(hnd: *i64, nu: i64, nv: i64, r0: i64, r1: i64, len: i64) -> i64
called by 1: main
65func pg_max_hnd_err(a: *i64, b: *i64, n: i64) -> i64
called by 1: main calls 1: pg_abs
71func pg_sum_absdiff(a: *i64, b: *i64, n: i64) -> i64
called by 2: pg_gene_diffmain calls 1: pg_abs
78func pg_gene_diff(a: *PlPart, b: *PlPart) -> i64
called by 1: main calls 2: pg_sum_absdiffpg_abs
86func pg_near(ax: i64, ay: i64, az: i64, bx: i64, by: i64, bz: i64) -> i64
called by 1: pg_watertight calls 1: pg_abs
94func pg_watertight(path: *u8, rep: *i64) -> i64
150func main(argc: i64, argv: *i64) -> i64