code wiki / _hdl_build / nx_creatorfit.nx
nx_creatorfit.nx
buildroot/runtime/_hdl_build/nx_creatorfit.nx
about
nx_creatorfit.nx -- ★★★CREATOR: THE INVERSE LOOP. Everything else in this programme runs FORWARD --
parameters and a seed produce a body. This runs BACKWARD: given a body, recover the parameters that
would have produced it. That inversion is the whole difference between generating *a* person and
twinning *this* person, and it is the step a scan-based model cannot offer at all, because a scan has
no parameters to solve for -- only vertices.
★★WHY THE PROCEDURAL BASIS IS THE RIGHT THING TO FIT, and it is not a consolation prize. The search
space is a few dozen anatomically meaningful integers, and **it cannot express an anatomically
impossible human** -- so the fit physically cannot chase noise into a body that could not exist. Free-form
mesh deformation can, and does: it will happily fit a scanning artifact by growing a spike. Every point
this optimiser can reach is a body the generator would have been willing to emit unprompted.
The measured stakes (SOTA, July 2026): a scan-free parametric model fits a real subject to ~2.4mm, against
~1.8mm for a model trained on six hundred thousand scans. A ~0.6mm penalty for owning your own generator.
★★★COMPOSITION, NOT REIMPLEMENTATION -- the design constraint that shaped this organ. A fitter needs to
(a) build a candidate body and (b) measure it. Both already exist as proven organs, so this one FORKS
them: nx_body_proc -> canon, nx_body_gen -> mesh, nx_twinbench rms -> one integer of error. It carries
NO copy of the canon rules and NO copy of the distance metric. A fitter with its own metric is a fitter
that can score beautifully against a ruler nobody else agrees with, and the two copies drift the moment
either is improved.
★★THE TOOTH THAT GATES EVERYTHING: SYNTHETIC RECOVERY. Before this may be pointed at a person it must be
pointed at a body whose parameters are already KNOWN -- generate a target from a chosen vector, hide the
vector, and demand the optimiser find it. Anything else is unfalsifiable: on a real subject there is no
answer key, so a broken optimiser and a working one both produce "a number that went down".
nx_creatorfit probe <target.nxmesh> <sex> <build> <musc> -> rms error of one candidate, micrometres
nx_creatorfit fit <target.nxmesh> -> recovered vector, coarse-to-fine
nx_creatorfit selftest
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 1 imports · 0 importers
imports: nx_gate_verdict.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
| 33 | const CF_STATURE: i64 = 1750 |
| 39 | const CF_RADIAL: i64 = 10 |
| 40 | const CF_SUB: i64 = 1 |
| 41 | const CF_RELIEF: i64 = 1000 |
| 42 | const CF_BIG: i64 = 4611686018427387903 |
| 45 | const CF_KNOBS: i64 = 3 |
| 46 | const CF_LO: i64 = 0 |
| 47 | const CF_HI: i64 = 1000 |
| 49 | const CF_STEP0: i64 = 250 |
| 50 | const CF_PASSES: i64 = 4 |
| 51 | const CF_SAMPLES: i64 = 3000 |
| 52 | const CF_ARGBUF: i64 = 256 |
functions
| 54 | func cf_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 1: main |
| 55 | func cf_pn(v: i64) -> i64 called by 1: main |
| 64 | func cf_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 69 | func cf_atoi(s: *u8) -> i64 |
| 76 | func cf_itoa(v: i64, b: *u8) -> *u8 called by 1: cf_probe |
| 94 | func cf_run(path: *u8, a: *i64, nargs: i64) -> i64 |
| 120 | func cf_probe(target: *u8, sex: i64, build: i64, musc: i64, tmpc: *u8, tmpm: *u8) -> i64 |
| 178 | func cf_fit(target: *u8, out: *i64, tmpc: *u8, tmpm: *u8) -> i64 |
| 221 | func cf_gate() -> i64 |
| 271 | func main(argc: i64, argv: *i64) -> i64 |