code wiki / _hdl_build / nx_game_critic.nx

nx_game_critic.nx

buildroot/runtime/_hdl_build/nx_game_critic.nx

6991 B150 linesdepth 2pulls 2 transitivereach 11 importersview sourcekind librarytopic game
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_game_critic.nx nx_anatomy_critic_gate.nx nx_breeder_lab.nx nx_char_identity_sheet.nx nx_creature_demo.nx nx_critic2_gate.nx nx_drift_engine.nx nx_frame_score.nx nx_frontier_engine.nx nx_game_critic_gate.nx nx_game_redteam_gate.nx

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

16const GC_MAGIC_4096: i64 = 4096
18const GC_N: i64 = 6
19const GC_M_PAL: i64 = 0
20const GC_M_DET1: i64 = 1
21const GC_M_DET4: i64 = 2
22const GC_M_GRAD: i64 = 3
23const GC_M_COV: i64 = 4
24const GC_M_COHERE: i64 = 5 // spatial coherence: fraction of adjacent pairs that are locally smooth.
28const GC_TOY: i64 = 300
29const GC_BASIC: i64 = 550
30const GC_RICH: i64 = 780

functions

32func gc_lum(v: i64) -> i64 { return ((v & 0xff)*2 + ((v>>8)&0xff)*5 + ((v>>16)&0xff)) / 8 }
called by 1: gc_score
35func gc_score(fb: *i64, w: i64, h: i64, out: *i64) -> i64
99func gc_capw(v: i64, target: i64, weight: i64) -> i64
called by 1: gc_quality
104func gc_quality(out: *i64) -> i64
called by 12: mainmainmainmainmainde_quality+6 calls 1: gc_capw
118func gc_verdict(score: i64) -> *u8
135func gc_bonus(v: i64, target: i64, weight: i64) -> i64
called by 1: gc_quality2
140func gc_quality2(out: *i64) -> i64
called by 1: main calls 2: gc_qualitygc_bonus