Docs / REPORT

Item 214 — Controller verification matrix

Source: tests/controller-matrix/REPORT.md

Result: the keyboard, Gamepad API and on-screen-pad paths are verified PASS on every
engine × browser/runtime combination exercised here, after one real fix to the shared player
shell. The phone-QR path is verified only by the earlier, already-accepted end-to-end proof
(cited below, not re-run). Rows that could not actually be exercised are marked NOT TESTED
with the reason; none are reported as PASS without evidence.

1. Scope and environment

  • Worktree: gc-controller-hy4, branch ceo/gc-controller-hy4, base commit a710b81.
    No push, no merge, no deploy, no other worker's worktree or sandbox was modified.

  • Host: macOS (darwin, arm64), Node v22.23.4, Python 3.14.7, Kiri CLI ~/.kiri/bin/kiri.
    System Python lacks jsonschema; sandbox creation used the already-present local
    .venv interpreter at /Users/mac/orca/workspaces/game-composer/gc-controller-matrix/.venv/bin/python
    (read-only use). Playwright and its browsers were already installed locally.

  • Run window: 2026-11-29T14:21Z–14:41Z (UTC), exact per-report timestamps in the JSON files below.

  • Sandboxes created by this run and removed at the end (no other container touched):

    Target Manifest Container URL before fix URL after fix
    stream-nes templates/02-nes-local-homebrew/gamecomposer.yml gc-239b28431a2b-nes http://127.0.0.1:60756/ http://127.0.0.1:61769/
    jsnes-nes templates/05-nes-no-network/gamecomposer.yml gc-d3ec1a530a6d-nes http://127.0.0.1:60827/ http://127.0.0.1:61760/
    ejs-snes examples/snes/gamecomposer.yml gc-9fb783f6f145-snes http://127.0.0.1:60828/ http://127.0.0.1:61753/

    The two NES targets are real local ROMs in the checkout (VOID LANCER and 8-Bit Table Tennis);
    the SNES target fetches the committed, SHA-pinned Kit's Rooftop Run ROM and EmulatorJS 4.2.3
    loader from the manifest sources. The served player.html byte hashes matched the working
    tree at both stages, so the pages under test are the ones in this commit.

2. Method and pass criterion

tests/controller-matrix/drive.cjs drives a real player page in a real browser. Before any page
script runs it installs a probe that records:

  1. the shell input boundary: every KittyPlayerShell.adapter.press(name, down) call, with
    the logical button name (this is where all four local paths converge);
  2. the engine boundary: {t:"down"/"up",b:...} WebSocket messages for the in-container
    stream engine, and gameManager.simulateInput(player,index,value) calls for EmulatorJS,
    with the index from the shipped EJS_INPUT_HOOK.

A path is PASS when every control mapped for that platform reaches the shell boundary with
the expected name and no other button fires in the same window. Engine-boundary entries and
three screenshots per path (before / idle / after, SHA-256 recorded in each JSON) are
corroborating evidence. A small pixel diff is not used to fail a row: for a static title or an
animated idle scene the frame can legitimately stay unchanged, while the engine log still shows
the press and release. The frameChanged field is recorded so this is visible, not hidden.

Actuation per path:

  • Keyboard — real Playwright keyboard.down/up events with the codes from config.keys.
  • Gamepad API — a synthetic navigator.getGamepads() standard-layout pad injected by the
    probe, enabled only for that path. This exercises the real browser API code path in the real
    player, but it is not a physical gamepad (see NOT TESTED below).
  • On-screen pad — real pointer (mouse.down/up) events on the rendered #virtual-pad buttons.
  • Phone QR — not re-run; see §5.

3. Matrix (after the fix)

Each cell is PASS with the evidence file named in the last column. NOT TESTED means no
run was performed and no evidence exists for that cell.

Browser / runtime Engine / core Keyboard Gamepad API (synthetic) On-screen pad Phone QR Evidence (JSON)
Chrome 158.0.8127.38 stream / jsnes in Kiri (NES) PASS PASS PASS PASS (prior proof, §5) evidence/chrome-after-report.json
Chrome 158.0.8127.38 jsnes 2.1.0 in browser (NES) PASS PASS PASS NOT TESTED evidence/chrome-after-report.json
Chrome 158.0.8127.38 EmulatorJS 4.2.3 / snes9x (SNES) PASS PASS PASS NOT TESTED evidence/chrome-after-report.json
Chromium 156.0.8078.4 stream / jsnes in Kiri (NES) PASS PASS PASS NOT TESTED evidence/chromium-after-report.json
Chromium 156.0.8078.4 jsnes 2.1.0 in browser (NES) PASS PASS PASS NOT TESTED evidence/chromium-after-report.json
Chromium 156.0.8078.4 EmulatorJS 4.2.3 / snes9x (SNES) PASS PASS PASS NOT TESTED evidence/chromium-after-report.json
Firefox 157.0 stream / jsnes in Kiri (NES) PASS PASS PASS NOT TESTED evidence/firefox-after-report.json
Firefox 157.0 jsnes 2.1.0 in browser (NES) PASS PASS PASS NOT TESTED evidence/firefox-after-report.json
Firefox 157.0 EmulatorJS 4.2.3 / snes9x (SNES) NOT TESTED NOT TESTED NOT TESTED NOT TESTED evidence/firefox-after-report.json (ERROR, see §6)
WebKit 27.2 stream / jsnes in Kiri (NES) PASS PASS PASS NOT TESTED evidence/webkit-after-report.json
WebKit 27.2 jsnes 2.1.0 in browser (NES) PASS PASS PASS NOT TESTED evidence/webkit-after-report.json
WebKit 27.2 EmulatorJS 4.2.3 / snes9x (SNES) PASS PASS PASS NOT TESTED evidence/webkit-after-report.json
Electron 38.8.6 / Chrome 140.0.7339.249 (native Kitty player window) stream / jsnes in Kiri (NES) PASS PASS PASS NOT TESTED evidence/electron-after-report.json
Electron 38.8.6 / Chrome 140.0.7339.249 jsnes 2.1.0 in browser (NES) PASS PASS PASS NOT TESTED evidence/electron-after-report.json
Electron 38.8.6 / Chrome 140.0.7339.249 EmulatorJS 4.2.3 / snes9x (SNES) PASS PASS PASS NOT TESTED evidence/electron-after-report.json

Totals actually exercised: 42 PASS cells (14 engine × runtime combinations × 3 local
paths), 1 engine × runtime combination NOT TESTED (Firefox + EmulatorJS = 3 cells), plus the
phone-QR cells described in §5.

4. Failure found and fixed

Baseline run (evidence/chrome-baseline-report.json, 2026-11-29T14:26:29Z): Gamepad API FAIL
on all three engines. The standard W3C pad reports SELECT at index 8 and START at index 9, but
the player shell expected 2 and 3 — those are actually X and Y on a standard pad — and did not
map X/Y/L/R at all. Consequences: START/SELECT never reached the emulator; on SNES pressing X
fired SELECT and pressing Y fired START. The settings "Test input" panel already used the
correct W3C indices (desktop/src/input-defaults.js), so the player shell was the outlier.

Fix (commit in this worktree):

  • templates/_shared/player-shell/shell.js: GAMEPAD_INDEX now uses W3C standard indices
    (A 0, B 1, X 2, Y 3, L 4, R 5, SELECT 8, START 9, D-pad 12–15); added L/R to BUTTON_NAMES
    and LEFT_TOP_SHOULDER/RIGHT_TOP_SHOULDER to the EmulatorJS hook codes.
  • Regenerated all 29 player pages and the 13 registry pins with
    node templates/_shared/player-shell/build.cjs (never hand-edited a generated page).
  • Fresh sandboxes were built from the regenerated pages; the served bytes were hash-checked
    against the working tree before re-running.
  • After fix (evidence/chrome-after-report.json, 2026-11-29T14:29:40Z): all three Gamepad API
    rows PASS on Chrome, and the same on Chromium, Firefox, WebKit and Electron.

5. Phone QR (carried forward, not re-run)

The QR/LAN bridge and player overlay were already proven earlier in this repository; this run
builds on that proof and does not repeat it. Source:
tests/virtual-controller/evidence/report.md (and report.json plus the committed PNGs,
QR decode and emulator input log in the same directory). It records a real Kiri NES stream
sandbox, an independently decoded QR invite (VALUE=http://192.168.1.117:52105/#…), a LAN bridge
to the loopback player, a simulated phone browser pressing a control, and emulator input events
0 → 2 with a 17.2% changed-pixel frame difference, timestamped 2026-11-29T01:38:44Z.

Verified scope of that proof: phone QR on the NES stream engine in a Chromium/CDP browser.
It is NOT TESTED for the browser-jsnes engine, the EmulatorJS SNES engine, Firefox, WebKit,
Electron, or with a physical phone. The bridge's unit/integration tests pass in this run
(desktop test cases 371–376: button mapping, wire allowlist, QR round-trip, LAN guards,
real HTTP/WebSocket round trip).

6. NOT TESTED and known issues

Item Status Reason / evidence
EmulatorJS + Firefox NOT TESTED All CDN requests fail with SSL_ERROR_UNKNOWN in this host's Firefox (own CA store); EmulatorJS is not defined, so the engine never starts. ignoreHTTPSErrors did not help. Screenshot evidence/firefox-ejs-debug.png, console log reproduced by data/debug-firefox-ejs.cjs. The six non-EJS Firefox cells PASS. No app input-path conclusion is drawn from this cell.
Physical Bluetooth gamepads (Xbox Wireless Controller, Stadia Controller) NOT TESTED Both are paired on this Mac but not connected, and no physical button actuation is available to automation. Only the synthetic standard-layout pad was exercised; do not read the Gamepad API PASS cells as hardware certification.
Physical phone / real QR scan by a phone NOT TESTED Prior proof used a simulated phone browser on the LAN bridge; no handset was actuated.
Safari proper NOT TESTED WebKit 27.2 was exercised; no Safari automation bridge was enabled on this host.
N64 frame engine, and the other EmulatorJS platforms in registry-staging NOT TESTED No sandboxes for those cores were created in this run; no evidence gathered.
EmulatorJS native input handlers Known issue, not fixed EJS's own keyboard/gamepad handling fires alongside Kitty's hook and sends additional simulateInput indices (e.g. Kitty A → index 0 and native → index 8; keyboard B → index 1 and native → index 8). Observed in every EJS run, before and after the fix; recorded as nativeExtras in the JSON reports. Suppressing it changes emulator behaviour and needs an owner decision, so it was documented rather than guessed.
Canvas frame change on some cells Caveat frameChanged=false on several on-screen-pad / animated-idle cells (notably jsnes pad). Input delivery is proven by the engine log; no game-state response is claimed for those cells.

7. Desktop suite

  • npm --prefix desktop test (bare, this fresh worktree): 389 pass / 12 fail / 5 skip, exit 1.
    All 12 failures are lifecycle tests that need local npm/Python dependencies absent from a fresh
    worktree (Cannot find package 'yaml' imported from sdk/dist/config.js; system python3
    lacks jsonschema). See data/desktop-test.log.
  • With those dependencies supplied read-only from the already-installed local cache and
    GAMECOMPOSER_PYTHON=…/.venv/bin/python: 406 pass / 0 fail / 0 skip, exit 0.
    See data/desktop-test-with-deps.log. No source change was needed to reach 406/406.
  • Harness syntax check: node --check on drive.cjs and run.cjs (both load and run).

8. Evidence inventory

  • evidence/*-report.json — per-run machine-readable records: browser/runtime version, start and
    finish timestamps, engine config, sandbox URL, every button press with expected and observed
    boundary events, idle/input pixel diffs, screenshot SHA-256, and page errors.
    Prefixes: chrome-before (first-pass harness, superseded), chrome-baseline (corrected harness,
    pre-fix), chrome-after, chromium-after, firefox-after, firefox-ejs-ignore-tls (failed
    retry), webkit-after, electron-after.
  • 127 PNG screenshots under evidence/ (before / idle / after for each exercised path in each
    runtime), plus evidence/firefox-ejs-debug.png.
  • data/*.log — exact stdout of every sandbox up/down, every matrix run and both desktop suites.
  • data/targets.json — the three real sandbox targets and their URLs.
  • data/debug-*.cjs — the diagnostics used to attribute the jsnes instrumentation gap, the
    Electron boot condition and the Firefox CDN TLS failure.

Reproduce (from the repo root, with a Python that has jsonschema and Playwright installed):

node templates/_shared/player-shell/build.cjs
PYTHONPATH=. python3 -m gamecomposer.cli -f templates/02-nes-local-homebrew/gamecomposer.yml --no-open --new up nes
PYTHONPATH=. python3 -m gamecomposer.cli -f templates/05-nes-no-network/gamecomposer.yml --no-open --new up nes
PYTHONPATH=. python3 -m gamecomposer.cli -f examples/snes/gamecomposer.yml --no-open --new up snes
# put the three printed URLs in data/targets.json, then:
node tests/controller-matrix/run.cjs --targets tests/controller-matrix/data/targets.json \
  --browser chrome --out tests/controller-matrix/evidence --label chrome-after
# repeat with --browser chromium|firefox|webkit|electron
npm --prefix desktop test

Back to all docs