@forgeax/engine-render-graph 0.1.33 → 0.1.35

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.
package/dist/types.d.ts CHANGED
@@ -138,6 +138,7 @@ export interface GraphAccessInfo {
138
138
  readonly resource: string;
139
139
  readonly usage: GraphBufferAccess | GraphTextureAccess;
140
140
  }
141
+ export type CompiledResourceByteSizeUnknownReason = 'imported-owner' | 'format-or-layout-unknown' | 'not-allocated';
141
142
  /** Detached physical allocation facts for one compiled graph resource. */
142
143
  export type CompiledResourceDescriptor = {
143
144
  readonly kind: 'texture';
@@ -175,6 +176,8 @@ export interface CompiledRenderGraphInfo {
175
176
  readonly physicalAllocationKey?: string | undefined;
176
177
  /** Descriptor-derived byte size when the format is uncompressed and known. */
177
178
  readonly byteSize?: number | undefined;
179
+ /** Why byteSize is absent; no zero is fabricated for an unknown owner/format. */
180
+ readonly byteSizeUnknownReason?: CompiledResourceByteSizeUnknownReason | undefined;
178
181
  /** Texture format retained for producer-owned resource inspection. */
179
182
  readonly format?: TextureFormat | undefined;
180
183
  /** Texture allocation facts retained for capability/lifetime inspection. */
@@ -187,6 +190,59 @@ export interface CompiledRenderGraphInfo {
187
190
  }[];
188
191
  /** Monotonic graph generation assigned when this graph was compiled. */
189
192
  readonly generation: number;
193
+ /**
194
+ * Graph-owned logical allocation facts. Imported resources are counted only
195
+ * as references; their physical bytes stay with the importing owner.
196
+ */
197
+ readonly resourceAllocation?: RenderGraphResourceAllocationInspection | undefined;
198
+ }
199
+ /**
200
+ * RenderGraph-owned logical allocation facts. Byte totals include only
201
+ * descriptor-derived sizes known by this package; physical GPU residency and
202
+ * imported-resource bytes remain unknown by contract.
203
+ */
204
+ export interface RenderGraphResourceAllocationInspection {
205
+ readonly unit: 'engine-allocation-bytes';
206
+ readonly physicalResidency: 'unknown';
207
+ readonly liveBytes: number;
208
+ readonly pendingRetirementBytes: number;
209
+ readonly peakBytes: number;
210
+ readonly successfulAllocationCount: number;
211
+ readonly successfulAllocationBytes: number;
212
+ readonly pendingRetirementCount: number;
213
+ readonly retiredBytes: number;
214
+ readonly failedAllocationRollbacks: number;
215
+ readonly failedAllocationRollbackBytes: number;
216
+ readonly unknownByteSizeCount: number;
217
+ readonly importedResourceCount: number;
218
+ }
219
+ /** One graph generation included in the renderer-wide replacement ledger. */
220
+ export interface RenderGraphGenerationAllocationEntry {
221
+ readonly generation: number;
222
+ /** A graph may be both the current active graph and an unsubmitted candidate. */
223
+ readonly roles: readonly ('active' | 'candidate' | 'retiring')[];
224
+ readonly retirement: 'active' | 'pending' | 'failed';
225
+ readonly allocation: RenderGraphResourceAllocationInspection;
226
+ }
227
+ /**
228
+ * Renderer-wide logical allocation facts across graph generations. Current
229
+ * live and pending bytes are summed across the generations that overlap;
230
+ * peakBytes is captured from simultaneous owner events instead of summing
231
+ * historical per-graph peaks. This does not estimate physical VRAM or include
232
+ * imported owner bytes.
233
+ */
234
+ export interface RenderGraphGenerationAllocationInspection {
235
+ readonly unit: 'engine-allocation-bytes';
236
+ readonly physicalResidency: 'unknown';
237
+ readonly availability: 'complete' | 'partial' | 'unavailable';
238
+ readonly unavailableGenerationCount: number;
239
+ readonly entries: readonly RenderGraphGenerationAllocationEntry[];
240
+ readonly liveBytes: number;
241
+ readonly pendingRetirementBytes: number;
242
+ /** Peak simultaneous logical bytes observed by this renderer owner. */
243
+ readonly peakBytes: number;
244
+ readonly failedRetirementCount: number;
245
+ readonly failedRetirementBytes: number;
190
246
  }
191
247
  export interface RenderGraphFrame {
192
248
  readonly encoder: RhiCommandEncoder;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,WAAW,EACZ,MAAM,q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,CAAC;CACnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/engine-render-graph",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,12 +22,12 @@
22
22
  "LICENSE"
23
23
  ],
24
24
  "dependencies": {
25
- "@forgeax/engine-rhi": "0.1.33",
26
- "@forgeax/engine-types": "0.1.33",
25
+ "@forgeax/engine-rhi": "0.1.35",
26
+ "@forgeax/engine-types": "0.1.35",
27
27
  "@webgpu/types": "^0.1.71"
28
28
  },
29
29
  "devDependencies": {
30
- "@forgeax/engine-rhi-null": "0.1.33"
30
+ "@forgeax/engine-rhi-null": "0.1.35"
31
31
  },
32
32
  "forgeax": {
33
33
  "metrics": {
@@ -823,6 +823,89 @@ describe('RenderGraphBuilder capability, execution, and lifecycle contracts', ()
823
823
  expect(destroyed).toHaveLength(1);
824
824
  });
825
825
 
826
+ it('uses array-layer and 3d depth semantics when projecting mip bytes', () => {
827
+ const compile = (dimension: GPUTextureDimension) => {
828
+ const graph = new RenderGraphBuilder<Frame>();
829
+ const texture = value(
830
+ graph.createTexture(`${dimension}-texture`, {
831
+ format: 'rgba8unorm',
832
+ size: { width: 4, height: 4, depthOrArrayLayers: 4 },
833
+ dimension,
834
+ mipLevelCount: 3,
835
+ }),
836
+ );
837
+ const view = value(
838
+ graph.view(texture, { dimension: dimension === '3d' ? '3d' : '2d-array' }),
839
+ );
840
+ graph.addRasterPass('write', {
841
+ accesses: [{ resource: view, usage: 'color-attachment' }],
842
+ colorAttachments: [{ view, loadOp: 'clear', storeOp: 'store' }],
843
+ encode: () => undefined,
844
+ });
845
+ return value(graph.compile({ device: mockDevice(), surfaceSize: { width: 1, height: 1 } }));
846
+ };
847
+
848
+ expect(compile('2d').inspect().resources[0]?.byteSize).toBe(336);
849
+ expect(compile('3d').inspect().resources[0]?.byteSize).toBe(292);
850
+ });
851
+
852
+ it('projects graph-owned allocation bytes and keeps imported ownership explicit', async () => {
853
+ let resolveFence: (() => void) | undefined;
854
+ const fence = new Promise<void>((resolve) => {
855
+ resolveFence = resolve;
856
+ });
857
+ const graph = new RenderGraphBuilder<Frame>();
858
+ const created = value(graph.createBuffer('created', { size: 32 }));
859
+ const imported = value(
860
+ graph.importBuffer('imported', { size: 64, usage: 0x0004 }, (frame) => frame.imported),
861
+ );
862
+ graph.addCopyPass('seed', {
863
+ accesses: [
864
+ { resource: created, usage: 'copy-dst' },
865
+ { resource: imported, usage: 'copy-src' },
866
+ ],
867
+ encode: () => undefined,
868
+ });
869
+ const device = mockDevice({
870
+ queue: { onSubmittedWorkDone: () => fence } as never,
871
+ });
872
+ const compiled = value(graph.compile({ device, surfaceSize: { width: 1, height: 1 } }));
873
+ const info = compiled.inspect();
874
+ const createdInfo = info.resources.find(({ label }) => label === 'created');
875
+ const importedInfo = info.resources.find(({ label }) => label === 'imported');
876
+ expect(createdInfo?.byteSize).toBe(32);
877
+ expect(importedInfo?.byteSize).toBeUndefined();
878
+ expect(importedInfo?.byteSizeUnknownReason).toBe('imported-owner');
879
+ expect(info.resourceAllocation).toMatchObject({
880
+ unit: 'engine-allocation-bytes',
881
+ physicalResidency: 'unknown',
882
+ liveBytes: 32,
883
+ pendingRetirementBytes: 0,
884
+ peakBytes: 32,
885
+ successfulAllocationCount: 1,
886
+ successfulAllocationBytes: 32,
887
+ importedResourceCount: 1,
888
+ unknownByteSizeCount: 0,
889
+ });
890
+
891
+ const retiring = compiled.retire();
892
+ await Promise.resolve();
893
+ expect(compiled.inspect().resourceAllocation).toMatchObject({
894
+ liveBytes: 0,
895
+ pendingRetirementBytes: 32,
896
+ pendingRetirementCount: 1,
897
+ peakBytes: 32,
898
+ });
899
+ resolveFence?.();
900
+ expect((await retiring).ok).toBe(true);
901
+ expect(compiled.inspect().resourceAllocation).toMatchObject({
902
+ liveBytes: 0,
903
+ pendingRetirementBytes: 0,
904
+ pendingRetirementCount: 0,
905
+ retiredBytes: 32,
906
+ });
907
+ });
908
+
826
909
  it('destroys graph-created resources once and never destroys imported resources', async () => {
827
910
  const destroyedBuffers: Buffer[] = [];
828
911
  const device = mockDevice({
@@ -854,6 +937,37 @@ describe('RenderGraphBuilder capability, execution, and lifecycle contracts', ()
854
937
  expect(compiled.execute({ imported: {} as Buffer, encoder: mockEncoder() }).ok).toBe(false);
855
938
  });
856
939
 
940
+ it('retains graph allocation tokens when destruction refuses or throws', async () => {
941
+ for (const destroy of [
942
+ () => ({ ok: false, error: { code: 'webgpu-runtime-error' } }) as never,
943
+ () => {
944
+ throw new Error('destroy refused');
945
+ },
946
+ ]) {
947
+ const graph = new RenderGraphBuilder<Frame>();
948
+ const created = value(graph.createBuffer('created', { size: 32 }));
949
+ graph.addCopyPass('seed', {
950
+ accesses: [{ resource: created, usage: 'copy-dst' }],
951
+ encode: () => undefined,
952
+ });
953
+ const compiled = value(
954
+ graph.compile({
955
+ device: mockDevice({ destroyBuffer: destroy }),
956
+ surfaceSize: { width: 1, height: 1 },
957
+ }),
958
+ );
959
+
960
+ const result = await compiled.retire();
961
+ expect(result.ok).toBe(false);
962
+ expect(compiled.inspect().resourceAllocation).toMatchObject({
963
+ liveBytes: 0,
964
+ pendingRetirementBytes: 32,
965
+ pendingRetirementCount: 1,
966
+ retiredBytes: 0,
967
+ });
968
+ }
969
+ });
970
+
857
971
  it('keeps a failed retirement result stable across repeated calls', async () => {
858
972
  const graph = new RenderGraphBuilder<Frame>();
859
973
  const created = value(graph.createBuffer('created', { size: 16 }));
package/src/builder.ts CHANGED
@@ -63,8 +63,10 @@ let nextGeneration = 1;
63
63
 
64
64
  function textureByteSize(
65
65
  format: GPUTextureFormat,
66
+ dimension: GPUTextureDimension,
66
67
  extent: { readonly width: number; readonly height: number; readonly depthOrArrayLayers: number },
67
68
  mipLevelCount: number,
69
+ sampleCount: number,
68
70
  ): number | undefined {
69
71
  const bytesPerTexel =
70
72
  format === 'r8unorm' || format === 'r8snorm' || format === 'r8uint' || format === 'r8sint'
@@ -107,10 +109,12 @@ function textureByteSize(
107
109
  let height = extent.height;
108
110
  let depth = extent.depthOrArrayLayers;
109
111
  for (let level = 0; level < mipLevelCount; level += 1) {
110
- bytes += width * height * depth * bytesPerTexel;
112
+ bytes += width * height * depth * bytesPerTexel * sampleCount;
111
113
  width = Math.max(1, Math.floor(width / 2));
112
114
  height = Math.max(1, Math.floor(height / 2));
113
- depth = Math.max(1, Math.floor(depth / 2));
115
+ // Array layers are independent images and retain their layer count at
116
+ // every mip. Only a true 3D allocation reduces its depth axis.
117
+ if (dimension === '3d') depth = Math.max(1, Math.floor(depth / 2));
114
118
  }
115
119
  return bytes;
116
120
  }
@@ -453,6 +457,26 @@ export class RenderGraphBuilder<FrameCtx extends RenderGraphFrame> {
453
457
  const allocationKey = physicalKey(resource);
454
458
  const extent =
455
459
  texture === undefined ? undefined : this.resolveExtent(texture.size, options.surfaceSize);
460
+ const knownByteSize =
461
+ resource.record.origin === 'imported' || resource.usage === 0
462
+ ? undefined
463
+ : texture === undefined
464
+ ? buffer?.size
465
+ : textureByteSize(
466
+ texture.format,
467
+ texture.dimension ?? '2d',
468
+ this.resolveExtent(texture.size, options.surfaceSize),
469
+ texture.mipLevelCount ?? 1,
470
+ texture.sampleCount ?? 1,
471
+ );
472
+ const byteSizeUnknownReason =
473
+ resource.record.origin === 'imported'
474
+ ? ('imported-owner' as const)
475
+ : resource.usage === 0
476
+ ? ('not-allocated' as const)
477
+ : knownByteSize === undefined
478
+ ? ('format-or-layout-unknown' as const)
479
+ : undefined;
456
480
  return {
457
481
  label: resource.record.label,
458
482
  kind: resource.record.kind,
@@ -479,17 +503,8 @@ export class RenderGraphBuilder<FrameCtx extends RenderGraphFrame> {
479
503
  derivedUsage: resource.usage,
480
504
  ...(allocationKey === undefined ? {} : { physicalAllocationKey: allocationKey }),
481
505
  ...(texture === undefined ? {} : { format: texture.format }),
482
- ...(texture === undefined
483
- ? buffer === undefined
484
- ? {}
485
- : { byteSize: buffer.size }
486
- : {
487
- byteSize: textureByteSize(
488
- texture.format,
489
- this.resolveExtent(texture.size, options.surfaceSize),
490
- texture.mipLevelCount ?? 1,
491
- ),
492
- }),
506
+ ...(knownByteSize === undefined ? {} : { byteSize: knownByteSize }),
507
+ ...(byteSizeUnknownReason === undefined ? {} : { byteSizeUnknownReason }),
493
508
  ...(texture === undefined
494
509
  ? {}
495
510
  : {
@@ -26,6 +26,7 @@ import type {
26
26
  RenderGraphFrame,
27
27
  RenderGraphPassInstrumentation,
28
28
  RenderGraphPassRunner,
29
+ RenderGraphResourceAllocationInspection,
29
30
  } from './types.js';
30
31
 
31
32
  interface FrameResources {
@@ -34,6 +35,101 @@ interface FrameResources {
34
35
  readonly views: ReadonlyMap<number, TextureView>;
35
36
  }
36
37
 
38
+ interface AllocationEntry {
39
+ readonly handle: unknown;
40
+ readonly bytes: number | undefined;
41
+ }
42
+
43
+ /**
44
+ * Compiled-graph owner ledger. It counts only graph-created physical handles;
45
+ * imported handles are references owned by the caller and remain byte-unknown.
46
+ */
47
+ class RenderGraphAllocationLedger {
48
+ private readonly live = new Map<unknown, number | undefined>();
49
+ private readonly pending = new Map<unknown, number | undefined>();
50
+ private liveBytes = 0;
51
+ private pendingBytes = 0;
52
+ private peakBytes = 0;
53
+ private successfulAllocationCount = 0;
54
+ private successfulAllocationBytes = 0;
55
+ private retiredBytes = 0;
56
+ private unknownByteSizeCount = 0;
57
+ private readonly importedResourceCount: number;
58
+
59
+ constructor(entries: readonly AllocationEntry[], importedResourceCount: number) {
60
+ this.importedResourceCount = importedResourceCount;
61
+ for (const entry of entries) this.allocate(entry.handle, entry.bytes);
62
+ }
63
+
64
+ inspect(): RenderGraphResourceAllocationInspection {
65
+ return {
66
+ unit: 'engine-allocation-bytes',
67
+ physicalResidency: 'unknown',
68
+ liveBytes: this.liveBytes,
69
+ pendingRetirementBytes: this.pendingBytes,
70
+ peakBytes: this.peakBytes,
71
+ successfulAllocationCount: this.successfulAllocationCount,
72
+ successfulAllocationBytes: this.successfulAllocationBytes,
73
+ pendingRetirementCount: this.pending.size,
74
+ retiredBytes: this.retiredBytes,
75
+ failedAllocationRollbacks: 0,
76
+ failedAllocationRollbackBytes: 0,
77
+ unknownByteSizeCount: this.unknownByteSizeCount,
78
+ importedResourceCount: this.importedResourceCount,
79
+ };
80
+ }
81
+
82
+ retireAll(): void {
83
+ for (const handle of [...this.live.keys()]) this.retire(handle);
84
+ }
85
+
86
+ release(handle: unknown): void {
87
+ const pendingBytes = this.pending.get(handle);
88
+ if (pendingBytes !== undefined || this.pending.has(handle)) {
89
+ this.pending.delete(handle);
90
+ if (pendingBytes !== undefined) this.pendingBytes -= pendingBytes;
91
+ if (pendingBytes === undefined) this.unknownByteSizeCount -= 1;
92
+ this.retiredBytes += pendingBytes ?? 0;
93
+ return;
94
+ }
95
+ const liveBytes = this.live.get(handle);
96
+ if (liveBytes !== undefined || this.live.has(handle)) {
97
+ this.live.delete(handle);
98
+ if (liveBytes !== undefined) this.liveBytes -= liveBytes;
99
+ if (liveBytes === undefined) this.unknownByteSizeCount -= 1;
100
+ this.retiredBytes += liveBytes ?? 0;
101
+ }
102
+ }
103
+
104
+ private allocate(handle: unknown, bytes: number | undefined): void {
105
+ if (this.live.has(handle) || this.pending.has(handle)) return;
106
+ this.live.set(handle, bytes);
107
+ this.successfulAllocationCount += 1;
108
+ if (bytes === undefined) this.unknownByteSizeCount += 1;
109
+ else {
110
+ this.liveBytes += bytes;
111
+ this.successfulAllocationBytes += bytes;
112
+ }
113
+ this.updatePeak();
114
+ }
115
+
116
+ private retire(handle: unknown): void {
117
+ const bytes = this.live.get(handle);
118
+ if (bytes === undefined && !this.live.has(handle)) return;
119
+ this.live.delete(handle);
120
+ if (bytes !== undefined) {
121
+ this.liveBytes -= bytes;
122
+ this.pendingBytes += bytes;
123
+ }
124
+ this.pending.set(handle, bytes);
125
+ this.updatePeak();
126
+ }
127
+
128
+ private updatePeak(): void {
129
+ this.peakBytes = Math.max(this.peakBytes, this.liveBytes + this.pendingBytes);
130
+ }
131
+ }
132
+
37
133
  function resolutionError(label: string, cause?: unknown): RenderGraphError {
38
134
  return new RenderGraphError({
39
135
  code: 'resource-resolution-failed',
@@ -48,6 +144,7 @@ export class CompiledRenderGraphImpl<FrameCtx extends RenderGraphFrame>
48
144
  {
49
145
  private retired = false;
50
146
  private retireResult: Promise<Result<void, RenderGraphError>> | undefined;
147
+ private readonly allocationLedger: RenderGraphAllocationLedger;
51
148
 
52
149
  constructor(
53
150
  private readonly generation: number,
@@ -58,10 +155,30 @@ export class CompiledRenderGraphImpl<FrameCtx extends RenderGraphFrame>
58
155
  private readonly passes: readonly CompiledPass<FrameCtx>[],
59
156
  private readonly info: CompiledRenderGraphInfo,
60
157
  private readonly colorTargetDescriptors: ReadonlyMap<string, ResolvedColorTargetDescriptor>,
61
- ) {}
158
+ ) {
159
+ const infoByLabel = new Map(info.resources.map((resource) => [resource.label, resource]));
160
+ const seen = new Set<unknown>();
161
+ const entries: AllocationEntry[] = [];
162
+ let importedResourceCount = 0;
163
+ for (const compiled of resources.values()) {
164
+ if (compiled.usage === 0) continue;
165
+ const handle = compiled.texture ?? compiled.buffer;
166
+ if (compiled.record.origin === 'imported') {
167
+ importedResourceCount += 1;
168
+ continue;
169
+ }
170
+ if (handle === undefined || seen.has(handle)) continue;
171
+ seen.add(handle);
172
+ entries.push({
173
+ handle,
174
+ bytes: infoByLabel.get(compiled.record.label)?.byteSize,
175
+ });
176
+ }
177
+ this.allocationLedger = new RenderGraphAllocationLedger(entries, importedResourceCount);
178
+ }
62
179
 
63
180
  inspect(): CompiledRenderGraphInfo {
64
- return this.info;
181
+ return { ...this.info, resourceAllocation: this.allocationLedger.inspect() };
65
182
  }
66
183
 
67
184
  getColorTargetView(name: string): TextureView | undefined {
@@ -260,6 +377,7 @@ export class CompiledRenderGraphImpl<FrameCtx extends RenderGraphFrame>
260
377
  }
261
378
 
262
379
  private async finishRetire(): Promise<Result<void, RenderGraphError>> {
380
+ this.allocationLedger.retireAll();
263
381
  try {
264
382
  await this.device.queue.onSubmittedWorkDone();
265
383
  } catch (cause) {
@@ -277,11 +395,13 @@ export class CompiledRenderGraphImpl<FrameCtx extends RenderGraphFrame>
277
395
  for (const compiled of this.resources.values()) {
278
396
  if (compiled.record.origin === 'imported') continue;
279
397
  if (compiled.texture === undefined && compiled.buffer === undefined) continue;
398
+ let destroyedSuccessfully = false;
280
399
  try {
281
400
  const destroyed =
282
401
  compiled.record.kind === 'texture'
283
402
  ? this.device.destroyTexture(compiled.texture as Texture)
284
403
  : this.device.destroyBuffer(compiled.buffer as Buffer);
404
+ destroyedSuccessfully = destroyed.ok;
285
405
  if (!destroyed.ok && firstFailure === undefined) {
286
406
  firstFailure = new RenderGraphError({
287
407
  code: 'resource-retire-failed',
@@ -301,6 +421,12 @@ export class CompiledRenderGraphImpl<FrameCtx extends RenderGraphFrame>
301
421
  hint: 'inspect detail.cause for the RHI destroy failure',
302
422
  detail: { generation: this.generation, resourceLabel: compiled.record.label, cause },
303
423
  });
424
+ } finally {
425
+ // A failed or throwing destroy leaves the handle owned by this
426
+ // graph. Keep its token pending so inspection reflects the
427
+ // retirement failure instead of claiming bytes were released.
428
+ if (destroyedSuccessfully)
429
+ this.allocationLedger.release(compiled.texture ?? compiled.buffer);
304
430
  }
305
431
  }
306
432
  return firstFailure === undefined ? ok(undefined) : err(firstFailure);
package/src/index.ts CHANGED
@@ -68,6 +68,7 @@ export {
68
68
  export type {
69
69
  CompiledRenderGraph,
70
70
  CompiledRenderGraphInfo,
71
+ CompiledResourceByteSizeUnknownReason,
71
72
  CompiledResourceDescriptor,
72
73
  ComputeGraphPass,
73
74
  CopyGraphPass,
@@ -96,8 +97,11 @@ export type {
96
97
  RasterGraphPass,
97
98
  RenderGraphCompileOptions,
98
99
  RenderGraphFrame,
100
+ RenderGraphGenerationAllocationEntry,
101
+ RenderGraphGenerationAllocationInspection,
99
102
  RenderGraphPassExecution,
100
103
  RenderGraphPassInstrumentation,
101
104
  RenderGraphPassInstrumentationScope,
102
105
  RenderGraphPassRunner,
106
+ RenderGraphResourceAllocationInspection,
103
107
  } from './types.js';
package/src/types.ts CHANGED
@@ -186,6 +186,11 @@ export interface GraphAccessInfo {
186
186
  readonly usage: GraphBufferAccess | GraphTextureAccess;
187
187
  }
188
188
 
189
+ export type CompiledResourceByteSizeUnknownReason =
190
+ | 'imported-owner'
191
+ | 'format-or-layout-unknown'
192
+ | 'not-allocated';
193
+
189
194
  /** Detached physical allocation facts for one compiled graph resource. */
190
195
  export type CompiledResourceDescriptor =
191
196
  | {
@@ -226,6 +231,8 @@ export interface CompiledRenderGraphInfo {
226
231
  readonly physicalAllocationKey?: string | undefined;
227
232
  /** Descriptor-derived byte size when the format is uncompressed and known. */
228
233
  readonly byteSize?: number | undefined;
234
+ /** Why byteSize is absent; no zero is fabricated for an unknown owner/format. */
235
+ readonly byteSizeUnknownReason?: CompiledResourceByteSizeUnknownReason | undefined;
229
236
  /** Texture format retained for producer-owned resource inspection. */
230
237
  readonly format?: TextureFormat | undefined;
231
238
  /** Texture allocation facts retained for capability/lifetime inspection. */
@@ -236,6 +243,62 @@ export interface CompiledRenderGraphInfo {
236
243
  }[];
237
244
  /** Monotonic graph generation assigned when this graph was compiled. */
238
245
  readonly generation: number;
246
+ /**
247
+ * Graph-owned logical allocation facts. Imported resources are counted only
248
+ * as references; their physical bytes stay with the importing owner.
249
+ */
250
+ readonly resourceAllocation?: RenderGraphResourceAllocationInspection | undefined;
251
+ }
252
+
253
+ /**
254
+ * RenderGraph-owned logical allocation facts. Byte totals include only
255
+ * descriptor-derived sizes known by this package; physical GPU residency and
256
+ * imported-resource bytes remain unknown by contract.
257
+ */
258
+ export interface RenderGraphResourceAllocationInspection {
259
+ readonly unit: 'engine-allocation-bytes';
260
+ readonly physicalResidency: 'unknown';
261
+ readonly liveBytes: number;
262
+ readonly pendingRetirementBytes: number;
263
+ readonly peakBytes: number;
264
+ readonly successfulAllocationCount: number;
265
+ readonly successfulAllocationBytes: number;
266
+ readonly pendingRetirementCount: number;
267
+ readonly retiredBytes: number;
268
+ readonly failedAllocationRollbacks: number;
269
+ readonly failedAllocationRollbackBytes: number;
270
+ readonly unknownByteSizeCount: number;
271
+ readonly importedResourceCount: number;
272
+ }
273
+
274
+ /** One graph generation included in the renderer-wide replacement ledger. */
275
+ export interface RenderGraphGenerationAllocationEntry {
276
+ readonly generation: number;
277
+ /** A graph may be both the current active graph and an unsubmitted candidate. */
278
+ readonly roles: readonly ('active' | 'candidate' | 'retiring')[];
279
+ readonly retirement: 'active' | 'pending' | 'failed';
280
+ readonly allocation: RenderGraphResourceAllocationInspection;
281
+ }
282
+
283
+ /**
284
+ * Renderer-wide logical allocation facts across graph generations. Current
285
+ * live and pending bytes are summed across the generations that overlap;
286
+ * peakBytes is captured from simultaneous owner events instead of summing
287
+ * historical per-graph peaks. This does not estimate physical VRAM or include
288
+ * imported owner bytes.
289
+ */
290
+ export interface RenderGraphGenerationAllocationInspection {
291
+ readonly unit: 'engine-allocation-bytes';
292
+ readonly physicalResidency: 'unknown';
293
+ readonly availability: 'complete' | 'partial' | 'unavailable';
294
+ readonly unavailableGenerationCount: number;
295
+ readonly entries: readonly RenderGraphGenerationAllocationEntry[];
296
+ readonly liveBytes: number;
297
+ readonly pendingRetirementBytes: number;
298
+ /** Peak simultaneous logical bytes observed by this renderer owner. */
299
+ readonly peakBytes: number;
300
+ readonly failedRetirementCount: number;
301
+ readonly failedRetirementBytes: number;
239
302
  }
240
303
 
241
304
  export interface RenderGraphFrame {