code wiki / _hdl_build / nx_curviness_gate.nx

nx_curviness_gate.nx

buildroot/runtime/_hdl_build/nx_curviness_gate.nx

10497 B201 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_curviness_gate.nx -- GATE for aesthetictwin rung AT2 (outline curviness), the measure the published evidence prefers to the waist-to-hip ratio. THE DONE-RULE THIS GATE ANSWERS WAS WRITTEN INTO aesthetictwin.plan BEFORE ANY CODE, and it asks for exactly three things: that the metric ORDERS two silhouettes of equal waist-to-hip ratio and different curviness, that it is INVARIANT UNDER UNIFORM SCALE, and that a straight-sided silhouette reads zero. T4, T5 and T6 are those three. They are not paraphrased here from the implementation -- the implementation was corrected to meet them, because a first draft returned a per-row density that RISES when a body is merely smaller, and the pre-declared invariance requirement is what caught it. THE LOAD-BEARING TOOTH IS T4 AND T3 IS WHAT MAKES IT LOAD-BEARING. The gentle and sharp bodies are built with the SAME height, the SAME waist and the SAME hip -- so an identical waist-to-hip ratio, which T3 proves by measuring it with this organ's own narrowest and widest primitives. They differ only in WHERE the taper happens: the gentle body sweeps from hip to waist over its whole height, the sharp body pinches in over the middle half and runs straight above and below. A measure that is a ratio in disguise CANNOT separate them, because every input a ratio reads is identical. EVERY FIXTURE IS ASSEMBLED AT RUNTIME AND IN MEMORY, so this gate can never share a fixture with a production beat, and the widths are painted as an EXACT left-aligned run so the measured run length IS the width with no centring round-off. That is not cosmetic: the signal here is a total second difference of order 8 slope-units, and a plus-or-minus-one quantisation per row would swamp it.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_anatomy_measure.nx nx_curviness_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_anatomy_measure.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 nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ cg_paint_body nx_image_set sys_mmap ↻ nx_mask_narrowest_y nx_mask_longest_run_at_y nx_image_get nx_mask_widest_y nx_mask_longest_run_at_y ↻ cg_pnum sys_mmap ↻ sys_write ↻ gk_len gv_check gv_puts ↻ am_outline_curvature sys_mmap ↻ nx_mask_longest_run_at_y ↻ gv_verdict gv_note_bare_rate gv_bare_rate

structs

none

consts

27const CG_ASCII0: i64 = 48
28const CG_MINUS: i64 = 45
29const CG_NL: i64 = 10
30const CG_INK: i64 = 255
31const CG_CANVAS_W: i64 = 420
32const CG_CANVAS_H: i64 = 120
33const CG_BODY_H: i64 = 100
34const CG_WAIST: i64 = 100
35const CG_HIP: i64 = 200
36const CG_SPAN_GENTLE: i64 = 50
37const CG_SPAN_SHARP: i64 = 25
38const CG_BIG_W: i64 = 520
39const CG_BIG_H: i64 = 220
40const CG_BIG_BODY_H: i64 = 200
41const CG_BIG_WAIST: i64 = 200
42const CG_BIG_HIP: i64 = 400
43const CG_BIG_SPAN: i64 = 100
44const CG_PAINT_X: i64 = 10
45const CG_SHIFT_X: i64 = 27
46const CG_RECT_W: i64 = 200
47const CG_RECT_H: i64 = 80
48const CG_RECT_BODY_H: i64 = 60
49const CG_RECT_WIDTH: i64 = 150
50const CG_SHORT_BAND: i64 = 3
51const CG_ORDER_MIN: i64 = 2
52const CG_TOL_DEN: i64 = 10

functions

54func cg_pnum(tag: *u8, v: i64) -> i64
called by 1: main calls 3: sys_mmapsys_writegk_len
82func cg_paint_body(img: *Image, bh: i64, waist: i64, hip: i64, span: i64, px: i64) -> i64
called by 1: main calls 1: nx_image_set
101func main(argc: i64, argv: *i64) -> i64