code wiki / _hdl_build / nx_facemark.nx
nx_facemark.nx
buildroot/runtime/_hdl_build/nx_facemark.nx
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
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
structs
| none |
consts
| 24 | const FM_M8388607: i64 = 8388607 |
| 25 | const FM_M8388608: i64 = 8388608 |
| 26 | const FM_HDR: i64 = 16 |
| 27 | const FM_LAYENT: i64 = 24 |
| 28 | const FM_TRI: i64 = 84 |
| 29 | const FM_LID: i64 = 4 |
| 41 | const FM_NB: i64 = 96 |
| 42 | const FM_MAXEX: i64 = 64 |
| 43 | const FM_PERMIL: i64 = 1000 |
| 44 | const FM_MM: i64 = 1000 |
| 45 | const FM_MIDDIV: i64 = 48 |
| 46 | const FM_SWING: i64 = 28 |
| 47 | const FM_NF_MULT: i64 = 2 |
| 48 | const FM_NF_FLOOR: i64 = 4 |
| 56 | const FM_LANES: i64 = 5 |
| 57 | const FM_LANESTEP: i64 = 10 |
| 58 | const FM_LANEMID: i64 = 2 |
| 59 | const FM_TOL: i64 = 55 |
| 60 | const FM_SCRATCH: i64 = 4096 |
| 61 | const FM_STATB: i64 = 160 |
| 64 | const FM_COV_FLOOR: i64 = 500 |
functions
| 66 | func 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 } |
| 71 | func fm_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 72 | func fm_rd32(b: *u8, o: i64) -> i64 |
| 75 | func fm_f32mul(b: *u8, o: i64, mul: i64) -> i64 |
| 88 | func fm_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 99 | func fm_profile_lane(path: *u8, prof: *i64, lane: i64) -> i64 |
| 169 | func fm_profile(path: *u8, prof: *i64) -> i64 |
| 178 | func fm_noisefloor(prof: *i64) -> i64 |
| 212 | func fm_extrema(prof: *i64, ex: *i64, ty: *i64) -> i64 |
| 258 | func fm_score(exA: *i64, tyA: *i64, nA: i64, exB: *i64, tyB: *i64, nB: i64, out: *i64) -> i64 |
| 296 | func fm_emit_prof(tag: *u8, prof: *i64, ex: *i64, ty: *i64, n: i64) -> i64 |
| 325 | func fm_cmp_lanes(oursp: *u8, orap: *u8) -> i64 |
| 373 | func fm_cmp(oursp: *u8, orap: *u8) -> i64 |
| 432 | func fm_f32of(v: i64) -> i64 called by 1: fm_mkfix |
| 441 | func fm_wr32(b: *u8, o: i64, v: i64) -> i64 called by 1: fm_mkfix |
| 448 | func fm_mkfix(path: *u8) -> i64 |
| 488 | func fm_gate() -> i64 |
| 621 | func main(argc: i64, argv: *i64) -> i64 |