Skip to content

Add portable game cleanup and fix canonical example startup - #169

Draft
proggeramlug wants to merge 1 commit into
codex/direct-2d-capturefrom
codex/starter-lifecycle
Draft

Add portable game cleanup and fix canonical example startup#169
proggeramlug wants to merge 1 commit into
codex/direct-2d-capturefrom
codex/starter-lifecycle

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Pong uses a blocking source loop and toggles pause every frame while P is held. Its first actual native runtime check also fails because six canonical examples use undefined names such as Colors.White, while the public palette exposes Colors.WHITE. Native linking had not caught those invalid values.

Add optional runGame(updateAndDraw, cleanup) support on native and web, move Pong onto that loop, and use edge-triggered pause input. The browser scheduler completes an active draw before cleanup, cancels future frames and disposes once on stop or frame failure. It rejects simultaneous loop starts and ignores cancelled callbacks from an older game. Existing callback-only calls remain supported. Correct all 51 invalid palette references in six examples and validate canonical palette names against the actual exported palette.

Local validation passes: a fresh installed package simulates Jolt, captures all 16,384 expected pixels and records exactly one cleanup call in scene/direct-2D modes on Radeon DX12 and Vulkan. A separate real native callback-only compatibility probe also passes. Compiled Pong replay with a held P key yields RPRPRPRPR using the old check and RPPPPPPPP with the fix. All 20 native examples link, and the same corrected Pong source plus the actual engine complete the web build with the scheduler included.

Nine scheduler tests, nine web-command regressions, palette negative controls, repository and quality contracts, formatting, strict Clippy and WASM compilation pass. The initial palette runtime failure and intermediate input-staging audit mistake are retained in the evidence. No rendering baseline or threshold changes.

Stacked on #168. Hosted Tests run 34561587869 passes all 22 jobs, including both installed rendering modes with all expected pixels, native engine build and all 20 example links. Hosted source trees match the PR head. Native checks use the qualified Perry 0.5.1220 source/runtime profile and headless rendering; local DX12 has SDK compiler DLLs on PATH. Compiled-game browser rendering, all-example runtime acceptance, visible native presentation, packaged DXC, fixed updates and the complete one-command starter remain open. The public contract documents focus, timing and fatal-process cleanup limits. Relates to #142, #74, #140 and #145.

Published report and evidence retain the original palette startup failure, input-staging audit correction, cleanup and pause controls, exact final source and all final hosted results. ZIP SHA-256: db70fbe196446d3648c238c5e770ceaeabcb8b28282e8012f08c3cdf447e928d.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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