code wiki / (root) / nx_curveskel_gate.nx

nx_curveskel_gate.nx

buildroot/runtime/nx_curveskel_gate.nx

17104 B323 linesdepth 6pulls 14 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_curveskel_gate.nx -- THE REFEREE FOR SKELETON-FIT: a curve skeleton extracted from a BARE mesh must SPAN the shape's extremities, peel the right number of limbs (a linear volume = two, forking once at its thick centre; a T = three, with a real fork joint), carry a valid single-rooted tree, reflect thickness in its root radius, be byte-deterministic, and REFUSE a volumeless sheet by name. Linear fixtures are axis-aligned square PRISMS built at run time under /tmp/nx_curveskel_gate (the same sealable shape nx_boneheat_gate uses, so the voxel seal is isolated from the skeleton logic). The BRANCHED fixture is a watertight T extracted by nx_csg from the UNION of two box SDFs (a stem and a crossbar) -- a boolean union has no internal walls, which two overlapping closed meshes would have, and marching tetrahedra over the field is watertight by construction. Every solve is IN-PROCESS through nx_curveskel_lib so a mutant of the lib is reached. license_tier: ORIGINAL expect_exit: 0

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_nxa.nx nx_curveskel_lib.nx nx_sdf.nx nx_csg.nx nx_curveskel_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_nxa.nxnx_curveskel_lib.nxnx_sdf.nxnx_csg.nx

imported by: nobody (leaf or entry point)

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

main 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_head gv_puts sys_write ↻ sys_mkdir sys_mmap ↻ cg_prism sys_mmap ↻ cg_ring_xy cg_tri cg_write sys_mmap ↻ nxa_tag4 bh_nxa_write sys_mmap ↻ nxa_check2 nxa_magic sys_openat_wr sys_write ↻ sys_close gv_check gv_puts ↻ cs_run cs_run_cells

structs

none

consts

18const CG_DIR: *u8 = "/tmp/nx_curveskel_gate"
19const CG_MODE_DIR: i64 = 493
20const CG_AROUND: i64 = 4
21const CG_LEN: i64 = 6000 // 60 mm prism
22const CG_RINGS: i64 = 61
23const CG_R_THIN: i64 = 300 // 3 mm half-width
24const CG_R_FAT: i64 = 700 // 7 mm half-width
25const CG_VERT_CAP: i64 = 2048
26const CG_TRI_CAP: i64 = 8192
27const CG_ROOT: i64 = 0 - 1
28const CG_SPAN_LO: i64 = 1200 // 20% of CG_LEN: a tip below this is near the z=0 end
29const CG_SPAN_HI: i64 = 4800 // 80% of CG_LEN: a tip above this is near the z=CG_LEN end
31const CG_MM_Q14: i64 = 16384
32const CG_NXA_PER_MM: i64 = 100
33const CG_TEE_STEM_HX: i64 = 3 // mm half-extents: stem 6 mm square, 30 mm tall
34const CG_TEE_STEM_HZ: i64 = 15
35const CG_TEE_STEM_CZ: i64 = 15
36const CG_TEE_BAR_HX: i64 = 15 // crossbar 30 mm wide, 6 mm tall, sitting on the stem
37const CG_TEE_BAR_HZ: i64 = 3
38const CG_TEE_BAR_CZ: i64 = 33
39const CG_TEE_LO_X: i64 = 0 - 16
40const CG_TEE_LO_Y: i64 = 0 - 4
41const CG_TEE_LO_Z: i64 = 0 - 1
42const CG_TEE_HI_X: i64 = 16
43const CG_TEE_HI_Y: i64 = 4
44const CG_TEE_HI_Z: i64 = 37
45const CG_TEE_RES: i64 = 40 // marching-tet grid: under 1 mm per cell on every axis of the 32 x 8 x 38 mm box
46const CG_TEE_SPAN_X: i64 = 1200 // 12 mm in NXA units: a joint past this on each side has reached the crossbar tips
47const CG_TEE_FOOT_Z: i64 = 300 // 3 mm: a joint below this has reached the stem foot
48const CG_TEE_LIMBS: i64 = 3

functions

50func cg_ring_xy(k: i64, r: i64, out: *i64) -> i64
called by 1: cg_prism
57func cg_tri(tris: *i64, st: *i64, a: i64, b: i64, c: i64) -> i64
called by 2: cg_prismcg_sheet
64func cg_prism(vert: *i64, tris: *i64, st: *i64, r: i64, z0: i64, z1: i64, rings: i64) -> i64
called by 1: main calls 3: sys_mmapcg_ring_xycg_tri
110func cg_sheet(vert: *i64, tris: *i64, st: *i64) -> i64
called by 1: main calls 1: cg_tri
121func cg_write(path: *u8, vert: *i64, tris: *i64, st: *i64) -> i64
called by 1: main calls 3: sys_mmapnxa_tag4bh_nxa_write
132func cg_tee(path: *u8, out: *i64) -> i64
164func cg_open(path: *u8, lp: *i64) -> i64
called by 1: main calls 1: sys_read_file
170func cg_nj(b: *u8, flen: i64) -> i64
called by 1: main calls 2: nxa_findnxa_tag4
176func cg_joint_word(b: *u8, flen: i64, j: i64, word: i64) -> i64
called by 1: main calls 2: nxa_findnxa_tag4
181func cg_files_equal(pa: *u8, pb: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
194func main() -> i64