code wiki / (root) / nx_supports_v2_test.nx

nx_supports_v2_test.nx

buildroot/runtime/nx_supports_v2_test.nx

4593 B120 linesdepth 11pulls 26 transitivereach 0 importersview sourcekind gate/prooftopic supports
docsdependenciesstructsconstsfunctions

about

nx_supports_v2_test.nx -- verify NxSupportPlan dedup + per-layer G-code emission for support pillars. Closed-form invariants: (a) plan_new returns plan with n=0 + correct capacity (b) add_pillar at fresh XY returns 0 (added) + plan.n == 1 (c) add_pillar at identical XY returns 1 (merged) + plan.n unchanged (d) merge extends top_z_q14 to max(old, new) (e) add_pillar at proximity-close XY (within spacing) merges (f) add_pillar at far XY adds new (plan.n == 2) (g) emit_layer at z below all pillars' tops emits all (h) emit_layer at z above all pillars' tops emits zero (i) emit output contains ";SUPPORT_START" + ";SUPPORT_END" markers (j) emit output contains "G1 X" perimeter moves (k) capacity exhausted returns -1 expect_exit: 0 license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_polygon.nx nx_machine_graph.nx nx_material_profile.nx nx_gcode_emit.nx nx_supports.nx nx_supports_v2_test.nx

imports: nx_syscalls.nxnx_polygon.nxnx_machine_graph.nxnx_material_profile.nxnx_gcode_emit.nxnx_supports.nx

imported by: nobody (leaf or entry point)

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

main nx_support_plan_new sys_mmap nx_support_plan_add_pillar nx_abs nx_machine_graph_qidi_xmax nx_machine_graph_alloc sys_mmap ↻ nx_material_profile_generi nx_material_profile_alloc sys_mmap ↻ nx_gemit_new sys_mmap ↻ nx_gcex_filament_xsect_q14 nx_muldiv_i64 nx_i128_alloc nx_i128_mul_i64 nx_i128_mul_u64 nx_i128_neg nx_i128_div_i64 nx_i128_is_neg nx_i128_neg ↻ nx_i128_udiv_u64 nx_support_plan_emit_layer nx_gemit_cstr nx_gemit_byte nx_polygon_make_square nx_polygon_alloc sys_mmap ↻ nx_polygon_add_vert nx_polygon_set_vert nx_polygon_vert_ptr nx_gemit_polygon nx_polygon_get_x nx_polygon_vert_ptr ↻ nx_polygon_get_y nx_polygon_vert_ptr ↻ nx_gemit_travel_to nx_gemit_retract nx_gemit_cstr ↻

structs

none

consts

27const Q14: i64 = 16384

functions

29func smoke_contains(buf: *u8, len: i64, needle: *u8) -> i64
called by 1: main
48func main() -> i64