code wiki / _hdl_build / nx_facemark.nx

nx_facemark.nx

buildroot/runtime/_hdl_build/nx_facemark.nx

33115 B647 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_facemark.nx -- F1084 prereq 1: THE JUDGE THAT FAILS WRONG ANATOMY (beyond-metahuman program). WHY THIS EXISTS (measured, 2026-07-25): the detail judge scores LOCAL NORMAL VARIANCE and cannot ask whether that variance is anatomy, so a face carrying brow-flanges, a duckbill chin and no visible lips scored 357 against a cleaner face's 288. Three times now a variance-style judge has ranked wrong work above right work (FBM noise over a real render; a bell-shaped body over a good one; facial bumps over a clean face). A judge that counts busyness will always do this. So this one scores PLACEMENT. THE METHOD, purely mechanistic (no learned model, no rendering, no third-party): a human face read down its MIDLINE is a fixed sequence of alternating depth extrema -- brow(max) -> nasion(min) -> pronasale(max) -> subnasale(min) -> upper lip(max) -> mouth groove(min) -> lower lip(max) -> mentolabial(min) -> pogonion(max) Extract that profile straight from mesh geometry (per y-band, the most-forward vertex near the midline), find its extrema by prominence, and score ours against the oracle's on WHERE the features are. ANTI-SPAM IS THE POINT: the score multiplies recall (did we find the oracle's features, in the right places) by PRECISION (what fraction of OUR extrema correspond to a real one). A corrugated face full of bumps scores near zero because precision collapses -- which is exactly what the variance judge could not do. nx_facemark profile <mesh.nxmesh> -> the midline profile + detected extrema nx_facemark cmp <ours.nxmesh> <oracle.nxmesh> -> placement score + per-landmark table nx_facemark selftest -> gv gate 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_facemark.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 fm_streq fm_gate gv_ctr sys_mmap gv_head gv_puts sys_write fm_extrema fm_noisefloor gv_check gv_puts ↻ fm_score fm_noisefloor ↻ fm_profile fm_profile_lane sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close fm_rd32 fm_f32mul fm_rd32 ↻ fm_mkfix fm_wr32 fm_f32of sys_openat_wr fm_profile_lane ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn

structs

none

consts

24const FM_M8388607: i64 = 8388607
25const FM_M8388608: i64 = 8388608
26const FM_HDR: i64 = 16
27const FM_LAYENT: i64 = 24
28const FM_TRI: i64 = 84
29const FM_LID: i64 = 4
41const FM_NB: i64 = 96
42const FM_MAXEX: i64 = 64
43const FM_PERMIL: i64 = 1000
44const FM_MM: i64 = 1000
45const FM_MIDDIV: i64 = 48
46const FM_SWING: i64 = 28
47const FM_NF_MULT: i64 = 2
48const FM_NF_FLOOR: i64 = 4
56const FM_LANES: i64 = 5
57const FM_LANESTEP: i64 = 10
58const FM_LANEMID: i64 = 2
59const FM_TOL: i64 = 55
60const FM_SCRATCH: i64 = 4096
61const FM_STATB: i64 = 160
64const FM_COV_FLOOR: i64 = 500

functions

66func fm_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1, s, n); return 0 }
71func fm_pn(v: i64) -> i64 { nxi_out(v); return 0 }
72func fm_rd32(b: *u8, o: i64) -> i64
75func fm_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: fm_profile_lane calls 1: fm_rd32
88func fm_streq(a: *u8, b: *u8) -> i64
called by 1: main
99func fm_profile_lane(path: *u8, prof: *i64, lane: i64) -> i64
169func fm_profile(path: *u8, prof: *i64) -> i64
called by 3: fm_cmpfm_gatemain calls 1: fm_profile_lane
178func fm_noisefloor(prof: *i64) -> i64
212func fm_extrema(prof: *i64, ex: *i64, ty: *i64) -> i64
258func fm_score(exA: *i64, tyA: *i64, nA: i64, exB: *i64, tyB: *i64, nB: i64, out: *i64) -> i64
296func fm_emit_prof(tag: *u8, prof: *i64, ex: *i64, ty: *i64, n: i64) -> i64
325func fm_cmp_lanes(oursp: *u8, orap: *u8) -> i64
373func fm_cmp(oursp: *u8, orap: *u8) -> i64
432func fm_f32of(v: i64) -> i64
called by 1: fm_mkfix
441func fm_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: fm_mkfix
448func fm_mkfix(path: *u8) -> i64
488func fm_gate() -> i64
621func main(argc: i64, argv: *i64) -> i64