Skip to content

Make world observation setup readable - #10

Merged
deviankim merged 1 commit into
browser-environmentfrom
fix/world-observation-review
Oct 1, 2026
Merged

deviankim merged 1 commit into
browser-environmentfrom
fix/world-observation-review

Conversation

@deviankim

@deviankim deviankim commented Oct 1, 2026 •

Copy link
Copy Markdown

World observation setup grouped validation, pointer resolution and cleanup into long lines, making the diagnostic boundary difficult to review. Expand startWorldObservation into readable blocks while preserving its validation rules and cleanup behavior.

Follow-up to the P3 review of merged romdev #8; based on browser-environment after #7, #8 and #9. Host JavaScript only: native patches and published WebAssembly payloads are unchanged.

Measurement separation is verified in the companion romdev-browser monteslu#16 regression suite. All 15 benchmark configurations execute the production BundleSession handler with actual GB/GBC/NES cores through load, frame execution, partial/coalesced replay, checkpoints, digest-only checks and restore. A guard fails if startWorldObservation is called, native observation-arm calls stay zero, and native publication/event counters stay zero. The performance page loads bundle.worker; deliberate world checks use a separate world-check worker. These guards run in tests, outside measurement timings.

Self-review: compared the revised validation expressions and error paths with the original. Native multiplayer and world-observation suites: 29/29 on the merged-core baseline. Companion library: build/typecheck and 94/94 tests, including 15 observation-disabled configurations. Dev integration: Worker 1b4eea3b-cbff-4123-a0e0-083ec35e7f23, app 597bb9252f59200057bd9e960a0b3aec783491dc, library 3cedc6f7d1ac0c7ba80f3567fcc6ab037a2bf2c2 at /lib/romdev-browser/1.1.0-dd23c2485c/, bundle build 86a58c7defbc31eef0291a8be2cdf757a3cfffba1f7898e7cfa8e0d2000ab3ff, clean core/host source 2ba6b52aee3cdc477fa107c9513deccb5c6c7145. Existing room, fast-path, checkpoint, cable and benchmark stack is preserved. App build and 130/130 tests passed during normal dev deployment.

External procedure (no Google login required):

  1. Open https://dev.chiptoy.com/lib/romdev-browser/1.1.0-dd23c2485c/benchmark/world-check.html . Expect PASS: 9 world checks with the build above, including deliberate invalid worlds. This page intentionally enables diagnostic observation and does not measure performance.
  2. Open https://dev.chiptoy.com/benchmark?profile=smoke&device=Windows-observation . The host creates/uses a guest identity and privately uploads the report. Keep foreground; expect 15 deterministic cases and Report saved on dev. Return report ID/device/browser. When testing input, hold at least 50ms (100–200ms preferred).
  3. Performance measurements use the separate unobserved bundle.worker path. To reproduce the exact native inactive-observation assertions locally, run node --test tests/benchmark-observation.test.mjs in romdev-browser MCP tools/list emits draft-07 tuple items arrays that OpenAI-compatible APIs reject (HTTP 400) monteslu/romdev#16. This is a test-only probe and is not included in timed browser measurements.

Physical-phone performance acceptance remains separate and pending. No merge or production deployment.

Current follow-up dev smoke: Mac Chrome 152 and Android emulator Chrome 154 each completed 15/15 deterministic cases, one coalesced correction per case and zero hidden interruptions. Owner/operator read-back matched build 86a58c7defbc31eef0291a8be2cdf757a3cfffba1f7898e7cfa8e0d2000ab3ff and clean core/host 2ba6b52aee3cdc477fa107c9513deccb5c6c7145. Chrome console errors: zero. The separate Chrome world-check page passed 9/9, confirming deliberate diagnostic observation still works. Reports: Chrome 6a659ba9d5c5dd5716ea76b5bb0f71e923d62b4458bd376c09e5763decf855bd (Chrome-observation-3cedc6f), Android f3f8c9862710a6a661be2843900d022d7e58b3a5a0508a6fd165b63fca54b1c1 (Android-observation-3cedc6f). These correctness checks do not qualify physical-phone performance.

@deviankim

Copy link
Copy Markdown
Author

Reviewed: the observation setup is laid out readably with the same checks in the same order (exports, platform, publication value, trigger range, field count, span bounds and fixed tick length, stable tick, 1024-byte world, rollback on a core refusal). No behaviour change. Merging.

@deviankim
deviankim merged commit e0ed87b into browser-environment Oct 1, 2026
0 of 2 checks passed
@deviankim
deviankim deleted the fix/world-observation-review branch October 29, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant