code wiki / _hdl_build / nx_tissue.nx

nx_tissue.nx

buildroot/runtime/_hdl_build/nx_tissue.nx

13734 B312 linesdepth 3pulls 4 transitivereach 14 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_tissue.nx -- PIPELINE STAGE 3: FASCIA + FAT AS SOFT BODY, bridging muscle to skin. The industry pipeline is skeleton -> muscle -> fascia/fat -> skin, and an audit of our own stack found we had that pipeline's SHAPE and almost none of its PHYSICS: "fat" was a scalar knob attenuating how much muscle relief reached the skin. Nothing lagged, nothing settled, nothing was driven by the layer beneath. It also found that the solver had been built and gated months earlier and NEVER WIRED IN: runtime/ nx_softdyn.nx is a spring-damper soft body whose stability envelope is enforced BY CONSTRUCTION (past a damping threshold semi-implicit Euler inverts and amplifies velocity, so SD_CAPC/SD_CAPK make an unstable configuration impossible to REQUEST rather than merely discouraged). It shipped with no soft-tissue geometry to bind to. The layer emitter now emits muscle and fat layers, so this organ is the wiring. THE BINDING, and it is what makes this stage 3 rather than just re-running a solver: a LAYER-AWARE LATTICE. Solver points are seated on a coarse band lattice over the figure; every vertex is displaced by its band's point SCALED BY THE SOFTNESS OF ITS OWN LAYER. Bone scales to ZERO and does not move at all; muscle moves partly; skin and fat move fully. That is fascia doing its actual job -- transmitting motion from the rigid thing inside to the soft thing outside, with each layer lagging by its own amount. nx_tissue <in.nxmesh> <out.nxmesh> [accel] [K] [C] [steps] nx_tissue selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 14 importers

nx_gate_verdict.nx nx_softdyn.nx nx_tissue.nx nx_chunk_paginate.nx nx_chunk_paginate_test.nx nx_ecosystem_compose_test.nx nx_game_engine_compose_test.nx nx_game_session_drive.nx nx_minecraft_mcu_compose_test.nx nx_pets_voxel_view.nx nx_raycast_voxel.nx nx_raycast_voxel_test.nx nx_substrate_compose_test.nx

diagram shows first 10 each side; +0 more imports, +4 more importers in the complete lists below.

imports: nx_gate_verdict.nxnx_softdyn.nx

imported by: nx_chunk_paginate.nxnx_chunk_paginate_test.nxnx_ecosystem_compose_test.nxnx_game_engine_compose_test.nxnx_game_session_drive.nxnx_minecraft_mcu_compose_test.nxnx_pets_voxel_view.nxnx_raycast_voxel.nxnx_raycast_voxel_test.nxnx_substrate_compose_test.nxnx_tissue_test.nxnx_voxel_native.nxnx_world_seed.nxnx_world_seed_test.nx

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

main ts_streq ts_gate gv_ctr sys_mmap gv_head gv_puts sys_write sd_alloc sys_mmap ↻ sd_seat sd_step sd_isqrt sd_deadsnap sd_abs sd_abs ↻ sd_disp_y gv_check gv_puts ↻ sd_energy ts_soft ts_run sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ts_rd32 ts_f32mul ts_rd32 ↻ sd_alloc ↻ sd_seat ↻ sd_step ↻ sd_abs ↻ sd_disp_y ↻ sd_energy ↻ ts_soft ↻ ts_wr32 ts_f32of

structs

none

consts

25const TS_M8388607: i64 = 8388607
26const TS_M8388608: i64 = 8388608
27const TS_HDR: i64 = 16
28const TS_LAYENT: i64 = 24
29const TS_TRI: i64 = 84
30const TS_LID: i64 = 4
31const TS_BANDS: i64 = 24
32const TS_MM: i64 = 1000
33const TS_MODE: i64 = 420
34const TS_MAXD: i64 = 40
35const TS_DEFK: i64 = 900
36const TS_DEFC: i64 = 260
37const TS_DEFA: i64 = 900
38const TS_STEPS: i64 = 40
39const TS_SCR: i64 = 4096

functions

41func ts_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
42func ts_pn(v: i64) -> i64
called by 1: main
51func ts_rd32(b: *u8, o: i64) -> i64
called by 2: ts_f32mults_run
54func ts_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: ts_run
58func ts_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: ts_run calls 1: ts_rd32
72func ts_f32of(v: i64) -> i64
called by 1: ts_run
84func ts_streq(a: *u8, b: *u8) -> i64
called by 1: main
89func ts_atoi(s: *u8) -> i64
called by 1: main
99func ts_soft(layer: i64) -> i64
called by 2: ts_runts_gate
106func ts_run(inp: *u8, outp: *u8, accel: i64, K: i64, C: i64, steps: i64, out: *i64) -> i64
211func ts_gate() -> i64
281func main(argc: i64, argv: *i64) -> i64