nx_layer_verdict.nx
buildroot/runtime/nx_layer_verdict.nx
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
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
structs
| none |
consts
| 46 | const NX_LV_Q: nx_int = 16384 |
| 49 | const NX_LV_STRIDE: nx_int = 16 |
| 51 | const NX_LV_OFF_KIND: nx_int = 0 |
| 52 | const NX_LV_OFF_GRADE: nx_int = 1 |
| 53 | const NX_LV_OFF_N_AXES: nx_int = 2 |
| 54 | const NX_LV_OFF_REFINE_HINT: nx_int = 3 |
| 55 | const NX_LV_OFF_AXIS_0: nx_int = 4 |
| 56 | const NX_LV_OFF_AXIS_LAST: nx_int = 15 |
| 58 | const NX_LV_MAX_AXES: nx_int = 12 |
| 63 | const NX_LAYER_KIND_HEIGHTMAP: nx_int = 0 // nx_terrestrial_surface / nx_world_quality_grader |
| 64 | const NX_LAYER_KIND_BIOME: nx_int = 1 // nx_biome_classifier output |
| 65 | const NX_LAYER_KIND_FOREST: nx_int = 2 // nx_forest_layout placement |
| 66 | const NX_LAYER_KIND_RIVER: nx_int = 3 // nx_river_carve path quality |
| 67 | const NX_LAYER_KIND_TOWN: nx_int = 4 // nx_town_layout coherence |
| 68 | const NX_LAYER_KIND_CRATER: nx_int = 5 // nx_crater_field density |
| 69 | const NX_LAYER_KIND_WEATHER: nx_int = 6 // nx_weather_pattern coherence |
| 70 | const NX_LAYER_KIND_ATMOSPHERE: nx_int = 7 // sky/fog/scattering quality |
| 71 | const NX_LAYER_KIND_AUDIO: nx_int = 8 // sound design grader (Elder AI parallel) |
| 72 | const NX_LAYER_KIND_COLOR: nx_int = 9 // color palette / contrast / vibrancy |
| 73 | const NX_LAYER_KIND_READABILITY: nx_int = 10 // overall visual readability |
| 74 | const NX_LAYER_KIND_HAMMERED: nx_int = 11 // nx_hammered_zone variety |
| 75 | const NX_LAYER_KIND_CASTLE: nx_int = 12 // nx_castle_layout / architectural |
| 76 | const NX_LAYER_KIND_WATER_EROSION: nx_int = 13 // nx_water_erosion convergence |
| 77 | const NX_LAYER_KIND_ORE_DEPOSIT: nx_int = 14 // nx_ore_deposit distribution |
| 79 | const NX_LAYER_KIND_COUNT: nx_int = 15 |
| 87 | const NX_LV_GRADE_F: nx_int = 0 |
| 88 | const NX_LV_GRADE_D: nx_int = 1 |
| 89 | const NX_LV_GRADE_C: nx_int = 2 |
| 90 | const NX_LV_GRADE_B: nx_int = 3 |
| 91 | const NX_LV_GRADE_A: nx_int = 4 |
| 92 | const NX_LV_GRADE_S: nx_int = 5 |
| 94 | const NX_LV_GRADE_COUNT: nx_int = 6 |
| 104 | const NX_LAYER_REFINE_NONE: nx_int = 0 |
| 105 | const NX_LAYER_REFINE_MORE_RELIEF: nx_int = 1 |
| 106 | const NX_LAYER_REFINE_MORE_FEATURES: nx_int = 2 |
| 107 | const NX_LAYER_REFINE_LESS_FLATNESS: nx_int = 3 |
| 108 | const NX_LAYER_REFINE_ADD_DETAIL: nx_int = 4 |
| 109 | const NX_LAYER_REFINE_SMOOTH_NOISE: nx_int = 5 |
| 110 | const NX_LAYER_REFINE_FIX_FRACTAL: nx_int = 6 |
| 111 | const NX_LAYER_REFINE_FIX_BIOMES: nx_int = 7 |
| 112 | const NX_LAYER_REFINE_MORE_VARIETY: nx_int = 8 |
| 113 | const NX_LAYER_REFINE_IMPROVE_READ: nx_int = 9 |
| 114 | const NX_LAYER_REFINE_FIX_COHERENCE: nx_int = 10 |
| 115 | const NX_LAYER_REFINE_REPLACE_LAYER: nx_int = 11 // layer is hopeless; regenerate |
| 117 | const NX_LAYER_REFINE_COUNT: nx_int = 12 |
| 125 | const NX_LV_AXIS_WIN_FLOOR: nx_int = 9830 // 0.6Q |
| 126 | const NX_LV_AXIS_MARGINAL_FLOOR: nx_int = 6553 // 0.4Q |
functions
| 81 | func nx_layer_kind_is_valid(k: nx_int) -> nx_int called by 1: main |
| 96 | func nx_lv_grade_is_valid(g: nx_int) -> nx_int |
| 119 | func nx_layer_refine_is_valid(r: nx_int) -> nx_int called by 1: main |
| 129 | func nx_lv_axis_verdict(score: nx_int) -> nx_int |
| 147 | func nx_layer_grade_from_axes( |
| 181 | func nx_layer_verdict_init( |
| 198 | func nx_layer_verdict_finalize(v: *i64) |
| 206 | func nx_layer_verdict_axis(v: *i64, axis_idx: nx_int) -> nx_int called by 1: main |
| 213 | func nx_layer_verdict_write( |
| 240 | func nx_layer_verdict_from_wqg( |
| 264 | func main() -> i64 |