Skip to content

Promote develop to main: new games install the newest engine (release 0.3.14) - #671

Open
jonit-dev wants to merge 4 commits into
mainfrom
develop
Open

jonit-dev wants to merge 4 commits into
mainfrom
develop

Conversation

@jonit-dev

@jonit-dev jonit-dev commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What is this PR about?

New games now install the newest published engine. Starter kits declare >=0.3.14 for @threenative/* instead of an exact version. create-threenative stays exact.

Why does it matter?

Before, a new game got the engine that was current when create-threenative was last published. An engine patch reached new games only after a CLI repack. This PR publishes [email protected] so the floating templates reach users.

Done

  • ✅ e64ab4af3 — templates float the engine with a floor (it was pushed straight to main; develop now carries it too).

  • ✅ Review fix: the dead CORE_TEMPLATE_FLOOR export and an unused import are gone.

  • ✅ Test fix: build.spec and publication.spec expected exact pins and were red after e64ab4af3. They now read the form from scripts/version-range.ts.

  • ✅ Release cohort prepared: core 0.3.13 → 0.3.14, create-threenative 0.2.18 → 0.2.19, MCP surfaces regenerated, scaffold hashes re-pinned.

  • ✅ Flake fix (88389d95f): template-nonvisual (shooter) failed twice on this PR with RangeError: Offset is outside the bounds of the DataView. Cause: in the threaded Wasm build, a pool worker grows shared memory and the game thread's HEAPU8 keeps the old length. The bridge now refreshes its views when a read passes the cached length. That is one integer compare, and no memory.buffer read on the hot path. Red-green test in bridge-crossings.spec.ts.

Checks run locally

  • ✅ pnpm release:prepare — publish-state check passed, "Nothing was published".
  • ✅ Related vitest: 151 files, 2206 tests passed (packages/create-threenative/__tests__, version-range, check-version-pins, check-publish-state, release, prepare-release, engine-mcp server).
  • ✅ vitest packages/three-native/__tests__: 602 of 602 passed after the flake fix.
  • ✅ pnpm typecheck, pnpm lint (warnings only), check-version-pins.
  • ⚠️ Full board not run locally; CI runs it on this PR.

Risk

  • ⚠️ >= has no ceiling: a future breaking major reaches new games from old templates. Existing games stay frozen by their pnpm-lock.yaml.

…an unused import

Review of e64ab4a: CORE_TEMPLATE_FLOOR claimed the scaffolder writes it, but only its own
test read it; check-publish-state imported satisfiesSpecifier and never called it.
…an exact version

e64ab4a moved templates to `>=` for @threenative/*, but build.spec and publication.spec
still compared each pin to the exact workspace version, so three tests went red on main.
They now read the expected form from scripts/version-range.ts, the one owner of it.
The floating-template change (e64ab4a) reaches new games only once create-threenative
publishes again, and 0.2.18 is already on npm. release:prepare bumped the cohort
(core 0.3.14, create-threenative 0.2.19), regenerated the MCP tool surfaces and
re-pinned the scaffold hashes. Its publish-state check passed.
The threaded Wasm build runs on shared memory, which any thread can grow.
Emscripten refreshes a thread's views only inside its own glue
(growMemViews), so after a pool worker grew the memory the game thread's
HEAPU8 kept the old length. A pointer the engine handed back past it threw
"Offset is outside the bounds of the DataView" in readValue: the
intermittent template-nonvisual (shooter) boot red.

A shared buffer never detaches, so a short view stays right below its end.
The bridge now refreshes only when an access passes its cached heapBytes
(an integer compare, no memory.buffer read per crossing): view(end),
wordView(end) and reach(end) at readValue, alloc's zeroing, attribute
views, readDoubles/writeDouble/readByte/writeByte/readWord and heapF64(end).
The refresh (heapFor in browser-abi-types) rebuilds from memory.buffer and
puts the fresh HEAPU8/HEAPF64 on the module, and the cold readers that take
a raw _malloc pointer (renderer handles and read-backs, storage read-back,
TSL uniform-read cache, matrix copy/equals) pass their end to it. The
identity test for non-shared memory is unchanged.

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