feat(playset): scene3d surface + GameBlocks port + native wgpu core — rally renders#85
Draft
doodlewind wants to merge 8 commits into
Draft
feat(playset): scene3d surface + GameBlocks port + native wgpu core — rally renders#85doodlewind wants to merge 8 commits into
doodlewind wants to merge 8 commits into
Conversation
…, foundation modules - scene3d: closed write-only presentation vocabulary (ops.ts), retained guest mirror with batched pose flush (client.ts), renderless sim host with canonical serialization for goldens (sim.ts), <Viewport3D> - playset/math: clean-room three@0.161-compatible math subset - modules/math: WorldBasis, Vector3Utils, Scalar/Random/TimeUtils ports (Clock defaults to the virtual clock, never Date.now) - modules/physics: deterministic CollisionWorld (capsule resolve, raycasts, walkable tops) — the injected-Rapier replacement seam - loop.ts: fixed 1/60 game loop, hz-invariant via ticksPerFrame catch-up Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
actor-motion (18), behavior (6), camera (5), gameplay (8), math (5), user-interface (8), world (24) — kebab-case files, PascalCase exports, verbatim semantics with per-file deviation notes and MIT attribution. Reengineered seams (documented in headers): - KinematicBatchResolver + DynamicCarBatchResolver run on the deterministic CollisionWorld (Rapier replaced; dynamic car is a kinematic raycast-vehicle approximation pending the native block) - AimResolver picks via CollisionWorld.raycast + Camera3D.rayFromNdc - visual factories/effects build SceneNode trees; JetFlame shader -> additive cones; tire marks/tracers -> beam pools; shadows -> blob-shadow.ts decals - DOM/Canvas2D HUD -> Solid components (radar/minimap as View trees) 243 new tests (344 total in playset/), all green; repo test script now runs playset/test/. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- demos/rally: checkpoint-racing demo composing track environment, arcade car + AI rival (waypoint driver), kinematic resolver, chase camera, Viewport3D + HUD (lap/standings/minimap) - playset/test/rally-sim.test.ts: host-sim goldens — byte-identical framebuffer + scene3d serialization across boots, 30/60 Hz exact subsampling relation, graceful no-s3 degradation - summary.md (77-entry catalog), README.md, SKILL.md with the Three.js -> playset porting mapping table Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…kdrop Core emits sceneQuad(xy, wh, handle) at a node's world AABB before its background when the host has bound a scene3d scene (host-written prop, never app code). All DrawList consumers skip it gracefully: wasm raster and PSP GE draw nothing (graceful absence), pocket-ui-wgpu skips (the 3D-capable host composites from the same DrawList). No golden drift — the prop is only ever set by hosts with a scene3d core. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…top host New pocket3d/crates/pocket-scene3d: retained store implementing the scene3d contract (sim.ts semantics: id lifecycle, silent dead-handle ops, pool replace+clamp, heightfield tessellation with smooth normals), rquickjs mount as globalThis.s3, and a wgpu renderer — per-scene pass into the sceneQuad rect: gradient sky, per-vertex sun+hemisphere lit meshes with linear fog (fixed-function honest), back-to-front transparent/additive, camera-facing sprite pools + view-aligned beams. pocket-ui-wgpu grows scene_quads() (DrawList walker) + UiSurface set_prop passthrough. uihost mounts s3 before eval, bridges bindViewport -> PROP.scene3d, composites scenes under the ui layer (LoadOp::Load), adds --hold for scripted screenshot input. rally verified visually at 480x272 (terrain/fog/cars/gates/HUD); hero-main regression unchanged; 12 crate tests + full bun run test green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…he PSP host pocket-scene3d store goes no_std+alloc behind a feature gate (desktop keeps mount+wgpu under default 'std'; BTreeMap swap, fmath shim) so both hosts share one semantics. native/ gains scene3d.rs (globalThis.s3 over the QuickJS C API, bindViewport -> PROP.scene3d) and ge3d.rs (SCENE_QUAD compositor: rect-scoped viewport/scissor, depth-only clear, gouraud sky strip, GE hardware sun + hemisphere-average ambient, sceGuFog, additive pools, 2D-clean exit state). Always-on perf probe logs avg_js_us every 300 frames for the 333MHz hardware spike (bun run hw rally -r). PPSSPP-verified: rally f10/f240 at RMSE 5.4%/5.3% vs the desktop wgpu references; all 23 PSP ui goldens byte-exact; tape:check 180 frames; desktop uihost screenshot byte-identical after the store rework. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three ports following the rally pipeline (fixed-step sim, seeded PRNG, Viewport3D + HUD, sim-host goldens, uihost screenshot verification): - runner: 3-lane endless runner (jump/slide, coins/boost, difficulty ramp, snow sprite pool) — clean-room glue, numbers from the original - dogfight: the flight+combat+UI showcase — 17 playset modules as-is, FlightHud + HeadingRelativeRadar in action, wave AI, missile lock, terrain crash referee - snake: 16x16 grid arena vs A*/flood-fill AI rival, cadence ramp 16 new sim tests (byte-identical two-boot traces, 30/60 Hz subsampling, no-s3 degradation, gameplay probes); all bundles in the test chain. Module adaptations: WeaponEffectsSystem gains tracerWidth/particleSize options; FlightHud gets font classes + 480x272 layout fixes (unclassed Text renders nothing on native hosts — systemic gap noted for core). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Playset — Three.js mini-games (GameBlocks-class) running on Pocket, end to end: framework, native rendering on desktop wgpu AND PSP GE, and the first four games.
Same bundle on the PSP host under PPSSPP: RMSE 5.4% vs the desktop frame. Wave-1 ports: runner · dogfight · snake
Layers
scene3dsurface (playset/scene3d/) — closed write-only 3D presentation vocabulary (the 3D sibling ofui): batchedwritePoses, primitives/heightfield/mesh, vertex-lit fixed-function-honest materials, sun/hemisphere/fog/sky, sprite & beam pools,bindViewportper the<Video>precedent. TS client +<Viewport3D>+ renderless sim host for goldens.playset/modules/— all 74 GameBlocks modules (MIT, attributed) + 3 natives (deterministicCollisionWorldreplacing Rapier, blob-shadow, color-utils). Copy-into-project source perSKILL.md(with the Three.js → playset mapping table).PROP.scene3d+DRAW_OP.sceneQuadthrough spec/core (all four DrawList consumers; graceful absence, zero golden drift). Desktop:pocket3d/crates/pocket-scene3d(retained store + rquickjss3mount + wgpu vertex-lit renderer), composited inuihost. PSP: the store goes no_std behind a feature gate (one semantics, two hosts — the pocket3d-bsp pattern) withnative/src/{scene3d,ge3d}.rs: QuickJS C-API mount, GE hardware sun + hemisphere-average ambient,sceGuFog, depth-only clear, additive pools, 2D-clean exit. Always-on perf probe (avg_js_usper 300 frames) answers the 333 MHz QuickJS question on hardware:bun run hw rally -r.demos/rally(original composition) + wave-1 portsdemos/runner,demos/dogfight(17 modules as-is; FlightHud + radar in action),demos/snake(A*/flood-fill AI rival). Each: fixed-step deterministic sim, two-boot byte-identical goldens, exact 30↔60 Hz subsampling, no-s3 degradation, uihost screenshots in-repo.Validation
bun run testbuilds all five game bundles);tsc --noEmitclean; 12pocket-scene3dcargo tests; no_std build clean; clippy cleantape:check180 frames, rally renders at RMSE 5.4%/5.3% vs desktop refshero-mainscreenshot: pixel-identical (2D path inert)Follow-ups
GameInput, flight-pursuit behavior module, per-target hit radii on projectiles, default font slot for unclassedText(systemic), point-light verb,frameBoundscamera solver, BoardEnvironment rim option, exp fogpocket portfunnel skillbun run hw rally -ron the real PSP (PSPLINK console prints the probe)🤖 Generated with Claude Code