code wiki / (root) / nx_crummy_detector.nx

nx_crummy_detector.nx

buildroot/runtime/nx_crummy_detector.nx

23113 B597 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_layer_verdict.nx nx_crummy_detector.nx

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

main sys_mmap nx_crummy_detect _crummy_range_usage_q14 _crummy_local_contrast_q14 _crummy_signature_peaks_q1 _crummy_biome_diversity_q1 sys_mmap ↻ _crummy_log2_q14 _crummy_palette_richness_q _crummy_horizon_variation_ _crummy_non_repetition_q14 sys_mmap ↻ nx_layer_verdict_init nx_layer_verdict_finalize nx_layer_grade_from_axes nx_lv_axis_verdict nx_is_crummy

structs

none

consts

55const NX_MAGIC_16384: i64 = 16384
56const NX_MAGIC_25976: i64 = 25976
57const NX_MAGIC_32768: i64 = 32768
58const NX_MAGIC_38048: i64 = 38048
59const NX_MAGIC_42361: i64 = 42361
60const NX_MAGIC_46006: i64 = 46006
61const NX_MAGIC_49152: i64 = 49152
62const NX_MAGIC_51916: i64 = 51916
63const NX_MAGIC_54432: i64 = 54432
64const NX_MAGIC_56619: i64 = 56619
65const NX_MAGIC_58744: i64 = 58744
66const NX_MAGIC_60686: i64 = 60686
67const NX_MAGIC_62390: i64 = 62390
68const NX_MAGIC_63984: i64 = 63984
69const NX_MAGIC_65536: i64 = 65536
72const NX_CRUMMY_Q: nx_int = 16384
75const NX_CRUMMY_AXIS_RANGE_USAGE: nx_int = 0
76const NX_CRUMMY_AXIS_LOCAL_CONTRAST: nx_int = 1
77const NX_CRUMMY_AXIS_SIGNATURE_PEAKS: nx_int = 2
78const NX_CRUMMY_AXIS_BIOME_DIVERSITY: nx_int = 3
79const NX_CRUMMY_AXIS_PALETTE_RICHNESS: nx_int = 4
80const NX_CRUMMY_AXIS_HORIZON_VARIATION: nx_int = 5
81const NX_CRUMMY_AXIS_NON_REPETITION: nx_int = 6
83const NX_CRUMMY_AXIS_COUNT: nx_int = 7

functions

86func _crummy_log2_q14(bin: nx_int) -> nx_int
106func _crummy_range_usage_q14(
called by 1: nx_crummy_detect
130func _crummy_local_contrast_q14(
called by 1: nx_crummy_detect
173func _crummy_signature_peaks_q14(
called by 1: nx_crummy_detect
225func _crummy_biome_diversity_q14(
273func _crummy_palette_richness_q14(
called by 1: nx_crummy_detect
309func _crummy_horizon_variation_q14(
called by 1: nx_crummy_detect
350func _crummy_non_repetition_q14(
called by 1: nx_crummy_detect calls 1: sys_mmap
406func nx_crummy_detect(
437func nx_is_crummy(verdict: *i64) -> nx_int
called by 1: main
452func main() -> i64