code wiki / (root) / nx_surface_plane_coherence.nx

nx_surface_plane_coherence.nx

buildroot/runtime/nx_surface_plane_coherence.nx

14453 B376 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic surface
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_surface_plane_coherence.nx

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

main 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 ↻ _spc_set_surface nx_surface_plane_check sys_mmap ↻ _spc_is_horizontal _spc_expected_above

structs

91struct NxSurfaceRecord
104struct NxSurfacePairViolation
155struct NxSpcResult

consts

33const NX_MAGIC_1920: i64 = 1920
34const NX_MAGIC_1080: i64 = 1080
36const NX_SPC_Q10: nx_int = 1024
40const NX_SURFACE_UNKNOWN: nx_int = 0
41const NX_SURFACE_FLOOR: nx_int = 1
42const NX_SURFACE_BED_TOP: nx_int = 2
43const NX_SURFACE_TABLE_TOP: nx_int = 3
44const NX_SURFACE_CHAIR_SEAT: nx_int = 4
45const NX_SURFACE_COUNTER_TOP: nx_int = 5
46const NX_SURFACE_DESK_TOP: nx_int = 6
47const NX_SURFACE_SHELF: nx_int = 7
48const NX_SURFACE_WALL: nx_int = 8
49const NX_SURFACE_CEILING: nx_int = 9
50const NX_SURFACE_OTHER: nx_int = 10
51const NX_SURFACE_N_KINDS: nx_int = 11
74const NX_SPC_VERDICT_COHERENT: nx_int = 0
75const NX_SPC_VERDICT_IMPLAUSIBLE_SAME_HEIGHT: nx_int = 1
76const NX_SPC_VERDICT_INVERTED_ORDER: nx_int = 2 // e.g. bed below floor
77const NX_SPC_VERDICT_NO_HORIZONTAL_SURFACES: nx_int = 3
78const NX_SPC_VERDICT_MULTIPLE_FAILURES: nx_int = 4
82const NX_SPC_MAX_SURFACES: nx_int = 32
87const NX_SPC_DEFAULT_MIN_DIFF: nx_int = 40
100const NX_SURFACE_RECORD_BYTES: nx_size = 48
115const NX_SPC_PAIR_VIOLATION_BYTES: nx_size = 64
165const NX_SPC_RESULT_BYTES: nx_size = 56

functions

53func nx_surface_kind_is_valid(k: nx_int) -> nx_int
61func _spc_is_horizontal(kind: nx_int) -> nx_int
127func _spc_expected_above(a: nx_int, b: nx_int) -> nx_int
169func nx_surface_plane_check(
298func _spc_set_surface(arr: *NxSurfaceRecord, idx: nx_int,
called by 1: main
312func main() -> nx_int