Docs / PLAYER-EVIDENCE

Player evidence — examples/nes/image/player.html

Source: docs/PLAYER-EVIDENCE.md

GC closeout item 159 (hy4 H6). Read-only verification of the browser player for the green.nes fixture, with before/after emulator frames and an honest verdict.

Verdict: INCONCLUSIVE for playability. The player loads, renders emulator frames, and one keyboard control was observed to reach the emulator in two fresh headless-browser sessions. This is narrow input-correlated evidence, not a playability pass. The surface remains "contract-ready / unverified" under docs/PLAYER-UX.md §10.2 and tests/e2e-strategy/STRATEGY.md. No claim of "playable", "working", controller support, audio, or latency is made here, and the changing background animation alone is not treated as evidence of input.

1. Scope, ownership, and method

  • Only file owned/created: docs/PLAYER-EVIDENCE.md. No edits to player.html, serve.py, jsnes.min.js, the ROM, or any other repository file.
  • Read-only checks: HTTP GETs, DOM inspection, canvas pixel readback, and synthetic key events against the unmodified page. No POST to /checkpoint; Save/Load were deliberately not exercised. No source, configuration, or asset was changed.
  • Question asked: does player.html load, render frames, and accept input? Answer is split: load/render = evidenced; input = one control evidenced by a repeatable, input-correlated change; playability = not established.

2. Run identity

Item Value
Repository revision 321e188727d82dca419181c143d700a8f66febc3 (branch EnzoVezzaro/gc2-hy4-player)
Run date/time 2026-11-27 22:49–22:51 EST (UTC−5); per-frame UTC timestamps below
Host macOS 26.6.2 (25G83); Python 3.14.7; Node v22.23.4
Browser Google Chrome for Testing 159.0.8154.6, headless, via Playwright 1.58.2
ROM / fixture examples/nes/green.nes, 24592 bytes, SHA-256 ee19775092b9b94f4fd9db7d62a755f1d5522bbb2ce2c28e163c0009a4834b33
Emulator asset examples/nes/image/jsnes.min.js, 125207 bytes, SHA-256 574f7181c68a3e26fd60744a09e9a7b671d1bc5a6a19f191d7362f10cd76578e
Page under test examples/nes/image/player.html, 3544 bytes, SHA-256 757dd3e2d16ea03fff7e31a71dacd11dbcbcddbfce5108997e9b72abe543ee97
Server under test examples/nes/image/serve.py, SHA-256 6f96b09713208e747e31bddd1021469800cb2e1b03907ba76946c5e0eb9414d1

Server note (honest deviation): serve.py hardcodes port 8080, which is occupied on this host by an unrelated tunnel-client process. The repository's serve.py was executed unmodified through runpy by a wrapper located outside the repo whose only change is the socket bind port (8080 → 18080). Routing, handlers, and all served bytes came from the real file. No repository file was altered to accommodate this.

3. Load and render checks

HTTP responses observed by the browser during both sessions:

Path Status Bytes Meaning
/ 200 3544 player page served
/jsnes.js 200 125207 JSNES emulator asset served
/rom 200 24592 green.nes served
/favicon.ico 404 — browser's automatic request; benign, not a player asset

No page errors and no failed requests were recorded. One console error was the favicon 404 above; one console warning (willReadFrequently) was caused by the verification script's own getImageData readback, not by the player.

DOM reads before pressing Play:

  • document.title = 8-Bit Table Tennis · Game Composer; <h1> = 8-Bit Table Tennis.
  • #start enabled, label Play; #save and #load disabled; #status empty; zero canvases.
  • Hint text: "Press Enter or Start to begin. Use Up/Down to move; press X or gamepad A to serve. Connect a gamepad before pressing Play, or use the keyboard."

DOM reads after a mouse click on #start (Play activated by mouse click; not by Enter — see §6):

  • #status = Playing · connect a controller or use the keyboard.
  • #start disabled; #save and #load enabled.
  • One canvas in #screen, 256×240 internal pixels, 480×450 CSS pixels.
  • navigator.getGamepads() reported zero connected pads, matching the keyboard-fallback status text.

Frame capture method: canvas.toDataURL('image/png') on the #screen canvas; SHA-256 computed on decoded PNG bytes; center pixel and distinct-colour count from getImageData; an 8×8 sample grid in session 1. These are emulator display output (canvas), not host-window screenshots. Each frame contains exactly two colours — black plus one solid background colour — consistent with this fixture; the 8×8 grid for before-2 was uniformly [34, 14, 220].

4. Session 1 — every captured frame

Key input x held between input-held-1 and after-release; capture intervals ~650–730 ms.

Label Timestamp (UTC) SHA-256 Bytes Center RGB (px 128,120)
before-1 (no input) 2026-11-28T03:49:29.590Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
before-2 (no input) 2026-11-28T03:49:30.327Z 7b648eb2045c5b02ce4056b601f5293f318b6a671f53e9ea4b6138ce5c87beca 2273 [34, 14, 220] blue
input-held-1 (x down) 2026-11-28T03:49:30.526Z 7b648eb2045c5b02ce4056b601f5293f318b6a671f53e9ea4b6138ce5c87beca 2273 [34, 14, 220] blue
input-held-2 (x held) 2026-11-28T03:49:31.260Z 7b648eb2045c5b02ce4056b601f5293f318b6a671f53e9ea4b6138ce5c87beca 2273 [34, 14, 220] blue
after-release (x up) 2026-11-28T03:49:32.011Z 35ec6cd7005cb7b8ae52058623124457f839b2e3035e5a16c9cf0e34390ef289 2273 [43, 244, 3] green

5. Session 2 — fresh-browser repeat

Same server, new browser context and page; ~700 ms sampling intervals, input held across three samples (~1.4 s).

Label Timestamp (UTC) SHA-256 Bytes Center RGB (px 128,120)
baseline-0 (no input) 2026-11-28T03:50:34.374Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
baseline-1 (no input) 2026-11-28T03:50:35.086Z 7b648eb2045c5b02ce4056b601f5293f318b6a671f53e9ea4b6138ce5c87beca 2273 [34, 14, 220] blue
baseline-2 (no input) 2026-11-28T03:50:35.799Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
held-0 (x down, +100 ms) 2026-11-28T03:50:35.920Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
held-1 (x held) 2026-11-28T03:50:36.632Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
held-2 (x held) 2026-11-28T03:50:37.343Z a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def 2269 [188, 25, 0] orange
released-0 (x up, +700 ms) 2026-11-28T03:50:38.063Z 8eac34f7e690876eae4f759487aeb7f5e048e1920c2c7eec7262ba66cb89110d 2268 [255, 224, 0] yellow
released-1 (x up) 2026-11-28T03:50:38.773Z 35ec6cd7005cb7b8ae52058623124457f839b2e3035e5a16c9cf0e34390ef289 2273 [43, 244, 3] green

6. Input interpretation (why this is more than animation)

  • jsnes.min.js contains the default keyboard map 88: [1, BUTTON_A, "X"] — keyCode 88 (x) maps to NES controller 1 button A. player.html itself registers no keydown listener; the keyboard path comes from jsnes.Browser inside the emulator asset.
  • examples/nes/make_rom.py documents "Hold A to freeze it on green": the ROM skips its background-colour increment while A is held.
  • Control (animation only): with no input, the background changed on every sampled interval — orange → blue in session 1; orange → blue → orange in session 2. The cycling by itself proves only that the emulator is running and rendering.
  • Input-correlated observation: while x was held, three consecutive frames in session 2 spanning ~1.4 s were byte-identical (same SHA-256, a01e8b13…); in session 1, two frames 734 ms apart were byte-identical (7b648eb2…). Equal-length no-input windows always changed; the hold windows did not. After keyup x, the background changed again in both sessions.
  • Inference: the x keydown reached the NES A button through JSNES and altered the running game's behaviour. There was no instrumented read of $4016 and no in-game counter or state signal, so this is an inference from a deterministic fixture response, not a direct register-level trace.
  • Honest discrepancy: the fixture comment says "freeze it on green", but the frozen colour was orange in session 2 and blue in session 1 — the ROM freezes whichever colour is current, not necessarily green. The comment is imprecise; no fixture code was changed.

7. Embedded before/after frames (raw canvas PNGs, unmodified)

before = last no-input sample in session 2 (baseline-1, blue). after = final frame while x was held (held-2, orange, identical to the frame at keydown). resumed = first frame after release (released-0, yellow). Full checksums are in §5; images are embedded unchanged as data URIs so the evidence is self-contained in this owned file.

before — s2-baseline-1.png (SHA-256 7b648eb2045c5b02ce4056b601f5293f318b6a671f53e9ea4b6138ce5c87beca)

before frame

after — s2-held-2.png (SHA-256 a01e8b1379db302f3fc1a589c8d84b66a4936bc4f5768d2190b7cf7a3acc2def)

after frame

resumed after release — s2-released-0.png (SHA-256 8eac34f7e690876eae4f759487aeb7f5e048e1920c2c7eec7262ba66cb89110d)

resumed frame

8. What was not verified — honest verdict

Not exercised, therefore not claimed:

  • Gamepad/physical controller. No pad was connected (getGamepads() = 0); the gamepad polling branch in player.html was not driven by a real device. No controller compatibility claim.
  • "Press Enter or Start to begin". Play was activated by a mouse click on #start. JSNES maps Enter to in-game BUTTON_START, but keyboard activation of the Play button was not tested.
  • Up/Down movement, X-to-serve semantics. Only the A-button freeze response in this fixture was observed; the page's "Up/Down to move; X to serve" hint was not validated as gameplay.
  • Audio, pause/resume/restart/exit, error codes, device reconnect, blur/visibility, latency. None were tested.
  • Save/Load and /checkpoint. Buttons became enabled but were not used; this was a read-only check.
  • Audio/visual quality or "works" claim. Two-colour canvas output is fixture output, not a quality assessment.

Per docs/PLAYER-UX.md §10.1–10.2 and tests/e2e-strategy/STRATEGY.md, most required E2E scenarios remain unrun, so the playability status is INCONCLUSIVE and the player surface is contract-ready / unverified. The evidence supports only this narrow statement: on macOS 26.6.2 with headless Chrome for Testing 159, the unmodified page served by the repository's serve.py loaded, rendered emulator canvas frames from green.nes, and one keyboard control (x → NES A) produced a repeatable, input-correlated freeze across two fresh sessions. Changing animation alone is explicitly excluded as proof.

9. Reproduction

# From the repo root, with port 8080 free (or use a port-relocating wrapper as in §2):
export GAMECOMPOSER_EMULATOR_SOURCE="$PWD/examples/nes/image/jsnes.min.js"
python3 examples/nes/image/serve.py "$PWD/examples/nes/green.nes"

# In a separate shell, with Playwright's Chrome for Testing available:
# 1. page.goto('http://127.0.0.1:8080/'); assert title and pre-Play DOM.
# 2. page.click('#start'); wait for '#screen canvas' and status containing 'Playing'.
# 3. capture canvas.toDataURL('image/png') every ~700 ms with no input (3 frames).
# 4. page.keyboard.down('x'); capture 3 frames ~700 ms apart; page.keyboard.up('x');
#    capture 2 more frames ~700 ms apart.
# 5. SHA-256 each decoded PNG and compare center RGB via getImageData(128,120,1,1).

Raw PNG captures and JSON logs were generated in a host temp directory outside the repository during this run; the frames embedded in §7 are the durable copies. No repository artifact beyond this document was created or modified.

Back to all docs