Commit Graph
4 Commits
Author SHA1 Message Date
Hermes Cron Job ee24276fd0 test: real shader/terrain tests + headless render check
npm test was a brace counter: it checked each file was >10 chars and that {
and } counts matched. It passed on a build whose shader would not compile.

- tests/shaders.test.js compiles the game's real GLSL with glslangValidator
  (Khronos' reference compiler) under a three.js-style attribute prefix, and
  includes a canary that asserts a known-bad vec4 construction is REJECTED, so
  the suite cannot pass vacuously.
- tests/terrain.test.js covers heightfield determinism (the "persistent world"
  claim), airport flattening inside the 200 m radius with no leakage outside it,
  out-of-bounds behaviour, plausible height range, and vertex colour counts.
- scripts/headless-check.mjs (npm run test:render) serves dist/, drives the
  game over raw CDP with SwiftShader software WebGL, and fails if the canvas is
  black, the shaders fail to compile, or the scene does not change after input.
  No new dependencies: Node 22 built-in fetch/WebSocket. 120 s watchdog so it
  cannot hang a runner.
- npm test -> node --test "tests/*.test.js"; old checker kept as npm run lint:syntax.
- CI installs glslang-tools and runs the real tests; render job is
  continue-on-error because not every runner has a Chrome binary.

Verified non-vacuous: re-breaking the shader makes the unit tests fail 2/4 with
glslang's own "constructor: too many arguments" and makes the render check fail
four ways (1 distinct colour, 0/64000 lit pixels, shader error, frozen scene).
2026-10-07 13:31:32 +00:00
Hermes Cron Job 04e3400ab9 fix(retro): CRT vertex shader failed to compile, rendering the 3D canvas black
vec4(position, 0.0, 1.0) passes a vec3 plus two floats into a vec4 - five
components into four. Invalid GLSL ES on both WebGL 1 and 2:

  THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false
  ERROR: 0:71: 'constructor' : too many arguments

The whole post-processing pass failed and the game canvas read back as one
colour, 0/64000 non-black pixels. position.xy is the vec2 the fullscreen quad
needs.

Verified headlessly with SwiftShader: 55-143 distinct colours, 63750/64000
lit pixels, no shader errors, scene hash changes after throttle + pitch.
2026-10-07 13:31:23 +00:00
Hermes Cron Job ab96608cdd docs: add T8 (CRT shader fails to compile) + verified headless SwiftShader recipe 2026-10-06 17:57:14 +00:00
Hermes Cron Job da97ed7780 docs: add TODO.md from the 6 Oct audit (verified findings) 2026-10-06 15:47:19 +00:00