nx_surface_plane_coherence.nx
buildroot/runtime/nx_surface_plane_coherence.nx
about
nx_surface_plane_coherence.nx -- Tier 6 floor=bed spatial-impossibility.
CAPABILITY_COMPLETENESS: FULL
User feedback 2026-05-16 (image #4 hint): "she is on the floor
and bed at the same time which is impossible." AI image-gen
often merges distinct horizontal surfaces (floor + bed-top +
table-top) into one plane at one height -- a body lying flat
across the image rests on what the AI labels as both floor and
mattress simultaneously, when physically a bed sits 18-24"
above the floor.
Substrate's check:
- Caller provides N surface records with kind + y-coordinate
(top edge of surface in image pixels)
- For each pair where kinds are DIFFERENT distinct horizontal
surfaces: |y_top_a - y_top_b| must exceed min_height_diff
- If two named-different surfaces appear at SAME height
(within tolerance): IMPLAUSIBLE_SAME_HEIGHT
Surface-kind taxonomy: FLOOR / BED_TOP / TABLE_TOP / CHAIR_SEAT
/ COUNTER_TOP / DESK_TOP / SHELF / WALL / CEILING / OTHER.
Pairs of HORIZONTAL surfaces (FLOOR / BED / TABLE / CHAIR /
COUNTER / DESK / SHELF) get the height-diff check. WALL/CEILING
are vertical/overhead; substrate skips them.
genealogy_id: substrate_surface_plane_coherence_2026_05_16
lineage_id: tier_6_spatial_impossibility_v1
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 91 | struct NxSurfaceRecord |
| 104 | struct NxSurfacePairViolation |
| 155 | struct NxSpcResult |
consts
| 33 | const NX_MAGIC_1920: i64 = 1920 |
| 34 | const NX_MAGIC_1080: i64 = 1080 |
| 36 | const NX_SPC_Q10: nx_int = 1024 |
| 40 | const NX_SURFACE_UNKNOWN: nx_int = 0 |
| 41 | const NX_SURFACE_FLOOR: nx_int = 1 |
| 42 | const NX_SURFACE_BED_TOP: nx_int = 2 |
| 43 | const NX_SURFACE_TABLE_TOP: nx_int = 3 |
| 44 | const NX_SURFACE_CHAIR_SEAT: nx_int = 4 |
| 45 | const NX_SURFACE_COUNTER_TOP: nx_int = 5 |
| 46 | const NX_SURFACE_DESK_TOP: nx_int = 6 |
| 47 | const NX_SURFACE_SHELF: nx_int = 7 |
| 48 | const NX_SURFACE_WALL: nx_int = 8 |
| 49 | const NX_SURFACE_CEILING: nx_int = 9 |
| 50 | const NX_SURFACE_OTHER: nx_int = 10 |
| 51 | const NX_SURFACE_N_KINDS: nx_int = 11 |
| 74 | const NX_SPC_VERDICT_COHERENT: nx_int = 0 |
| 75 | const NX_SPC_VERDICT_IMPLAUSIBLE_SAME_HEIGHT: nx_int = 1 |
| 76 | const NX_SPC_VERDICT_INVERTED_ORDER: nx_int = 2 // e.g. bed below floor |
| 77 | const NX_SPC_VERDICT_NO_HORIZONTAL_SURFACES: nx_int = 3 |
| 78 | const NX_SPC_VERDICT_MULTIPLE_FAILURES: nx_int = 4 |
| 82 | const NX_SPC_MAX_SURFACES: nx_int = 32 |
| 87 | const NX_SPC_DEFAULT_MIN_DIFF: nx_int = 40 |
| 100 | const NX_SURFACE_RECORD_BYTES: nx_size = 48 |
| 115 | const NX_SPC_PAIR_VIOLATION_BYTES: nx_size = 64 |
| 165 | const NX_SPC_RESULT_BYTES: nx_size = 56 |
functions
| 53 | func nx_surface_kind_is_valid(k: nx_int) -> nx_int |
| 61 | func _spc_is_horizontal(kind: nx_int) -> nx_int called by 1: nx_surface_plane_check |
| 127 | func _spc_expected_above(a: nx_int, b: nx_int) -> nx_int called by 1: nx_surface_plane_check |
| 169 | func nx_surface_plane_check( |
| 298 | func _spc_set_surface(arr: *NxSurfaceRecord, idx: nx_int, called by 1: main |
| 312 | func main() -> nx_int |