Skip to content
cccskills
FreePublished on GitHub

rust-webgpu-game-engine

Build and verify custom Rust winit and wgpu games across native and wasm WebGPU while preserving deterministic simulation, safe async lifecycle ownership, shader contracts, scenario persistence, and honest evidence boundaries.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19 stars(GitHub 19 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md4.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Rust WebGPU Game Engine

Use this skill when implementing or debugging a custom Rust game that combines winit, wgpu, native targets, or browser WebGPU.

Start from authority boundaries

  • Keep deterministic game truth independent of windows, GPUs, wall clocks, storage, editor drafts, and advisory output.
  • Convert fixed-point state to floating point only in presentation code.
  • Let editors produce validated immutable scenarios before constructing a replacement simulation. Build replacements in temporaries and swap once.
  • Keep advisory or compute output presentation-only unless a separately designed deterministic contract explicitly authorizes it.

Research the locked APIs

Read Cargo.toml, Cargo.lock, and the pinned toolchain before coding. Query documentation for the exact locked winit, wgpu, Naga, and wasm-bindgen versions. Do not copy latest-version examples into an older lock without compiling the target. In particular, verify constructor ownership, enum variants, feature names, surface presentation, and web extension traits against the locked release.

Validate shaders before pipeline creation

  • Parse shipped WGSL with Naga and run full validation before passing it to wgpu.
  • Keep host vertex offsets, strides, buffer sizes, binding minimum sizes, and shader packing synchronized and tested.
  • Include source labels in parse and validation diagnostics.
  • Test shader contracts without requiring a live adapter; keep adapter-backed tests separate.

Keep coordinate spaces explicit

Use logical pixels for layout, primitive vertices, renderer viewport globals, and hit testing. Use physical pixels only for surface configuration. Convert pointer coordinates once at the platform boundary. Test high-DPI-sensitive transformations rather than inferring correctness from a normal-density display.

Own surfaces safely

Prefer an owned Arc<Window> when creating a 'static wgpu surface. Create native windows, instances, and surfaces on the winit thread. If native adapter/device acquisition moves to an executor, return it through a generation-checked mailbox and configure the latest surface size back on the winit thread.

Handle every acquisition state deliberately: render and present success; render/present before reconfiguring suboptimal frames; skip timeout and occlusion; reconfigure outdated surfaces; recreate lost surfaces from the retained instance/window; and make validation failures fatal. Never configure a zero extent or reconfigure while a live frame exists.

Use a separate browser lifecycle

  • Create the browser window in ApplicationHandler::resumed with winit's append, prevent-default, and focusable web attributes.
  • Require an explicit browser WebGPU backend when WebGL fallback is not part of the product.
  • Launch GPU creation with wasm_bindgen_futures::spawn_local.
  • Store Result<GpuContext, Error> in a same-thread Rc<RefCell<Option<_>>> mailbox and send only a generation marker through EventLoopProxy.
  • Replace the mailbox when invalidating a generation so a detached stale future cannot overwrite the current result. Do not require GpuContext: Send and do not block the browser event loop.
  • Use a wasm-compatible wall-clock implementation; a target compile alone will not reveal every unsupported std runtime operation.

Bound persistence and compute

Treat scenario JSON as untrusted. Enforce byte limits before parsing where the platform permits, deny unknown fields, avoid browser-unsafe numeric encodings, and make failed load/save/apply operations preserve active state.

For optional GPU advisory compute, publish the CPU oracle first. Carry epoch/request/model/source metadata, allow one in-flight readback, coalesce newer work, reject stale or non-finite results, compare with an explicit tolerance, and disable the GPU path for the failed device epoch while retaining CPU output. Never claim acceleration without measurements.

Verify in layers

Run formatting, strict Clippy, all headless tests, native release compilation, wasm target compilation, and the repository-owned pinned bundle script. Add source contract tests for cfg-sensitive browser code where native test runners cannot execute it. Then test native and browser runtime separately.

Report these as distinct evidence:

  • headless semantics;
  • native compilation;
  • wasm compilation;
  • bundle generation;
  • provider CI execution;
  • live native surface and first frame;
  • live browser canvas, WebGPU, input, and storage;
  • adapter-specific compute parity;
  • manual visual acceptance.

Never promote configuration, compilation, generated artifacts, an adapter skip, or a single-platform smoke into broader runtime support.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Maintain the Abbey / Aviva / Abi Discord system prompts in the Rust abbey-bot (`src/ask.rs`) and keep the hosted Grok bots (Grok Bot Abbey, Aviva Grok) in step with them. Use when the user says "improve grok bots", "abbey prompt", "persona prompt", "ask.rs", "system prompt", "tip floor", asks to change how Abbey/Aviva/Abi speak on Discord, or after an abbey-bot PR merges and the hosted bot's tip floor needs bumping. Runs as /abbey-system-prompt.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Validate ABI docs and external collateral against repo evidence and docs/contracts/external-claims-audit.mdx. Use when auditing claims, scanning docs for unsupported QPS/sharding/FHE/AES language, checking one claim before publish, or re-confirming the external-claims audit. Agent procedure only — not a CLI or slash command. Pair with abi-doc-claims-sync when editing docs.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Synchronize ABI Markdown and docs claims with executable behavior. Use before editing README, AGENTS.md, CLAUDE.md, GEMINI.md, docs/**/*.mdx, walkthroughs, changelogs, or any old ABI Markdown that mentions WDBX, MCP, GPU, clustering, compression, FHE, agents, or benchmarks.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Plan and execute ABI repo work from the TODO board, roadmap/spec docs, stable Rust 1.99.1 constraints, and validation gates. Use when the user asks to find ABI todos/roadmaps, organize a large implementation from tasks/todo.md, or decide the next safe work slice. Distinct from the goals skill — that skill owns the persistent ledger tasks/goals.md; this skill plans from the active board and north-star specs.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Validate ABI MCP JSON-RPC stdio and its custom loopback HTTP compatibility endpoint, including auth, limits, notifications, and shutdown.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Review ABI's 16 compiled-in plugin fixtures, manifest validation, manual bundled registry, and real CLI/MCP run dispatch without claiming dynamic loading.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

See all skills by donaldfilimon

Report a problem with this skill