Skip to content

feat: full Box3D API parity, parity gate and upstream-sample demo - #7

Open
FRSgit wants to merge 3 commits into
mainfrom
feat/api-parity-demo
Open

FRSgit wants to merge 3 commits into
mainfrom
feat/api-parity-demo

Conversation

@FRSgit

@FRSgit FRSgit commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

  • API parity: 478 of 577 pinned B3_API functions wrapped (meshes, heightfields, hulls, compounds, multi-hit queries, mover, contacts/sensors, JS callbacks, debug draw, standalone collision, accessors); 99 skipped with written reasons.
  • Drift guard: parity/manifest.json + test/parity.test.ts fail on unclassified upstream functions, def fields, enums, structs or constants; weekly upstream-drift workflow; .claude/skills/update-box3d.
  • Perf/correctness: per-world event buffers, O(1) body destroy, double-free guard, allocation-free hot paths, bulk TransformBatch, opt-in LTO. Unit quaternions pass through unchanged, so the ragdoll determinism golden (step 274, 0x773AB8ED) matches native.
  • Demo: sample framework (picker, debug draw, mouse-joint, shooting, solver panel, diagnostics) and 151 of 154 upstream samples (3 skipped: Replay, Ragdoll/Pose, Gyroscopic Precession).

Known gaps

  • Far* samples run at the origin (no double precision); Village and Tree benchmark are reduced; GJK/SAT-cache displays are unavailable (TODO(api) in code).
  • Samples were verified headlessly; browser rendering is being checked separately.

Test plan

  • pnpm build && pnpm test (893 passed, 9 skipped), pnpm lint, pnpm typecheck, pnpm parity:strict
  • demo build
  • browser check of mesh/heightfield/hull rendering, third-person camera, pointer lock

🤖 Generated with Claude Code

FRSgit and others added 3 commits October 8, 2026 11:44
Library
- Wrap meshes, heightfields, hulls, compounds and builders, multi-hit
  casts/overlaps, character-mover planes, contacts and sensor overlaps,
  JS callbacks, debug draw, standalone collision/distance/TOI, and many
  scalar accessors. 478 of 577 upstream functions wrapped, 99 skipped
  with a documented reason.
- Per-world event buffers, O(1) body destroy, double-free guard, input
  validation, allocation-free hot paths and bulk TransformBatch.
- Pass unit quaternions through unchanged so results are bit-identical
  to native Box3D (ragdoll determinism golden matches).

Drift guard
- parity/manifest.json plus test/parity.test.ts fail on any unclassified
  upstream function, def field, enum, struct or constant change.
- Weekly upstream-drift workflow and .claude/skills/update-box3d.

Demo
- Sample framework (registry, picker, debug draw, mouse-joint, shooting,
  solver panel, diagnostics) and 151 of 154 upstream samples ported.
import.meta.env was read through an alias, so vite never substituted it and
the OBJ/tree fetches went to /meshes instead of /box3d-wasm/meshes (404 in
dev and on Pages). Found by loading every sample in Chrome.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The root vitest typecheck includes docs/src, which has no vite/client types.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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