code wiki / (root) / nx_devpaint_gate.nx

nx_devpaint_gate.nx

buildroot/runtime/nx_devpaint_gate.nx

15542 B260 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_devpaint_gate.nx -- GATE for the derived-scale deviation heatmap and the two root defects it had to fix first (2026-08-26). THE TOOTH THAT MATTERED MOST IS THE ONE THE EXISTING GATES COULD NOT HAVE HAD. nx_mmdev_gate and nx_xport_gate both write their NXMSH2 fixtures through the SAME nx_nxmesh_lib constant they then read back, so the position-unit constant CANCELS and every round-trip tooth passes at any value of it. It passed at a value that was wrong by 1000x for every file a real producer writes, and the consequence was that nx_mmdev -- this estate's exact surface-deviation ruler -- refused every real mesh on its extent bound. So this gate decodes a LITERAL float32 BIT PATTERN that no writer here produced, and carries a neg-control showing the old constant would have refused a 1.594 m human body. The second root defect is the colour codec: nx_mesh2glb decoded a legal colour to zero, tripping its own bone fallback, so every painted heatmap emitted uniformly bone while the organ printed "per-tri colour carried". The neg-control below reproduces that exact expression and requires it to be wrong. license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_vecmath.nx nx_nxmesh_lib.nx nx_mmdev_lib.nx nx_devpaint_lib.nx nx_devpaint_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_vecmath.nxnx_nxmesh_lib.nxnx_mmdev_lib.nxnx_devpaint_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_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 ↻ gv_check gv_puts ↻ vm_f32_to_int gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap nm_col_bits vm_int_to_f32 nm_col_u8_of vm_f32_to_int ↻ nm_col_permil_of vm_f32_to_int ↻ dg_near sys_mmap ↻ dp_ramp dp_stop_r dp_stop_g dp_stop_b

structs

none

consts

25const DG_SIDE: i64 = 2000
26const DG_LIFT: i64 = 50
29const DG_SLACK: i64 = 1
32const DG_F32_1594MM: i64 = 1153908736
33const DG_EXPECT_1594: i64 = 15940 // 1594 mm in ruler units
34const DG_OLD_UNIT_PER_M: i64 = 10000 // the pre-fix multiplier, kept ONLY as a neg-control
35const DG_TEST_PERMIL: i64 = 900
36const DG_TEST_U8: i64 = 229 // 900 permille of 255, truncated
37const DG_CAND_TRIS: i64 = 3
45const DG_FLOOR_R: i64 = 100
46const DG_FLOOR_G: i64 = 850
47const DG_FLOOR_B: i64 = 150
48const DG_MID_R: i64 = 950
49const DG_MID_G: i64 = 550
50const DG_MID_B: i64 = 80
51const DG_TOP_R: i64 = 850
52const DG_TOP_G: i64 = 100
53const DG_TOP_B: i64 = 850

functions

55func dg_near(a: i64, b: i64, slack: i64) -> i64
called by 2: dg_col_ismain
63func dg_col_is(buf: *u8, tb: i64, t: i64, r: i64, g: i64, bl: i64) -> i64
called by 1: main calls 2: dg_nearnm_col_get
71func dg_ref(buf: *u8) -> i64
86func dg_cand(buf: *u8, lift: i64, corner_only: i64) -> i64
103func main() -> i64