code wiki / _hdl_build / nx_derm.nx

nx_derm.nx

buildroot/runtime/_hdl_build/nx_derm.nx

8430 B146 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_gate_verdict.nx nx_itoa_lib.nx nx_derm.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 dm_streq dm_gate gv_ctr sys_mmap gv_head gv_puts sys_write dm_skin gv_check gv_puts ↻ dm_stress dm_wrinkle 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 ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ dm_atoi dm_stress ↻ dm_puts dm_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num

structs

none

consts

25const DM_Q: i64 = 1000
26const DM_WRINK: i64 = 800
27const DM_MAXW: i64 = 400

functions

29func 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
34func dm_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
35func dm_streq(a: *u8, b: *u8) -> i64
called by 1: main
40func dm_atoi(s: *u8) -> i64
called by 1: main
48func dm_skin(muscle_r: i64, fat: i64) -> i64
called by 2: dm_gatemain
57func dm_stress(rest_r: i64, muscle_r: i64) -> i64
called by 2: dm_gatemain
63func dm_wrinkle(stress: i64) -> i64
called by 2: dm_gatemain
69func dm_gate() -> i64
124func main(argc: i64, argv: *i64) -> i64