code wiki / (root) / nx_stress_test.nx

nx_stress_test.nx

buildroot/runtime/nx_stress_test.nx

3268 B86 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_stress_test.nx -- stress = force/area + per-material yield classification against hand-computed reference cases. All Q14 throughout (force in Q14 N, area in Q14 m²). σ_Pa = F_q14 / A_q14 since Q14 cancels in the ratio. Closed-form invariants: (a) Zero force on unit area: σ = 0 Pa. (b) 100 N on 1 m² = 100 Pa. F_q14 = 100 * 16384, A_q14 = 16384 → σ = 100*16384/16384 = 100 Pa. (c) 100 N on 0.001 m² = 100000 Pa = 100 kPa. (d) Zero area returns NULL (defensive). (e) PLA yield = 50 MPa = 50000000 Pa. (f) PEEK yield = 95 MPa, ultimate = 100 MPa. (g) 25 MPa on PLA -> SAFE (< 50/2 = 25 MPa). Actually 25 == yield/2 boundary; classifier uses `>=` so this is exactly WORKING. Let me use 24 MPa for SAFE. (h) 30 MPa on PLA -> WORKING (>= 25, < 50). (i) 50 MPa on PLA -> YIELDED. (j) 70 MPa on PLA -> FRACTURED (>= 65 ultimate). (k) Unknown material class (99) -> UNKNOWN_MAT verdict. (l) MPa conversion: 50000000 Pa -> 50 MPa. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_material_profile.nx nx_stress.nx nx_stress_test.nx

imports: nx_syscalls.nxnx_material_profile.nxnx_stress.nx

imported by: nobody (leaf or entry point)

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

main nx_stress_from_force_area nx_stress_new sys_mmap nx_stress_yield_pa nx_stress_ultimate_pa nx_stress_new ↻ nx_stress_classify nx_stress_yield_pa ↻ nx_stress_ultimate_pa ↻ nx_abs nx_stress_to_mpa

structs

none

consts

32const Q14: i64 = 16384

functions

34func main() -> i64