code wiki / _hdl_build / nx_headcrop.nx

nx_headcrop.nx

buildroot/runtime/_hdl_build/nx_headcrop.nx

13859 B325 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_headcrop.nx -- P1 FACE rung 1, THE INSTRUMENT (beyond-metahuman program). The face is the measured WORST region (head judge 227) but every judge so far scores it inside a WHOLE-BODY frame, where a head is a few percent of the pixels -- GX-48 proved a head-sized change moves a body-average by exactly zero. This organ crops an NXMSH2 to its own TOP y-band, so ours and the oracle can be benched HEAD-TO-HEAD at full render resolution by the existing nx_bodybench (its height-fit framing then normalises on the CROP's height = the head fills the frame). Band is per-mille of the mesh's OWN height => scale-invariant, works on any mesh, any species. A tri is kept only if ALL 3 verts are in the band (clean boundary); every count is DECLARED. nx_headcrop <in.nxmesh> <out.nxmesh> [lo_permil=870] [hi_permil=1000] nx_headcrop selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_itoa_lib.nx nx_headcrop.nx

imports: nx_gate_verdict.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main hc_streq hc_gate gv_ctr sys_mmap gv_head gv_puts sys_write hc_mktest hc_wr32 hc_f32of sys_openat_wr gv_check gv_puts ↻ hc_crop sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close hc_rd32 hc_f32mul hc_rd32 ↻ hc_wr32 ↻ sys_openat_wr ↻ sys_read_file ↻ hc_rd32 ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻

structs

none

consts

15const HC_MAGIC_8388607: i64 = 8388607
16const HC_MAGIC_8388608: i64 = 8388608
17const HC_HDR: i64 = 16
18const HC_LAYENT: i64 = 24
19const HC_TRI: i64 = 84
20const HC_LID: i64 = 4
21const HC_MAXLAY: i64 = 64
22const HC_PERMIL: i64 = 1000
23const HC_DEF_LO: i64 = 870
24const HC_DEF_HI: i64 = 1000
25const HC_MM: i64 = 1000
26const HC_MODE: i64 = 420
27const HC_SELFN: i64 = 12
28const HC_JBUF: i64 = 8192
29const HC_MAXBYTES: i64 = 268435456

functions

31func hc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1, s, n); return 0 }
called by 2: hc_emitmain
36func hc_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: hc_emit calls 1: nxi_out
37func hc_rd32(b: *u8, o: i64) -> i64
40func hc_wr32(b: *u8, o: i64, v: i64) -> i64
called by 2: hc_crophc_mktest
45func hc_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: hc_crop calls 1: hc_rd32
58func hc_streq(a: *u8, b: *u8) -> i64
called by 1: main
65func hc_atoi(s: *u8) -> i64
called by 1: main
72func hc_crop(inp: *u8, outp: *u8, lo: i64, hi: i64, outcnt: *i64) -> i64
192func hc_emit(inp: *u8, outp: *u8, lo: i64, hi: i64, c: *i64, rc: i64) -> i64
called by 1: main calls 2: hc_putshc_pn
212func hc_f32of(v: i64) -> i64
called by 1: hc_mktest
221func hc_mktest(path: *u8) -> i64
256func hc_gate() -> i64
304func main(argc: i64, argv: *i64) -> i64