@flighthq/render 0.3.0-next.1032.e2b99fc → 0.3.0-next.1220.6982c21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,8 @@ export * from './renderMaterial';
9
9
  export * from './renderProxy';
10
10
  export * from './renderProxyAdapter';
11
11
  export * from './renderQueue';
12
+ export * from './renderRegistryGuards';
13
+ export * from './renderRegistrySignals';
12
14
  export * from './renderState';
13
15
  export * from './renderTarget';
14
16
  export * from './renderTransform2d';
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
package/dist/contract.js CHANGED
@@ -9,6 +9,8 @@ export * from './renderMaterial';
9
9
  export * from './renderProxy';
10
10
  export * from './renderProxyAdapter';
11
11
  export * from './renderQueue';
12
+ export * from './renderRegistryGuards';
13
+ export * from './renderRegistrySignals';
12
14
  export * from './renderState';
13
15
  export * from './renderTarget';
14
16
  export * from './renderTransform2d';
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { createRenderCache, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
1
+ export { createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRenderRegistryMisses, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { createRenderCache, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
1
+ export { createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRenderRegistryMisses, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderProxy.d.ts","sourceRoot":"","sources":["../src/renderProxy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EAEd,UAAU,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AASlC,KAAK,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;AAEvF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,WAAW,CAyBrF;AAKD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,kBAAkB,GACvD,aAAa,CAMf;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAM/E;AASD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAE/E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,a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,EAAE,WAAW,EAClB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,aAAa,GAAG,SAAS,GACpC,IAAI,CASN;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAWrF;AAeD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAgDjG"}
@@ -1,7 +1,8 @@
1
1
  import { createEntity } from '@flighthq/entity/contract';
2
2
  import { createMatrix } from '@flighthq/geometry/contract';
3
3
  import { getNodeAppearanceRevision, getNodeLocalContentRevision, getNodeLocalTransformRevision, getNodeParent, getNodeRuntime, } from '@flighthq/node/contract';
4
- import { BlendMode } from '@flighthq/types/contract';
4
+ import { emitSignal } from '@flighthq/signals/contract';
5
+ import { BlendMode, RenderRegistry } from '@flighthq/types/contract';
5
6
  import { updateRenderProxyAppearance } from './renderAppearance';
6
7
  import { updateRenderProxyColorScaleBias } from './renderColorScaleBias';
7
8
  import { updateRenderProxyMaterial } from './renderMaterial';
@@ -9,7 +10,7 @@ import { getRenderStateRuntime } from './renderState';
9
10
  import { updateRenderProxy2DTransform } from './renderTransform2d';
10
11
  export function createRenderProxy(state, source) {
11
12
  const runtime = getRenderStateRuntime(state);
12
- const renderer = runtime.rendererMap.get(source.kind) ?? null;
13
+ const renderer = resolveRenderProxyRenderer(state, source.kind);
13
14
  return createEntity({
14
15
  source: source,
15
16
  kind: source.kind,
@@ -48,13 +49,15 @@ export function createRenderProxy2D(state, source) {
48
49
  // renderer's destroyData to free the non-GC GPU resources it owns. Call when a node is removed from
49
50
  // rendering for good — otherwise those GPU textures/framebuffers linger until the source is GC'd.
50
51
  export function disposeRenderProxy(state, source) {
51
- const renderProxyMap = getRenderStateRuntime(state).renderProxyMap;
52
+ const runtime = getRenderStateRuntime(state);
53
+ const renderProxyMap = runtime.renderProxyMap;
52
54
  const node = renderProxyMap.get(source);
53
55
  if (node === undefined)
54
56
  return;
55
57
  if (node.rendererData !== null)
56
58
  node.renderer?.destroyData?.(state, node.rendererData);
57
59
  renderProxyMap.delete(source);
60
+ runtime.renderProxySources.delete(source);
58
61
  }
59
62
  // Teardown counterpart to prepareScene2DRender: disposes the render of `root` and every descendant —
60
63
  // the render proxies that prepareScene2DRender created. Each disposeRenderProxy cascades to the
@@ -73,6 +76,7 @@ export function getOrCreateRenderProxy2D(state, source) {
73
76
  if (!node) {
74
77
  node = createRenderProxy2D(state, source);
75
78
  renderProxyMap.set(source, node);
79
+ runtime.renderProxySources.add(source);
76
80
  }
77
81
  if (node.rendererMapId !== runtime.rendererMapId) {
78
82
  updateRenderProxyRenderer(state, node);
@@ -128,7 +132,7 @@ export function updateRenderProxy2D(state, source, data, parentData) {
128
132
  }
129
133
  export function updateRenderProxyRenderer(state, node) {
130
134
  const runtime = getRenderStateRuntime(state);
131
- const renderer = runtime.rendererMap.get(node.kind) ?? null;
135
+ const renderer = resolveRenderProxyRenderer(state, node.kind);
132
136
  if (node.renderer !== renderer || node.rendererDataSource !== node.source) {
133
137
  // Free the outgoing renderer's GPU resources before replacing the data it owned.
134
138
  if (node.rendererData !== null)
@@ -139,12 +143,21 @@ export function updateRenderProxyRenderer(state, node) {
139
143
  }
140
144
  node.rendererMapId = runtime.rendererMapId;
141
145
  }
146
+ function resolveRenderProxyRenderer(state, kind) {
147
+ const runtime = getRenderStateRuntime(state);
148
+ const renderer = runtime.rendererMap.get(kind);
149
+ if (renderer === undefined && runtime.registrySignals !== null) {
150
+ emitSignal(runtime.registrySignals.onRegistryMiss, RenderRegistry.NodeRenderer, kind);
151
+ }
152
+ return renderer ?? null;
153
+ }
142
154
  // One generic, dirty-checked pre-order walk over the 2D node graph. `visit` composes the trait
143
155
  // update* steps. Sprites and display objects share this single traversal and a single render-node
144
156
  // type — what differs is the traits they carry, not the path. Clip is not handled here: it is a
145
157
  // trait update step in the visitor (updateNodeClip), realized at draw time by the backend clip hooks.
146
158
  export function walkNode(state, root, visit) {
147
159
  const runtime = getRenderStateRuntime(state);
160
+ runtime.renderRootGuard?.(state, root);
148
161
  ++runtime.currentFrameId;
149
162
  const tempStack = runtime.tempStack;
150
163
  let stackLength = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"renderProxy.js","sourceRoot":"","sources":["../src/renderProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,cAAc,GACf,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAInE,MAAM,UAAU,iBAAiB,CAAC,KAAkB,EAAE,MAAkB;IACtE,MAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC9D,OAAO,YAAY,CAAC;QAClB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,iBAAiB,EAAE,CAAC,CAAC;QACrB,SAAS,EAAE,SAAS,CAAC,MAAM;QAC3B,cAAc,EAAE,IAAI;QACpB,WAA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M,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC9C,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAA0B,CAAC;gBAClE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,+FAA+F;AAC/F,gGAAgG;AAChG,8FAA8F;AAC9F,wGAAwG;AACxG,SAAS,iBAAiB,CACxB,KAAkB,EAClB,IAAgB,EAChB,KAAqD;IAErD,MAAM,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;IACzD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEpB,OAAO,WAAW,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,WAAW,CAAe,CAAC;QACvD,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACtB,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAe,CAAC,CAAC,QAAQ,CAAC;QAC1D,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9C,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAA0B,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { RenderRegistryMissExplanation, RenderState } from '@flighthq/types/contract';
2
+ export declare function areRenderRegistryGuardsEnabled(state: RenderState): boolean;
3
+ export declare function enableRenderRegistryGuards(state: RenderState): void;
4
+ export declare function explainRenderRegistryMisses(state: RenderState): RenderRegistryMissExplanation;
5
+ //# sourceMappingURL=renderRegistryGuards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderRegistryGuards.d.ts","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA4B,6BAA6B,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAKrH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE1E;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAQnE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,6BAA6B,CAM7F"}
@@ -0,0 +1,57 @@
1
+ import { logOnce } from '@flighthq/log/contract';
2
+ import { connectSignal } from '@flighthq/signals/contract';
3
+ import { LogLevel, RenderRegistry } from '@flighthq/types/contract';
4
+ import { enableRenderRegistrySignals } from './renderRegistrySignals';
5
+ export function areRenderRegistryGuardsEnabled(state) {
6
+ return _stateIds.has(state);
7
+ }
8
+ export function enableRenderRegistryGuards(state) {
9
+ if (_stateIds.has(state))
10
+ return;
11
+ const stateId = ++_nextStateId;
12
+ _stateIds.set(state, stateId);
13
+ _stateMisses.set(state, []);
14
+ connectSignal(enableRenderRegistrySignals(state).onRegistryMiss, (registry, kind) => {
15
+ recordRenderRegistryMiss(state, stateId, registry, kind);
16
+ });
17
+ }
18
+ export function explainRenderRegistryMisses(state) {
19
+ const misses = _stateMisses.get(state) ?? [];
20
+ return {
21
+ misses: misses.map((miss) => ({ kind: miss.kind, registry: miss.registry })),
22
+ status: misses.length === 0 ? 'complete' : 'misses-recorded',
23
+ };
24
+ }
25
+ function getRenderRegistryMissMessage(state, registry) {
26
+ switch (registry) {
27
+ case RenderRegistry.EffectPaddingResolver:
28
+ return 'computeRenderEffectPadding: effect kind has no registered padding resolver — call registerRenderEffectPaddingResolver(state, kind, resolver)';
29
+ case RenderRegistry.NodeRenderer:
30
+ return 'createRenderProxy: node kind has no registered renderer — call registerRenderer(state, kind, renderer)';
31
+ case RenderRegistry.ShapeCommandHandler:
32
+ return 'renderCanvasShapeCommands: shape command key has no registered handler — call registerCanvasShapeCommand(command)';
33
+ case RenderRegistry.TextureResolver:
34
+ if ('gl' in state)
35
+ return 'resolveGlTexture: texture source kind has no registered resolver — call registerGlTextureResolver(state, sourceKind, resolver), or copyGlRenderStateRegistrations(offscreenState, screenState) after a late screen registration';
36
+ if ('device' in state)
37
+ return 'resolveWgpuTexture: texture source kind has no registered resolver — call registerWgpuTextureResolver(state, sourceKind, resolver)';
38
+ if ('element' in state)
39
+ return 'resolveDomTexture: texture source kind has no registered resolver — call registerDomTextureResolver(state, sourceKind, resolver)';
40
+ return 'resolveCanvasTexture: texture source kind has no registered resolver — call registerCanvasTextureResolver(state, sourceKind, resolver)';
41
+ }
42
+ }
43
+ function recordRenderRegistryMiss(state, stateId, registry, kind) {
44
+ const misses = _stateMisses.get(state);
45
+ if (misses === undefined || misses.some((miss) => miss.registry === registry && miss.kind === kind))
46
+ return;
47
+ misses.push({ kind, registry });
48
+ logOnce(`render:registry-miss:${stateId}:${registry}:${kind}`, LogLevel.Warn, {
49
+ kind,
50
+ message: getRenderRegistryMissMessage(state, registry),
51
+ registry,
52
+ }, 'render');
53
+ }
54
+ const _stateIds = new WeakMap();
55
+ const _stateMisses = new WeakMap();
56
+ let _nextStateId = 0;
57
+ //# sourceMappingURL=renderRegistryGuards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderRegistryGuards.js","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,UAAU,8BAA8B,CAAC,KAAkB;IAC/D,OAAO,SAA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AC,eAAe;YACjC,IAAI,IAAI,IAAI,KAAK;gBACf,OAAO,iOAAiO,CAAC;YAC3O,IAAI,QAAQ,IAAI,KAAK;gBACnB,OAAO,oIAAoI,CAAC;YAC9I,IAAI,SAAS,IAAI,KAAK;gBACpB,OAAO,kIAAkI,CAAC;YAC5I,OAAO,wIAAwI,CAAC;IACpJ,CAAC;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAkB,EAAE,OAAe,EAAE,QAAwB,EAAE,IAAU;IACzG,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO;IAC5G,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAChC,OAAO,CACL,wBAAwB,OAAO,IAAI,QAAQ,IAAI,IAAI,EAAE,EACrD,QAAQ,CAAC,IAAI,EACb;QACE,IAAI;QACJ,OAAO,EAAE,4BAA4B,CAAC,KAAK,EAAE,QAAQ,CAAC;QACtD,QAAQ;KACT,EACD,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,OAAO,EAAuB,CAAC;AACrD,MAAM,YAAY,GAAG,IAAI,OAAO,EAAqC,CAAC;AACtE,IAAI,YAAY,GAAG,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { RenderRegistrySignals, RenderState } from '@flighthq/types/contract';
2
+ export declare function enableRenderRegistrySignals(state: RenderState): RenderRegistrySignals;
3
+ //# sourceMappingURL=renderRegistrySignals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderRegistrySignals.d.ts","sourceRoot":"","sources":["../src/renderRegistrySignals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMnF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,qBAAqB,CAGrF"}
@@ -0,0 +1,9 @@
1
+ import { createSignal } from '@flighthq/signals/contract';
2
+ import { getRenderStateRuntime } from './renderState';
3
+ // Allocates the single release-mode signal seam shared by kind-keyed render registries. Core miss
4
+ // branches remain one null check plus emitSignal; guard policy subscribes from a separate package.
5
+ export function enableRenderRegistrySignals(state) {
6
+ const runtime = getRenderStateRuntime(state);
7
+ return (runtime.registrySignals ??= { onRegistryMiss: createSignal() });
8
+ }
9
+ //# sourceMappingURL=renderRegistrySignals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderRegistrySignals.js","sourceRoot":"","sources":["../src/renderRegistrySignals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,kGAAkG;AAClG,mGAAmG;AACnG,MAAM,UAAU,2BAA2B,CAAC,KAAkB;IAC5D,MAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,CAAC,OAAO,CAAC,eAAe,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { RenderState, RenderStateRuntime } from '@flighthq/types/contract';
2
2
  export declare function createRenderState(obj?: Partial<RenderState>): RenderState;
3
3
  export declare function createRenderStateRuntime(): RenderStateRuntime;
4
+ export declare function destroyRenderState(state: RenderState): void;
4
5
  export declare function getRenderStateRuntime(state: RenderState): RenderStateRuntime;
5
6
  //# sourceMappingURL=renderState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderState.d.ts","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAiBzE;AAOD,wBAAgB,wBAAwB,IAAI,kBAAkB,CAW7D;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,CAE5E"}
1
+ {"version":3,"file":"renderState.d.ts","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG5F,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAiBzE;AAOD,wBAAgB,wBAAwB,IAAI,kBAAkB,CAe7D;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAS3D;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,CAE5E"}
@@ -1,4 +1,5 @@
1
1
  import { createEntity, createEntityRuntime } from '@flighthq/entity/contract';
2
+ import { clearSignal } from '@flighthq/signals/contract';
2
3
  import { BlendMode, EntityRuntimeKey } from '@flighthq/types/contract';
3
4
  export function createRenderState(obj) {
4
5
  const state = createEntity({
@@ -30,14 +31,40 @@ export function createRenderStateRuntime() {
30
31
  runtime.renderAdaptHook = null;
31
32
  runtime.renderProxyAdapterMap = new WeakMap();
32
33
  runtime.renderProxyMap = new WeakMap();
34
+ runtime.renderProxySources = new Set();
35
+ runtime.registrySignals = null;
36
+ runtime.renderEffectPaddingResolverRegistry = null;
37
+ runtime.renderRootGuard = null;
33
38
  runtime.rendererMap = new Map();
34
39
  runtime.rendererMapId = 0;
35
40
  runtime.tempStack = [];
36
41
  return runtime;
37
42
  }
43
+ // Runs every live proxy's renderer teardown hook and clears the state-owned traversal bookkeeping.
44
+ // Backend destroy* functions call this before releasing their own state/context tiers.
45
+ export function destroyRenderState(state) {
46
+ const runtime = getRenderStateRuntime(state);
47
+ for (const source of [...runtime.renderProxySources])
48
+ disposeRenderProxyForShutdown(state, source);
49
+ if (runtime.registrySignals !== null) {
50
+ clearSignal(runtime.registrySignals.onRegistryMiss);
51
+ runtime.registrySignals = null;
52
+ }
53
+ runtime.renderEffectPaddingResolverRegistry = null;
54
+ runtime.tempStack.length = 0;
55
+ }
38
56
  // Resolves the package-private machinery runtime attached to a RenderState. Mutable by design: the
39
57
  // render path writes its fields every frame.
40
58
  export function getRenderStateRuntime(state) {
41
59
  return state[EntityRuntimeKey];
42
60
  }
61
+ function disposeRenderProxyForShutdown(state, source) {
62
+ const runtime = getRenderStateRuntime(state);
63
+ const proxy = runtime.renderProxyMap.get(source);
64
+ if (proxy?.rendererData !== null && proxy?.rendererData !== undefined) {
65
+ proxy.renderer?.destroyData?.(state, proxy.rendererData);
66
+ }
67
+ runtime.renderProxyMap.delete(source);
68
+ runtime.renderProxySources.delete(source);
69
+ }
43
70
  //# sourceMappingURL=renderState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderState.js","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,UAAU,iBAAiB,CAAC,GAA0B;IAC1D,MAAM,KAAK,GAAG,YAAY,CAAC;QACzB,cAAc,EAAE,GAAG,EAAE,cAAc,IAAI,IAAI;QAC3C,eAAe,EAAE,GAAG,EAAE,eAAe,IAAI,CAAC;QAC1C,mBAAmB,EAAE,GAAG,EAAE,mBAAmB,IAAI,EAAE;QACnD,qBAAqB,EAAE,GAAG,EAAE,qBAAqB,IAAI,EAAE;QACvD,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,IAAI,CAAC;QAC5C,sBAA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AO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,KAAK,EAAE,YAAY,KAAK,IAAI,IAAI,KAAK,EAAE,YAAY,KAAK,SAAS,EAAE,CAAC;QACtE,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,10 +1,10 @@
1
- import type { Node2D, MatrixLike, RectangleLike } from '@flighthq/types/contract';
1
+ import type { MatrixLike, Node2D, RectangleLike, RenderEffectPadding, RenderTargetAxes, RenderTargetAxisDifference, RenderTargetDescriptor, ResolvedRenderTargetDescriptor } from '@flighthq/types/contract';
2
2
  /**
3
3
  * Writes into outCacheTransform the transform to pass to the cache resolver so the
4
4
  * cached image is placed back at the original scene position.
5
5
  */
6
6
  export declare function computeRenderCacheTransform(outCacheTransform: MatrixLike, bounds: Readonly<RectangleLike>, contentX?: number, contentY?: number): void;
7
- export declare function computeRenderTargetSize(bounds: Readonly<RectangleLike>, padding?: number, minWidth?: number, minHeight?: number): {
7
+ export declare function computeRenderTargetSize(bounds: Readonly<RectangleLike>, padding?: number | Readonly<RenderEffectPadding>, minWidth?: number, minHeight?: number): {
8
8
  width: number;
9
9
  height: number;
10
10
  };
@@ -14,4 +14,6 @@ export declare function computeRenderTargetSize(bounds: Readonly<RectangleLike>,
14
14
  * that the bounds origin lands at (contentX, contentY).
15
15
  */
16
16
  export declare function computeScene2DRenderTargetTransform(outRenderTransform: MatrixLike, source: Node2D, bounds: Readonly<RectangleLike>, contentX?: number, contentY?: number): void;
17
+ export declare function explainRenderTargetAxes(requested: Readonly<RenderTargetAxes>, effective: Readonly<RenderTargetAxes>): RenderTargetAxisDifference[];
18
+ export declare function resolveRenderTargetDescriptor(descriptor: Readonly<RenderTargetDescriptor>): ResolvedRenderTargetDescriptor;
17
19
  //# sourceMappingURL=renderTarget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderTarget.d.ts","sourceRoot":"","sources":["../src/renderTarget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElF;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,iBAAiB,EAAE,UAAU,EAC7B,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,QAAQ,GAAE,MAAU,EACpB,QAAQ,GAAE,MAAU,GACnB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,OAAO,GAAE,MAAU,EACnB,QAAQ,GAAE,MAAU,EACpB,SAAS,GAAE,MAAU,GACpB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKnC;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,kBAAkB,EAAE,UAAU,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,QAAQ,GAAE,MAAU,EACpB,QAAQ,GAAE,MAAU,GACnB,IAAI,CAUN"}
1
+ {"version":3,"file":"renderTarget.d.ts","sourceRoot":"","sources":["../src/renderTarget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,iBAAiB,EAAE,UAAU,EAC7B,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,QAAQ,GAAE,MAAU,EACpB,QAAQ,GAAE,MAAU,GACnB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,OAAO,GAAE,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAK,EACnD,QAAQ,GAAE,MAAU,EACpB,SAAS,GAAE,MAAU,GACpB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAOnC;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,kBAAkB,EAAE,UAAU,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,QAAQ,GAAE,MAAU,EACpB,QAAQ,GAAE,MAAU,GACnB,IAAI,CAUN;AAID,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EACrC,SAAS,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GACpC,0BAA0B,EAAE,CAa9B;AAKD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAC3C,8BAA8B,CAsBhC"}
@@ -13,9 +13,11 @@ export function computeRenderCacheTransform(outCacheTransform, bounds, contentX
13
13
  outCacheTransform.ty = bounds.y - contentY;
14
14
  }
15
15
  export function computeRenderTargetSize(bounds, padding = 0, minWidth = 1, minHeight = 1) {
16
+ const horizontal = typeof padding === 'number' ? padding * 2 : padding.left + padding.right;
17
+ const vertical = typeof padding === 'number' ? padding * 2 : padding.top + padding.bottom;
16
18
  return {
17
- width: Math.max(minWidth, Math.ceil(bounds.width) + padding * 2),
18
- height: Math.max(minHeight, Math.ceil(bounds.height) + padding * 2),
19
+ width: Math.max(minWidth, Math.ceil(bounds.width) + horizontal),
20
+ height: Math.max(minHeight, Math.ceil(bounds.height) + vertical),
19
21
  };
20
22
  }
21
23
  /**
@@ -34,6 +36,54 @@ export function computeScene2DRenderTargetTransform(outRenderTransform, source,
34
36
  _tempTranslation.ty = contentY - bounds.y;
35
37
  multiplyMatrix(outRenderTransform, _tempTranslation, _tempInvLocal);
36
38
  }
39
+ // Returns plain-data axis differences in a stable order. Backends retain the requested and effective
40
+ // shapes, then use this common comparison so every explain* surface reports substitutions uniformly.
41
+ export function explainRenderTargetAxes(requested, effective) {
42
+ const differences = [];
43
+ for (const axis of _renderTargetAxisOrder) {
44
+ const requestedValue = requested[axis];
45
+ const effectiveValue = effective[axis];
46
+ const equal = Array.isArray(requestedValue) && Array.isArray(effectiveValue)
47
+ ? requestedValue.length === effectiveValue.length &&
48
+ requestedValue.every((value, index) => value === effectiveValue[index])
49
+ : requestedValue === effectiveValue;
50
+ if (!equal)
51
+ differences.push({ axis, effective: effectiveValue, requested: requestedValue });
52
+ }
53
+ return differences;
54
+ }
55
+ // Resolves every substrate-independent default and normalization once. Backend realizations start
56
+ // here and apply only device capability substitutions (for example GL MAX_SAMPLES or float-render
57
+ // support), so Canvas/GL/WGPU cannot independently reinterpret the descriptor's optional axes.
58
+ export function resolveRenderTargetDescriptor(descriptor) {
59
+ const width = Math.max(1, Math.ceil(descriptor.width));
60
+ const height = Math.max(1, Math.ceil(descriptor.height));
61
+ const colorAttachments = Math.max(1, Math.ceil(descriptor.colorAttachments ?? 1));
62
+ const defaultFormat = descriptor.format ?? 'rgba8';
63
+ const colorFormats = Array.from({ length: colorAttachments }, (_, index) => descriptor.colorFormats?.[index] ?? defaultFormat);
64
+ return {
65
+ width,
66
+ height,
67
+ format: colorFormats[0],
68
+ colorAttachments,
69
+ colorFormats,
70
+ sampleCount: Math.max(1, Math.ceil(descriptor.sampleCount ?? 1)),
71
+ depth: descriptor.depth ?? 'none',
72
+ colorSpace: descriptor.colorSpace ?? 'srgb',
73
+ clearColors: descriptor.clearColors ? [...descriptor.clearColors] : [],
74
+ clearDepth: descriptor.clearDepth ?? 1,
75
+ };
76
+ }
37
77
  const _tempInvLocal = createMatrix();
38
78
  const _tempTranslation = createMatrix();
79
+ const _renderTargetAxisOrder = [
80
+ 'width',
81
+ 'height',
82
+ 'format',
83
+ 'colorAttachments',
84
+ 'colorFormats',
85
+ 'sampleCount',
86
+ 'depth',
87
+ 'colorSpace',
88
+ ];
39
89
  //# sourceMappingURL=renderTarget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderTarget.js","sourceRoot":"","sources":["../src/renderTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,iBAA6B,EAC7B,MAA+B,EAC/B,WAAmB,CAAC,EACpB,WAAmB,CAAC;IAEpB,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC3C,iBAAiB,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAA+B,EAC/B,UAAkB,CAAC,EACnB,WAAmB,CAAC,EACpB,YAAoB,CAAC;IAErB,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAChE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC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;CACb,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { Kind, Renderable, Renderer, RendererData, RenderState } from '@flighthq/types/contract';
2
2
  export declare function copyAllRenderersFromRenderState(target: RenderState, source: RenderState): void;
3
3
  export declare function copyRenderersFromRenderState(target: RenderState, source: RenderState): void;
4
+ export declare function copyRenderStateRegistrations(target: RenderState, source: RenderState): void;
4
5
  export declare function noopRendererData(_state: RenderState, _source: Renderable): RendererData | null;
5
6
  export declare function registerRenderer(state: RenderState, kind: Kind, renderer: Renderer): void;
6
7
  export declare function registerRenderers(state: RenderState, entries: ReadonlyArray<readonly [Kind, Renderer]>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMtG,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAG9F;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAI3F;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAE9F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAKzF;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAE7G"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMtG,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAG9F;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAI3F;AAID,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAK3F;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAE9F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAKzF;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAE7G"}
package/dist/renderer.js CHANGED
@@ -11,6 +11,14 @@ export function copyRenderersFromRenderState(target, source) {
11
11
  registerRenderer(target, kind, renderer);
12
12
  });
13
13
  }
14
+ // Copies the backend-agnostic policy registries that participate in pipeline derivation. Maps are
15
+ // cloned, never aliased: derived states start with a snapshot and diverge until an explicit re-copy.
16
+ export function copyRenderStateRegistrations(target, source) {
17
+ const targetRuntime = getRenderStateRuntime(target);
18
+ const sourceRegistry = getRenderStateRuntime(source).renderEffectPaddingResolverRegistry;
19
+ targetRuntime.renderEffectPaddingResolverRegistry =
20
+ sourceRegistry === null || sourceRegistry === undefined ? null : new Map(sourceRegistry);
21
+ }
14
22
  export function noopRendererData(_state, _source) {
15
23
  return null;
16
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAEA,OA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AAI,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,QAAQ;QAAE,OAAO;IACvD,OAAO,CAAC,aAAa,GAAG,CAAC,OAAO,CAAC,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1D,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,oGAAoG;AACpG,qGAAqG;AACrG,kFAAkF;AAClF,MAAM,UAAU,iBAAiB,CAAC,KAAkB,EAAE,OAAiD;IACrG,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,OAAO;QAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/render",
3
- "version": "0.3.0-next.1032.e2b99fc",
3
+ "version": "0.3.0-next.1220.6982c21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/flighthq/flight.git",
@@ -36,15 +36,15 @@
36
36
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@flighthq/color": "0.3.0-next.1032.e2b99fc",
40
- "@flighthq/entity": "0.3.0-next.1032.e2b99fc",
41
- "@flighthq/geometry": "0.3.0-next.1032.e2b99fc",
42
- "@flighthq/log": "0.3.0-next.1032.e2b99fc",
43
- "@flighthq/materials": "0.3.0-next.1032.e2b99fc",
44
- "@flighthq/mesh": "0.3.0-next.1032.e2b99fc",
45
- "@flighthq/node": "0.3.0-next.1032.e2b99fc",
46
- "@flighthq/signals": "0.3.0-next.1032.e2b99fc",
47
- "@flighthq/types": "0.3.0-next.1032.e2b99fc"
39
+ "@flighthq/color": "0.3.0-next.1220.6982c21",
40
+ "@flighthq/entity": "0.3.0-next.1220.6982c21",
41
+ "@flighthq/geometry": "0.3.0-next.1220.6982c21",
42
+ "@flighthq/log": "0.3.0-next.1220.6982c21",
43
+ "@flighthq/materials": "0.3.0-next.1220.6982c21",
44
+ "@flighthq/mesh": "0.3.0-next.1220.6982c21",
45
+ "@flighthq/node": "0.3.0-next.1220.6982c21",
46
+ "@flighthq/signals": "0.3.0-next.1220.6982c21",
47
+ "@flighthq/types": "0.3.0-next.1220.6982c21"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@flighthq/adjustments": "*",
@@ -0,0 +1,94 @@
1
+ import { addLogSink, createMemoryLogSink, getMemoryLogSinkEntries, removeLogSink } from '@flighthq/log/contract';
2
+ import { emitSignal } from '@flighthq/signals/contract';
3
+ import { RenderRegistry } from '@flighthq/types/contract';
4
+
5
+ import { registerRenderer } from './renderer';
6
+ import { createRenderProxy } from './renderProxy';
7
+ import {
8
+ areRenderRegistryGuardsEnabled,
9
+ enableRenderRegistryGuards,
10
+ explainRenderRegistryMisses,
11
+ } from './renderRegistryGuards';
12
+ import { enableRenderRegistrySignals } from './renderRegistrySignals';
13
+ import { createRenderState } from './renderState';
14
+
15
+ describe('areRenderRegistryGuardsEnabled', () => {
16
+ it('reports whether the state-local registry guard is enabled', () => {
17
+ const state = createRenderState();
18
+ expect(areRenderRegistryGuardsEnabled(state)).toBe(false);
19
+ enableRenderRegistryGuards(state);
20
+ expect(areRenderRegistryGuardsEnabled(state)).toBe(true);
21
+ });
22
+ });
23
+
24
+ describe('enableRenderRegistryGuards', () => {
25
+ it('is idempotent', () => {
26
+ const state = createRenderState();
27
+ enableRenderRegistryGuards(state);
28
+ enableRenderRegistryGuards(state);
29
+ expect(areRenderRegistryGuardsEnabled(state)).toBe(true);
30
+ });
31
+
32
+ it('warns once per state, registry, and kind', () => {
33
+ const firstState = createRenderState();
34
+ const secondState = createRenderState();
35
+ const sink = createMemoryLogSink(4);
36
+ addLogSink(sink.sink);
37
+ enableRenderRegistryGuards(firstState);
38
+ enableRenderRegistryGuards(secondState);
39
+ try {
40
+ createRenderProxy(firstState, { kind: 'acme.Missing' } as never);
41
+ createRenderProxy(firstState, { kind: 'acme.Missing' } as never);
42
+ createRenderProxy(secondState, { kind: 'acme.Missing' } as never);
43
+
44
+ const entries = getMemoryLogSinkEntries(sink);
45
+ expect(entries).toHaveLength(2);
46
+ expect(entries[0]?.data).toMatchObject({
47
+ kind: 'acme.Missing',
48
+ message:
49
+ 'createRenderProxy: node kind has no registered renderer — call registerRenderer(state, kind, renderer)',
50
+ registry: RenderRegistry.NodeRenderer,
51
+ });
52
+ } finally {
53
+ removeLogSink(sink.sink);
54
+ }
55
+ });
56
+
57
+ it('stays silent when the node renderer is registered', () => {
58
+ const state = createRenderState();
59
+ const sink = createMemoryLogSink(1);
60
+ addLogSink(sink.sink);
61
+ enableRenderRegistryGuards(state);
62
+ registerRenderer(state, 'acme.Registered', { createData: () => null, submit: () => {} });
63
+ try {
64
+ createRenderProxy(state, { kind: 'acme.Registered' } as never);
65
+ expect(getMemoryLogSinkEntries(sink)).toHaveLength(0);
66
+ } finally {
67
+ removeLogSink(sink.sink);
68
+ }
69
+ });
70
+ });
71
+
72
+ describe('explainRenderRegistryMisses', () => {
73
+ it('returns each recorded registry and kind pair once in event order', () => {
74
+ const state = createRenderState();
75
+ enableRenderRegistryGuards(state);
76
+ const signals = enableRenderRegistrySignals(state);
77
+ emitSignal(signals.onRegistryMiss, RenderRegistry.TextureResolver, 'acme.Texture');
78
+ emitSignal(signals.onRegistryMiss, RenderRegistry.TextureResolver, 'acme.Texture');
79
+ emitSignal(signals.onRegistryMiss, RenderRegistry.ShapeCommandHandler, 'acme.ShapeCommand');
80
+
81
+ expect(explainRenderRegistryMisses(state)).toEqual({
82
+ misses: [
83
+ { kind: 'acme.Texture', registry: RenderRegistry.TextureResolver },
84
+ { kind: 'acme.ShapeCommand', registry: RenderRegistry.ShapeCommandHandler },
85
+ ],
86
+ status: 'misses-recorded',
87
+ });
88
+ });
89
+
90
+ it('returns a complete empty explanation before any miss is recorded', () => {
91
+ const state = createRenderState();
92
+ expect(explainRenderRegistryMisses(state)).toEqual({ misses: [], status: 'complete' });
93
+ });
94
+ });
@@ -0,0 +1,15 @@
1
+ import { enableRenderRegistrySignals } from './renderRegistrySignals';
2
+ import { createRenderState, getRenderStateRuntime } from './renderState';
3
+
4
+ describe('enableRenderRegistrySignals', () => {
5
+ it('allocates one state-local registry-miss seam and reuses it', () => {
6
+ const state = createRenderState();
7
+ expect(getRenderStateRuntime(state).registrySignals).toBeNull();
8
+
9
+ const signals = enableRenderRegistrySignals(state);
10
+
11
+ expect(signals.onRegistryMiss).toBeDefined();
12
+ expect(getRenderStateRuntime(state).registrySignals).toBe(signals);
13
+ expect(enableRenderRegistrySignals(state)).toBe(signals);
14
+ });
15
+ });
@@ -2,7 +2,7 @@ import { createMatrix } from '@flighthq/geometry/contract';
2
2
  import type { RenderState } from '@flighthq/types/contract';
3
3
  import { BlendMode, EntityRuntimeKey } from '@flighthq/types/contract';
4
4
 
5
- import { createRenderState, createRenderStateRuntime, getRenderStateRuntime } from './renderState';
5
+ import { createRenderState, createRenderStateRuntime, destroyRenderState, getRenderStateRuntime } from './renderState';
6
6
 
7
7
  describe('createRenderState', () => {
8
8
  let state: RenderState;
@@ -85,6 +85,20 @@ describe('createRenderStateRuntime', () => {
85
85
  });
86
86
  });
87
87
 
88
+ describe('destroyRenderState', () => {
89
+ it('clears state-owned traversal and registration storage', () => {
90
+ const state = createRenderState();
91
+ const runtime = getRenderStateRuntime(state);
92
+ runtime.tempStack.push({} as never);
93
+ runtime.renderEffectPaddingResolverRegistry = new Map();
94
+
95
+ destroyRenderState(state);
96
+
97
+ expect(runtime.tempStack).toHaveLength(0);
98
+ expect(runtime.renderEffectPaddingResolverRegistry).toBeNull();
99
+ });
100
+ });
101
+
88
102
  describe('getRenderStateRuntime', () => {
89
103
  it('returns the runtime attached under EntityRuntimeKey', () => {
90
104
  const state = createRenderState();
@@ -1,10 +1,13 @@
1
- import { createMatrix, createRectangle } from '@flighthq/geometry/contract';
1
+ import { createMatrix, createRectangle, multiplyMatrix } from '@flighthq/geometry/contract';
2
+ import { getNodeLocalMatrix } from '@flighthq/node/contract';
2
3
  import { createDisplayObject } from '@flighthq/scene2d/contract';
3
4
 
4
5
  import {
5
- computeScene2DRenderTargetTransform,
6
6
  computeRenderCacheTransform,
7
7
  computeRenderTargetSize,
8
+ computeScene2DRenderTargetTransform,
9
+ explainRenderTargetAxes,
10
+ resolveRenderTargetDescriptor,
8
11
  } from './renderTarget';
9
12
 
10
13
  describe('computeRenderCacheTransform', () => {
@@ -40,6 +43,14 @@ describe('computeRenderTargetSize', () => {
40
43
  expect(result.height).toBe(88);
41
44
  });
42
45
 
46
+ it('adds directional padding on its corresponding sides', () => {
47
+ const result = computeRenderTargetSize(
48
+ { x: -3, y: 4, width: 100, height: 80 },
49
+ { bottom: 7, left: 2, right: 5, top: 3 },
50
+ );
51
+ expect(result).toEqual({ width: 107, height: 90 });
52
+ });
53
+
43
54
  it('respects minWidth and minHeight', () => {
44
55
  const result = computeRenderTargetSize({ x: 0, y: 0, width: 0, height: 0 }, 0, 32, 16);
45
56
  expect(result.width).toBe(32);
@@ -73,12 +84,109 @@ describe('computeScene2DRenderTargetTransform', () => {
73
84
  expect(out2.tx).not.toBe(out1.tx);
74
85
  });
75
86
 
76
- it('does not throw for a non-identity local transform', () => {
87
+ it('cancels a transformed detached root while retaining the content-origin translation', () => {
77
88
  const obj = createDisplayObject();
78
89
  obj.x = 50;
79
90
  obj.y = 30;
80
- const bounds = createRectangle(50, 30, 100, 80);
91
+ obj.rotation = 31;
92
+ obj.scaleX = 2;
93
+ obj.scaleY = 0.5;
94
+ const bounds = createRectangle(-12, -7, 100, 80);
81
95
  const out = createMatrix();
82
- expect(() => computeScene2DRenderTargetTransform(out, obj, bounds)).not.toThrow();
96
+ computeScene2DRenderTargetTransform(out, obj, bounds, 9, 4);
97
+ const composed = createMatrix();
98
+ multiplyMatrix(composed, out, getNodeLocalMatrix(obj));
99
+
100
+ expect(composed.a).toBeCloseTo(1);
101
+ expect(composed.b).toBeCloseTo(0);
102
+ expect(composed.c).toBeCloseTo(0);
103
+ expect(composed.d).toBeCloseTo(1);
104
+ expect(composed.tx).toBeCloseTo(21);
105
+ expect(composed.ty).toBeCloseTo(11);
106
+ });
107
+ });
108
+
109
+ describe('resolveRenderTargetDescriptor', () => {
110
+ it('resolves every optional target axis and clear policy', () => {
111
+ expect(resolveRenderTargetDescriptor({ width: 64, height: 48 })).toEqual({
112
+ width: 64,
113
+ height: 48,
114
+ format: 'rgba8',
115
+ colorAttachments: 1,
116
+ colorFormats: ['rgba8'],
117
+ sampleCount: 1,
118
+ depth: 'none',
119
+ colorSpace: 'srgb',
120
+ clearColors: [],
121
+ clearDepth: 1,
122
+ });
123
+ });
124
+
125
+ describe('explainRenderTargetAxes', () => {
126
+ it('reports every changed axis in stable descriptor order', () => {
127
+ const requested = resolveRenderTargetDescriptor({
128
+ width: 64,
129
+ height: 48,
130
+ format: 'rgba16f',
131
+ colorAttachments: 2,
132
+ sampleCount: 8,
133
+ depth: 'depth-stencil-sampled',
134
+ });
135
+ const effective = {
136
+ ...requested,
137
+ format: 'rgba8' as const,
138
+ colorFormats: ['rgba8', 'rgba8'] as const,
139
+ sampleCount: 4,
140
+ depth: 'depth-stencil' as const,
141
+ };
142
+
143
+ expect(explainRenderTargetAxes(requested, effective)).toEqual([
144
+ { axis: 'format', effective: 'rgba8', requested: 'rgba16f' },
145
+ { axis: 'colorFormats', effective: ['rgba8', 'rgba8'], requested: ['rgba16f', 'rgba16f'] },
146
+ { axis: 'sampleCount', effective: 4, requested: 8 },
147
+ { axis: 'depth', effective: 'depth-stencil', requested: 'depth-stencil-sampled' },
148
+ ]);
149
+ });
150
+
151
+ it('returns no differences for identical canonical axes', () => {
152
+ const axes = resolveRenderTargetDescriptor({ width: 64, height: 48 });
153
+ expect(explainRenderTargetAxes(axes, { ...axes, colorFormats: [...axes.colorFormats] })).toEqual([]);
154
+ });
155
+ });
156
+
157
+ it('normalizes dimensions, attachment count, and sample count once', () => {
158
+ expect(
159
+ resolveRenderTargetDescriptor({
160
+ width: 10.2,
161
+ height: 0,
162
+ colorAttachments: 1.2,
163
+ sampleCount: 3.1,
164
+ }),
165
+ ).toMatchObject({
166
+ width: 11,
167
+ height: 1,
168
+ colorAttachments: 2,
169
+ sampleCount: 4,
170
+ });
171
+ });
172
+
173
+ it('expands heterogeneous color formats across every requested attachment', () => {
174
+ const resolved = resolveRenderTargetDescriptor({
175
+ width: 64,
176
+ height: 48,
177
+ format: 'rgba16f',
178
+ colorAttachments: 3,
179
+ colorFormats: ['rgba8', 'rgba32f'],
180
+ });
181
+
182
+ expect(resolved.format).toBe('rgba8');
183
+ expect(resolved.colorFormats).toEqual(['rgba8', 'rgba32f', 'rgba16f']);
184
+ });
185
+
186
+ it('copies caller-owned clear arrays', () => {
187
+ const clearColors = [0xff0000ff];
188
+ const resolved = resolveRenderTargetDescriptor({ width: 64, height: 48, clearColors });
189
+ clearColors[0] = 0;
190
+ expect(resolved.clearColors).toEqual([0xff0000ff]);
83
191
  });
84
192
  });
@@ -2,6 +2,7 @@ import type { Scene2DClipHooks, Renderer, RenderState } from '@flighthq/types/co
2
2
 
3
3
  import {
4
4
  copyAllRenderersFromRenderState,
5
+ copyRenderStateRegistrations,
5
6
  copyRenderersFromRenderState,
6
7
  noopRendererData,
7
8
  registerRenderer,
@@ -68,6 +69,22 @@ describe('copyRenderersFromRenderState', () => {
68
69
  });
69
70
  });
70
71
 
72
+ describe('copyRenderStateRegistrations', () => {
73
+ it('snapshot-copies effect-padding registrations without aliasing the maps', () => {
74
+ const source = createRenderState();
75
+ const target = createRenderState();
76
+ const resolver = vi.fn();
77
+ getRenderStateRuntime(source).renderEffectPaddingResolverRegistry = new Map([['acme.Effect', resolver]]);
78
+
79
+ copyRenderStateRegistrations(target, source);
80
+
81
+ expect(getRenderStateRuntime(target).renderEffectPaddingResolverRegistry).not.toBe(
82
+ getRenderStateRuntime(source).renderEffectPaddingResolverRegistry,
83
+ );
84
+ expect(getRenderStateRuntime(target).renderEffectPaddingResolverRegistry?.get('acme.Effect')).toBe(resolver);
85
+ });
86
+ });
87
+
71
88
  describe('noopRendererData', () => {
72
89
  it('returns null', () => {
73
90
  const state = createRenderState();