code wiki / _hdl_build / nx_derm.nx
nx_derm.nx
buildroot/runtime/_hdl_build/nx_derm.nx
about
nx_derm.nx -- PIPELINE STAGE 4: SKIN AS AN ENVELOPE, computed from the layers beneath it.
The industry's fourth stage is "the final visible mesh acts as an envelope, calculating wrinkles and
stress maps based on the movement of the inner layers". An audit found ours was the opposite: an
INDEPENDENTLY EMITTED SHELL that merely happened to render outermost. Nothing about it was derived from
the muscle underneath, so nothing could wrinkle, stretch or slacken when the body moved -- the layer
stack had the right topology and the skin was not actually on top of anything.
★THE INVERSION THIS ORGAN MAKES: skin position is no longer authored, it is DERIVED. For each station
the skin sits at (muscle radius + fat thickness), so when nx_myo bulges a muscle the skin above it rises
BY CONSTRUCTION rather than by a second edit that has to be kept in sync. The envelope invariant --
skin can never sink beneath the muscle it covers -- is enforced arithmetically, not checked afterwards.
★AND THE PART THAT MAKES IT A SKIN RATHER THAN A BALLOON: STRESS. When the underlying surface shortens,
the skin over it has more area than it needs and must go somewhere: it slackens and WRINKLES. When the
surface lengthens, the skin is stretched taut and smooths out. So wrinkle amplitude is a function of
local COMPRESSION, which means wrinkles appear where a body actually creases and nowhere else.
nx_derm <muscle_r> <rest_muscle_r> <fat> -> the skin state over that muscle
nx_derm selftest
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
| 25 | const DM_Q: i64 = 1000 |
| 26 | const DM_WRINK: i64 = 800 |
| 27 | const DM_MAXW: i64 = 400 |
functions
| 29 | func dm_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 |
| 34 | func dm_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 35 | func dm_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 40 | func dm_atoi(s: *u8) -> i64 called by 1: main |
| 48 | func dm_skin(muscle_r: i64, fat: i64) -> i64 |
| 57 | func dm_stress(rest_r: i64, muscle_r: i64) -> i64 |
| 63 | func dm_wrinkle(stress: i64) -> i64 |
| 69 | func dm_gate() -> i64 |
| 124 | func main(argc: i64, argv: *i64) -> i64 |