code wiki / (root) / nx_layer_verdict.nx

nx_layer_verdict.nx

buildroot/runtime/nx_layer_verdict.nx

15222 B349 linesdepth 2pulls 2 transitivereach 17 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_layer_verdict.nx -- polymorphic per-layer grader verdict. Per user 2026-05-16: "i also again want our proc gen to always layer by layer and overall meta have a god is this good and it should do that based on the math like we were building in the elder ai for images and video and sound" This primitive is the SHARED DATA STRUCTURE that every per-layer grader emits. Composes with nx_meta_verdict.nx (the META aggregator that produces the "God saw it was good" overall grade). Mathematical posture (matches Elder AI's image/video/sound grader design): - Every layer has 1-12 axes, each scored Q14 [0, Q]. - Axis verdicts: WIN (>= 0.6Q), MARGINAL (>= 0.4Q), LOSS (else). - Layer grade is computed from axis verdict counts (4-axis-wins, etc.); same rubric as nx_quality_grade.nx for inter-grader consistency. - REFINE_HINT names the weakest axis to direct iterative improvement. LAYER_VERDICT layout (16 i64, all Q14 except sealed-enums): v[0] layer_kind sealed enum NX_LAYER_KIND_* v[1] grade F=0..S=5 v[2] n_axes_used 1..12 (number of axes actually scored) v[3] refine_hint sealed enum NX_LAYER_REFINE_* v[4..15] axis_scores[12] Q14 [0, Q] per axis; unused axes = 0 The 12-axis ceiling is a hard cap; if a grader needs more axes, either split into multiple LAYER_VERDICT records or pre-aggregate. genealogy_id: elder_ai_image_grader + elder_ai_sound_grader_canon + nx_quality_grade_sclass_canon lineage_id: nx_layer_verdict_polymorphic_v1

dependencies 2 imports · 13 importers

nx_syscalls.nx nx_tier.nx nx_layer_verdict.nx nx_actor_role_audio_grader.nx nx_audio_scene_quality.nx nx_castle_quality.nx nx_crater_quality.nx nx_crummy_detector.nx nx_forest_quality.nx nx_inter_layer_coherence.nx nx_lighting_quality.nx nx_meta_verdict.nx nx_river_quality.nx

diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_actor_role_audio_grader.nxnx_audio_scene_quality.nxnx_castle_quality.nxnx_crater_quality.nxnx_crummy_detector.nxnx_forest_quality.nxnx_inter_layer_coherence.nxnx_lighting_quality.nxnx_meta_verdict.nxnx_river_quality.nxnx_silhouette_quality.nxnx_town_quality.nxnx_wow_moment_detector.nx

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

main nx_layer_kind_is_valid nx_lv_grade_is_valid nx_layer_refine_is_valid nx_lv_axis_verdict sys_mmap nx_layer_grade_from_axes nx_lv_axis_verdict ↻ nx_layer_verdict_write nx_layer_verdict_init nx_layer_verdict_finalize nx_layer_grade_from_axes ↻ nx_layer_verdict_axis nx_layer_verdict_from_wqg nx_layer_verdict_init ↻ nx_layer_verdict_finalize ↻

structs

none

consts

46const NX_LV_Q: nx_int = 16384
49const NX_LV_STRIDE: nx_int = 16
51const NX_LV_OFF_KIND: nx_int = 0
52const NX_LV_OFF_GRADE: nx_int = 1
53const NX_LV_OFF_N_AXES: nx_int = 2
54const NX_LV_OFF_REFINE_HINT: nx_int = 3
55const NX_LV_OFF_AXIS_0: nx_int = 4
56const NX_LV_OFF_AXIS_LAST: nx_int = 15
58const NX_LV_MAX_AXES: nx_int = 12
63const NX_LAYER_KIND_HEIGHTMAP: nx_int = 0 // nx_terrestrial_surface / nx_world_quality_grader
64const NX_LAYER_KIND_BIOME: nx_int = 1 // nx_biome_classifier output
65const NX_LAYER_KIND_FOREST: nx_int = 2 // nx_forest_layout placement
66const NX_LAYER_KIND_RIVER: nx_int = 3 // nx_river_carve path quality
67const NX_LAYER_KIND_TOWN: nx_int = 4 // nx_town_layout coherence
68const NX_LAYER_KIND_CRATER: nx_int = 5 // nx_crater_field density
69const NX_LAYER_KIND_WEATHER: nx_int = 6 // nx_weather_pattern coherence
70const NX_LAYER_KIND_ATMOSPHERE: nx_int = 7 // sky/fog/scattering quality
71const NX_LAYER_KIND_AUDIO: nx_int = 8 // sound design grader (Elder AI parallel)
72const NX_LAYER_KIND_COLOR: nx_int = 9 // color palette / contrast / vibrancy
73const NX_LAYER_KIND_READABILITY: nx_int = 10 // overall visual readability
74const NX_LAYER_KIND_HAMMERED: nx_int = 11 // nx_hammered_zone variety
75const NX_LAYER_KIND_CASTLE: nx_int = 12 // nx_castle_layout / architectural
76const NX_LAYER_KIND_WATER_EROSION: nx_int = 13 // nx_water_erosion convergence
77const NX_LAYER_KIND_ORE_DEPOSIT: nx_int = 14 // nx_ore_deposit distribution
79const NX_LAYER_KIND_COUNT: nx_int = 15
87const NX_LV_GRADE_F: nx_int = 0
88const NX_LV_GRADE_D: nx_int = 1
89const NX_LV_GRADE_C: nx_int = 2
90const NX_LV_GRADE_B: nx_int = 3
91const NX_LV_GRADE_A: nx_int = 4
92const NX_LV_GRADE_S: nx_int = 5
94const NX_LV_GRADE_COUNT: nx_int = 6
104const NX_LAYER_REFINE_NONE: nx_int = 0
105const NX_LAYER_REFINE_MORE_RELIEF: nx_int = 1
106const NX_LAYER_REFINE_MORE_FEATURES: nx_int = 2
107const NX_LAYER_REFINE_LESS_FLATNESS: nx_int = 3
108const NX_LAYER_REFINE_ADD_DETAIL: nx_int = 4
109const NX_LAYER_REFINE_SMOOTH_NOISE: nx_int = 5
110const NX_LAYER_REFINE_FIX_FRACTAL: nx_int = 6
111const NX_LAYER_REFINE_FIX_BIOMES: nx_int = 7
112const NX_LAYER_REFINE_MORE_VARIETY: nx_int = 8
113const NX_LAYER_REFINE_IMPROVE_READ: nx_int = 9
114const NX_LAYER_REFINE_FIX_COHERENCE: nx_int = 10
115const NX_LAYER_REFINE_REPLACE_LAYER: nx_int = 11 // layer is hopeless; regenerate
117const NX_LAYER_REFINE_COUNT: nx_int = 12
125const NX_LV_AXIS_WIN_FLOOR: nx_int = 9830 // 0.6Q
126const NX_LV_AXIS_MARGINAL_FLOOR: nx_int = 6553 // 0.4Q

functions

81func nx_layer_kind_is_valid(k: nx_int) -> nx_int
called by 1: main
96func nx_lv_grade_is_valid(g: nx_int) -> nx_int
119func nx_layer_refine_is_valid(r: nx_int) -> nx_int
called by 1: main
129func nx_lv_axis_verdict(score: nx_int) -> nx_int
147func nx_layer_grade_from_axes(
181func nx_layer_verdict_init(
198func nx_layer_verdict_finalize(v: *i64)
206func nx_layer_verdict_axis(v: *i64, axis_idx: nx_int) -> nx_int
called by 1: main
213func nx_layer_verdict_write(
240func nx_layer_verdict_from_wqg(
264func main() -> i64