code wiki / _hdl_build / nx_game_critic.nx
nx_game_critic.nx
buildroot/runtime/_hdl_build/nx_game_critic.nx
about
nx_game_critic.nx -- the REAL experiential QUALITY critic (not a floor check). nx_frame_sanity only
proves a frame isn't BROKEN (not blown/void, has some edges); it green-lit toy games (flat discs on an
empty starfield) as if they were good. That is the self-flattery the output-reality doctrine forbids.
This critic measures whether a rendered game frame reads as RICH vs TOY, on dimensions that actually
separate them, and returns an honest verdict TOY/BASIC/RICH/SOTA. You CLIMB against this, never the
eyeball's flattery. Calibrated so a flat-primitive frame scores TOY and a detailed/shaded/textured
frame scores higher -- the gate mutation-proves it distinguishes them.
Dimensions (all integer, on a packed-pixel i64 fb = swgpu/game_raster format):
[0] palette -- distinct quantized colours (5-bit/chan). Flat fills ~ a dozen; rich art >> 40.
[1] detail1 -- fine 1px luma-step density permil (texture/edges up close).
[2] detail4 -- 4px luma-step density permil (structure at a coarse scale -- real composition).
[3] gradient -- pixels inside a SMOOTH shade ramp permil (lighting/depth, not flat colour blocks).
[4] coverage -- non-background pixels permil (a filled scene vs mostly-empty void).
LIB, no main. license_tier: ORIGINAL
dependencies 1 imports · 11 importers
diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.
imports: nx_syscalls.nx
imported by: nx_anatomy_critic_gate.nxnx_breeder_lab.nxnx_char_identity_sheet.nxnx_creature_demo.nxnx_critic2_gate.nxnx_drift_engine.nxnx_frame_score.nxnx_frontier_engine.nxnx_game_critic_gate.nxnx_game_redteam_gate.nxnx_m2d_engine.nx
structs
| none |
consts
| 16 | const GC_MAGIC_4096: i64 = 4096 |
| 18 | const GC_N: i64 = 6 |
| 19 | const GC_M_PAL: i64 = 0 |
| 20 | const GC_M_DET1: i64 = 1 |
| 21 | const GC_M_DET4: i64 = 2 |
| 22 | const GC_M_GRAD: i64 = 3 |
| 23 | const GC_M_COV: i64 = 4 |
| 24 | const GC_M_COHERE: i64 = 5 // spatial coherence: fraction of adjacent pairs that are locally smooth. |
| 28 | const GC_TOY: i64 = 300 |
| 29 | const GC_BASIC: i64 = 550 |
| 30 | const GC_RICH: i64 = 780 |
functions
| 32 | func gc_lum(v: i64) -> i64 { return ((v & 0xff)*2 + ((v>>8)&0xff)*5 + ((v>>16)&0xff)) / 8 } called by 1: gc_score |
| 35 | func gc_score(fb: *i64, w: i64, h: i64, out: *i64) -> i64 |
| 99 | func gc_capw(v: i64, target: i64, weight: i64) -> i64 called by 1: gc_quality |
| 104 | func gc_quality(out: *i64) -> i64 |
| 118 | func gc_verdict(score: i64) -> *u8 |
| 135 | func gc_bonus(v: i64, target: i64, weight: i64) -> i64 called by 1: gc_quality2 |
| 140 | func gc_quality2(out: *i64) -> i64 |