Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(aot): the suite's world can answer for its layout, and the gap is named

yhh141dd555a2ac
diff --git a/sdk/tests/mocks/wasm.ts b/sdk/tests/mocks/wasm.ts
index a43f890cc..f4a228f8c 100644
--- a/sdk/tests/mocks/wasm.ts
+++ b/sdk/tests/mocks/wasm.ts
@@ -37,6 +37,14 @@ export function createMockModule(): MockModule {
entityCount: () => entities.size,
+ /**
+ * Every engine pool's version. A constant, and the TRUTH rather than a
+ * stub: this registry keeps components in JS maps, so nothing here has
+ * an address that can move. Null would mean "assume everything moved",
+ * which kept the AOT row cache from ever being reused in a suite.
+ */
+ layoutEpoch: () => 0,
+
// Mirrors ecs::setParent: both halves of the link, or neither.
setParent: (child: Entity, parent: Entity) => {
const detach = (): void => {
diff --git a/tools/lib/aotDuties.mjs b/tools/lib/aotDuties.mjs
index dd1beeb27..74e6aab0e 100644
--- a/tools/lib/aotDuties.mjs
+++ b/tools/lib/aotDuties.mjs
@@ -65,8 +65,12 @@ export const DUTIES = [
native: [{ path: 'tools/verify-native-conformance.mjs', probe: /about the resource/ }],
},
owed: {
- web: "the suite's world answers no layout epoch — its engine is a mock — so the "
- + 'wasm road repacks every frame and the reuse is never taken',
+ // The suite's world answers an epoch now, so the cached table IS
+ // reused — it never was before. What is left unsampled is narrower:
+ web: 'membership is caught by the query cache on its own (`entities !== '
+ + 'packedFrom[k]`), so what the epoch ALONE guards is a pool that '
+ + 'relocated under a matched set that did not change — which takes a '
+ + 'two-component query grown by entities it does not match',
},
},
{