nx_int Struct-Field Offset MiscompileRoot cause, minimal repro, validated fix — and the sovereign objective-beauty measuring suite restored to green. 2026-07-21
verdict: NOT_YET_EVALUATED and never compiled+run. Compiling their self-tests against today’s nx_cc exposed a foundational codegen bug: struct fields declared with the nx_int type alias are laid out as size-0, so field offsets collapse. This produced a SIGSEGV in nx_landmark_anatomy. Root-caused with a minimal repro, fixed on the path, and the full measuring suite is now 6/6 green with no regressions.A complete sovereign objective_beauty pipeline exists in runtime/:
PNG → nx_png_decode → skin mask (nx_color_v2) → nx_segmenter_connected → nx_landmark_anatomy_label (head/torso/arm/leg bboxes) → nx_anatomy_measure_body (eye/face/bust/waist/hip/shoulder axes) → nx_beauty_score(canon) (φ/Loomis/Vitruvian/linear → S/A/B verdict) + nx_symmetry_group (7-axis symmetry report)
Minimal repro runtime/_hdl_build/nx_segfield_repro.nx — identical struct shapes, only the field type varies:
| Case | Struct field layout | Result |
|---|---|---|
| i64 fields | {n:i64, p:*T, w:i64} | offset 0 correct |
| nx_int fields | {n:nx_int, p:*T, w:nx_int} | pointer lands on offset 0 |
| all-nx_int | {a,b,c: nx_int} | every field at offset 0 |
| pointer-first | {p:*T, n:nx_int} | survives |
Mechanism: nx_int (an alias for i64) is treated as size 0 during struct layout, so any field following it collapses onto the wrong offset. The hand-written Image struct always worked precisely because it uses i64 fields with the pointer first.
Declare the affected struct fields as concrete i64. Fixed 5 structs + a separate Sobel border false-edge in nx_aesthetics_sharpness (uniform image was scoring non-zero).
| Organ | Before | After |
|---|---|---|
| nx_landmark_anatomy | SIGSEGV (139) | pass |
| nx_segmenter_classical | untested | pass |
| nx_symmetry_group_test | exit 1 | pass |
| nx_aesthetics_test | exit 20 | pass |
| nx_beauty_score_test | pass | pass |
| nx_anatomy_measure_test | pass | pass |
=== SUITE: 6 pass / 0 fail ===
nx_int struct-field declarations across 337 runtime/*.nx files are exposed; rebuilding any of them risks the same corruption.nx_cc layout pass: resolve type-alias sizes before computing field offsets — fixes all 337 at once and preserves nx_int tier-swappability. Owned by the compiler lane as frontier F-CC-NXINT, tracked as debt seq521.i64.verdict: NOT_YET_EVALUATED has not been compiled+run — “it exists in runtime/” is unproven. Run its self-test against today’s compiler before building on it.Sovereign engineering record · Nishi ecosystem · filed to the information plane (knowledge/store/sota-), debt registry (seq521) and frontier RACI (F-CC-NXINT). Verifiable, reproducible, no regressions.