code wiki / _hdl_build / nx_softbody_region_gate.nx

nx_softbody_region_gate.nx

buildroot/runtime/_hdl_build/nx_softbody_region_gate.nx

10011 B224 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_softbody_region_gate.nx -- gate for the BODY-REGION soft physics + THE OCCLUSION LAW. T1 GRAVITY PARAM: gmul_y=0 -> ring holds its rest shape exactly-ish; gmul_y=256 -> the bottom node sags measurably = the TittyMagic-class gravity knob is REAL data. T2 THE OCCLUSION LAW (the operator's ask, measured): a capsule pressed into the RIGHT of the ring -> (a) contact nodes held near the collider surface, (b) the FAR (left) nodes BULGE OUTWARD beyond rest (displaced volume redistributed = physics beyond the visible contact area), (c) capsule removed -> the ring RECOVERS to rest (elastic, no permanent dent). T3 VOLUME PROXY: cross-section area with the capsule embedded stays >= 85% of rest area WITH voldist, and beats the voldist=0 control (the knob does the conserving). T4 PARAMS ARE DATA: mass 256 vs 1024 -> different response speed; colsoft 256 vs 64 -> different depth. T5 determinism: two regions, same script -> byte-identical node state. + PNG knowledge/nx_region_occlusion.png: rest ring vs embedded-capsule ring, the BULGE visible. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_png.nx nx_softbody_region.nx nx_softbody_region_gate.nx

imports: nx_syscalls.nxnx_png.nxnx_softbody_region.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sr_bytes sr_init sr_hdr sr_param sr_hdr ↻ sr_ring sys_mmap ↻ sr_add_node sr_hdr ↻ sr_node sr_hdr ↻ sr_node ↻ sr_isqrt sr_step sr_hdr ↻ sr_node ↻ sr_isqrt ↻ sr_cap gabs nodelen sr_hdr ↻ sr_pos sr_node ↻ isq sr_pos ↻ hw sys_write pn sys_mmap ↻ sys_write ↻ sr_area sr_hdr ↻ sr_node ↻ sr_add_capsule sr_hdr ↻ sr_cap ↻ sr_clear_capsules sr_hdr ↻

structs

none

consts

none

functions

18func hw(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 calls 1: sys_write
19func pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
31func gabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
32func isq(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: nodelen
33func nodelen(base: i64, i: i64) -> i64
called by 1: main calls 3: sr_hdrsr_posisq
40func plot(base: i64, fb: *i64, TW: i64, TH: i64, xoff: i64) -> i64
called by 1: main calls 3: sr_hdrsr_possr_cap
83func main() -> i64