nx_crummy_detector.nx
buildroot/runtime/nx_crummy_detector.nx
about
nx_crummy_detector.nx -- direct "is this world crummy?" detector.
Per user 2026-05-16: "i just dont want them to be crummy"
Crummy worlds share a small set of failure modes that statistical
graders (nx_world_quality_grader) sometimes miss because they
reward heightmap diversity even when the OVERALL experience is
bland. This primitive grades the 7 failure modes that produce
"crummy" output regardless of underlying statistics:
AXIS 0 -- RANGE_USAGE: Does the heightmap use the available relief
budget? Worlds with all hills at the same height (small range
relative to the body's max relief) are crummy.
AXIS 1 -- LOCAL_CONTRAST: Is neighbour-to-neighbour height
variation perceivable? Smooth-noise worlds score high on
diversity but low here -- they look like a putting green.
AXIS 2 -- SIGNATURE_PEAK_COUNT: Does the world have AT LEAST a
few extremes (peaks above 0.7 of relief; valleys below 0.1)?
Uniform mid-elevation worlds score 0 here.
AXIS 3 -- BIOME_DIVERSITY: If a biome map is supplied, is biome
distribution non-degenerate? An all-FOREST or all-DESERT world
is crummy. Shannon entropy of the biome histogram.
AXIS 4 -- PALETTE_RICHNESS: If a color palette is supplied, are
there at least 5 distinct hues? Monochrome worlds are crummy.
AXIS 5 -- HORIZON_VARIATION: If horizon ray samples are supplied,
does the silhouette have meaningful stddev? Pancake-horizon
worlds are crummy.
AXIS 6 -- SPATIAL_NON_REPETITION: Auto-correlation check. Does
the heightmap repeat at scale N? Worlds that tile (because the
noise was sampled with too-low frequency) are crummy.
EMITS LAYER_VERDICT (16 i64) with kind = NX_LAYER_KIND_READABILITY
(the closest existing kind; could split to a CRUMMY kind later).
CRUMMY-IS-NOT-A-LOSS CONVENTION: each axis is HIGHER = LESS CRUMMY.
Caller composes through nx_meta_verdict for the God-said-good check.
Skipped axes (null inputs) score MARGINAL (= 0.5Q) so they don't
drag the verdict. Caller can supply biome_map = 0, palette = 0,
horizon = 0 to skip those axes.
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_layer_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 55 | const NX_MAGIC_16384: i64 = 16384 |
| 56 | const NX_MAGIC_25976: i64 = 25976 |
| 57 | const NX_MAGIC_32768: i64 = 32768 |
| 58 | const NX_MAGIC_38048: i64 = 38048 |
| 59 | const NX_MAGIC_42361: i64 = 42361 |
| 60 | const NX_MAGIC_46006: i64 = 46006 |
| 61 | const NX_MAGIC_49152: i64 = 49152 |
| 62 | const NX_MAGIC_51916: i64 = 51916 |
| 63 | const NX_MAGIC_54432: i64 = 54432 |
| 64 | const NX_MAGIC_56619: i64 = 56619 |
| 65 | const NX_MAGIC_58744: i64 = 58744 |
| 66 | const NX_MAGIC_60686: i64 = 60686 |
| 67 | const NX_MAGIC_62390: i64 = 62390 |
| 68 | const NX_MAGIC_63984: i64 = 63984 |
| 69 | const NX_MAGIC_65536: i64 = 65536 |
| 72 | const NX_CRUMMY_Q: nx_int = 16384 |
| 75 | const NX_CRUMMY_AXIS_RANGE_USAGE: nx_int = 0 |
| 76 | const NX_CRUMMY_AXIS_LOCAL_CONTRAST: nx_int = 1 |
| 77 | const NX_CRUMMY_AXIS_SIGNATURE_PEAKS: nx_int = 2 |
| 78 | const NX_CRUMMY_AXIS_BIOME_DIVERSITY: nx_int = 3 |
| 79 | const NX_CRUMMY_AXIS_PALETTE_RICHNESS: nx_int = 4 |
| 80 | const NX_CRUMMY_AXIS_HORIZON_VARIATION: nx_int = 5 |
| 81 | const NX_CRUMMY_AXIS_NON_REPETITION: nx_int = 6 |
| 83 | const NX_CRUMMY_AXIS_COUNT: nx_int = 7 |
functions
| 86 | func _crummy_log2_q14(bin: nx_int) -> nx_int called by 1: _crummy_biome_diversity_q14 |
| 106 | func _crummy_range_usage_q14( called by 1: nx_crummy_detect |
| 130 | func _crummy_local_contrast_q14( called by 1: nx_crummy_detect |
| 173 | func _crummy_signature_peaks_q14( called by 1: nx_crummy_detect |
| 225 | func _crummy_biome_diversity_q14( |
| 273 | func _crummy_palette_richness_q14( called by 1: nx_crummy_detect |
| 309 | func _crummy_horizon_variation_q14( called by 1: nx_crummy_detect |
| 350 | func _crummy_non_repetition_q14( |
| 406 | func nx_crummy_detect( |
| 437 | func nx_is_crummy(verdict: *i64) -> nx_int called by 1: main |
| 452 | func main() -> i64 |