code wiki / _hdl_build / nx_softtissue_conserve_gate.nx

nx_softtissue_conserve_gate.nx

buildroot/runtime/_hdl_build/nx_softtissue_conserve_gate.nx

13333 B269 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic softtissue
docsdependenciesstructsconstsfunctions

about

nx_softtissue_conserve_gate.nx -- CONSERVATION + DISSIPATION SEAT (metrology council member 6), 2026-08-03. Sibling of nx_softtissue_mr_gate (member 2) and DELIBERATELY DISJOINT FROM IT: member 2 asks whether the solver respects symmetries, this one asks whether it respects ENERGY AND VOLUME. A wrong dynamics can be perfectly equivariant -- that is member 2's declared blind spot, and this is the member that covers it. Per the council's own rule, a seat earns its place by covering a blind spot no other member can see, never by raising the seat count. REGIME SPLIT, which is the whole point (conservation is the WRONG invariant for soft tissue): RIGID/AUTONOMOUS regime -> a damped solver with no input must reach a FIXED POINT and stay there. SOFT/OCCLUDED regime -> volume (here: ring cross-section area) is the conserved quantity, and it must be conserved AT EVERY INDENTATION DEPTH, not at one tuned depth. ★THE EXACT INVARIANT THIS SEAT IS BUILT ON, chosen to need NO tolerance and NO oracle: an autonomous damped INTEGER solver must converge to a BIT-IDENTICAL FIXED POINT. Integer arithmetic makes this decidable in a way float never could: "at rest" is not "small", it is state[t+1] == state[t] byte for byte, and it must then HOLD. A solver that never freezes is either injecting energy or grinding in a truncation limit cycle -- both are real defects, both invisible to every symmetry relation in member 2. T1 SD FIXED POINT kicked 3-pt solver freezes exactly, and HOLDS T2 SD BITE undamped (C=0) must NOT freeze -- proves T1's detector can fail T3 SR FIXED POINT perturbed 48-node region freezes exactly, and HOLDS T4 SR BITE undamped region (damp=0) must NOT freeze T5 SR GRAVITY REST under load the region still reaches a fixed point (sag equilibrium) T6 AREA CONSERVATION cross-section area within band of rest at EVERY indentation depth T7 AREA BITE voldist=0 (occlusion law OFF) must LEAVE the band -- proves T6 can fail T8 BULGE MONOTONIC deeper indentation never produces a smaller far-side bulge license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_softbind.nx nx_softbody_region.nx nx_gate_verdict.nx nx_softtissue_conserve_gate.nx

imports: nx_syscalls.nxnx_softbind.nxnx_softbody_region.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write cg_freeze_sd sb_alloc sd_alloc sys_mmap ↻ sb_seat_mob sd_seat sb_offy sb_impulse_mob sd_impulse sys_mmap ↻ cg_snap sb_tick_pt sd_step sd_isqrt sd_deadsnap sd_abs sb_offy ↻ cg_same gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_check gv_puts ↻ gv_bite gv_puts ↻ cg_freeze_sr sys_mmap ↻ sr_bytes sr_init sr_hdr sr_param sr_hdr ↻

structs

none

consts

34const CG_SD_WORDS: i64 = 18 // SB_PTS(3) * stride(6)
35const CG_SD_STRIDE: i64 = 6
36const CG_RING_N: i64 = 16
37const CG_RING_R: i64 = 800
38const CG_SR_WORDS: i64 = 256 // CG_RING_N * 16 slots per node
39const CG_LONG: i64 = 20000 // generous convergence budget
40const CG_HOLD: i64 = 500 // a fixed point must HOLD, not just occur once
41const CG_SETTLE: i64 = 400 // ticks for an indentation to reach steady state
44const CG_K: i64 = 60
45const CG_C: i64 = 100
46const CG_MAXD: i64 = 64
47const CG_KICK: i64 = 400
50const CG_P_DAMP: i64 = 7
51const CG_P_GMULY: i64 = 9
52const CG_P_VOLDIST: i64 = 12
53const CG_DAMP_DEF: i64 = 30
54const CG_CAPR: i64 = 350
55const CG_CAPHALF: i64 = 400
56const CG_PERTURB: i64 = 200
66const CG_AREA_REST: i64 = 100

functions

68func cg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
69func cg_isqrt(v: i64) -> i64 { if v <= 0 { return 0 } var x: i64 = v; var y: i64 = (x+1)/2; while y < x { x = y; y = (x + v/x)/2 } return x }
called by 1: cg_bulge
70func cg_snap(src: *i64, dst: *i64, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[i] = src[i]; i = i + 1 } return 0 }
71func cg_same(a: *i64, b: *i64, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
75func cg_freeze_sd(K: i64, C: i64) -> i64
99func cg_freeze_sr(damp: i64, gmuly: i64) -> i64
128func cg_area_pct(depth: i64, voldist: i64) -> i64
147func cg_bulge(depth: i64) -> i64
164func main() -> i64