@hyperframes/producer 0.10.0 → 0.10.1

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/index.js CHANGED
@@ -21457,8 +21457,8 @@ import { join as join49 } from "node:path";
21457
21457
  import {
21458
21458
  assertSwiftShader,
21459
21459
  BROWSER_GPU_NOT_SOFTWARE as BROWSER_GPU_NOT_SOFTWARE4,
21460
- calculateOptimalWorkers as calculateOptimalWorkers2,
21461
21460
  classifyCaptureFailure as classifyCaptureFailure4,
21461
+ computeWorkerSizing as computeWorkerSizing2,
21462
21462
  closeCaptureSession as closeCaptureSession11,
21463
21463
  createCaptureSession as createCaptureSession11,
21464
21464
  createFrameLookupTable as createFrameLookupTable6,
@@ -22388,6 +22388,23 @@ function resolveChunkCaptureWorkers(framesInChunk, machineSized, maxCaptureWorke
22388
22388
  const byFrames = Math.floor(framesInChunk / MIN_FRAMES_PER_CHUNK_BROWSER);
22389
22389
  return Math.max(machineSized, Math.floor(Math.min(maxCaptureWorkers, byFrames)));
22390
22390
  }
22391
+ function chunkCaptureSizingLog(input) {
22392
+ const { machineSizing } = input;
22393
+ return {
22394
+ chunkIndex: input.chunkIndex,
22395
+ frames: input.framesEncoded,
22396
+ workers: input.workers,
22397
+ machineSizedWorkers: machineSizing.workers,
22398
+ boundBy: machineSizing.boundBy,
22399
+ cpuBasedWorkers: machineSizing.cpuBasedWorkers,
22400
+ memoryBasedWorkers: machineSizing.memoryBasedWorkers,
22401
+ frameBasedWorkers: machineSizing.frameBasedWorkers,
22402
+ maxCaptureWorkers: input.maxCaptureWorkers ?? null,
22403
+ captureMode: input.captureMode,
22404
+ captureStageMs: input.captureStageMs,
22405
+ captureMsPerFrame: input.framesEncoded > 0 ? Math.round(input.captureStageMs / input.framesEncoded * 10) / 10 : null
22406
+ };
22407
+ }
22391
22408
  function resolveChunkFrameRange(slice, chunkIndex, frameRange) {
22392
22409
  if (frameRange === void 0) return { startFrame: slice.startFrame, endFrame: slice.endFrame };
22393
22410
  const { startFrame, endFrame } = frameRange;
@@ -22686,9 +22703,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
22686
22703
  });
22687
22704
  captureOptions.onStaticDedupActivity = () => noteCaptureActivity(job);
22688
22705
  const captureFrames = effectiveChunkFrames(framesInChunk, slice.captureCost);
22706
+ const machineSizing = computeWorkerSizing2(captureFrames, void 0, cfg);
22689
22707
  const chunkWorkerCount = resolveChunkCaptureWorkers(
22690
22708
  captureFrames,
22691
- calculateOptimalWorkers2(captureFrames, void 0, cfg),
22709
+ machineSizing.workers,
22692
22710
  options?.maxCaptureWorkers
22693
22711
  );
22694
22712
  let session = null;
@@ -23076,6 +23094,18 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
23076
23094
  };
23077
23095
  writeFileSync14(perfPath, `${JSON.stringify(perfPayload, null, 2)}
23078
23096
  `, "utf-8");
23097
+ log.info(
23098
+ "[renderChunk] capture sizing",
23099
+ chunkCaptureSizingLog({
23100
+ chunkIndex,
23101
+ framesEncoded,
23102
+ workers: chunkWorkerCount,
23103
+ machineSizing,
23104
+ maxCaptureWorkers: options?.maxCaptureWorkers,
23105
+ captureMode,
23106
+ captureStageMs
23107
+ })
23108
+ );
23079
23109
  try {
23080
23110
  rmSync18(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
23081
23111
  rmSync18(videoFramesDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
@@ -32,7 +32,7 @@
32
32
  * Every other determinism toggle above is opt-in — only this primitive enables them.
33
33
  * In-process renders (`executeRenderJob`) leave them off.
34
34
  */
35
- import { assertSwiftShader, type CaptureOptions, type CaptureMode, type CapturePerfSummary, type CaptureSession, closeCaptureSession, createCaptureSession, type EngineConfig, initializeSession, type ShownBoxPart, probeBeginFrameLiveness, readWebGlVendorInfoFromCanvas, type ShownBox } from "@hyperframes/engine";
35
+ import { assertSwiftShader, type CaptureOptions, type CaptureMode, type CapturePerfSummary, type CaptureSession, type WorkerSizing, closeCaptureSession, createCaptureSession, type EngineConfig, initializeSession, type ShownBoxPart, probeBeginFrameLiveness, readWebGlVendorInfoFromCanvas, type ShownBox } from "@hyperframes/engine";
36
36
  import { type ChunkSliceJson, type LockedRenderConfig } from "../render/stages/freezePlan.js";
37
37
  import { type PlanVideosJson } from "./shared.js";
38
38
  export { CHUNK_FRAME_RANGE_INVALID, CHUNK_INDEX_OUT_OF_RANGE, createChunkVideoFrameInjectorFactory, extractDeferredVideoFramesForChunk, FFMPEG_VERSION_MISMATCH, INVALID_VIDEO_METADATA, MISSING_PLAN_ARTIFACT, MISSING_RUNTIME_ENV_SNAPSHOT, PLAN_HASH_MISMATCH, rebuildExtractedFramesFromPlanDir, RenderChunkValidationError, } from "./chunkFrames.js";
@@ -119,6 +119,16 @@ export interface RenderChunkOptions {
119
119
  export declare function interleavesCapture(overlapping: boolean, options?: RenderChunkOptions): boolean;
120
120
  /** Capture browsers for a chunk: the machine-wide sizing, raised by the runtime's budget. */
121
121
  export declare function resolveChunkCaptureWorkers(framesInChunk: number, machineSized: number, maxCaptureWorkers: number | undefined): number;
122
+ /** One chunk's capture in a line: how many browsers it ran and why, and what a frame cost in wall time. */
123
+ export declare function chunkCaptureSizingLog(input: {
124
+ chunkIndex: number;
125
+ framesEncoded: number;
126
+ workers: number;
127
+ machineSizing: Pick<WorkerSizing, "workers" | "boundBy" | "cpuBasedWorkers" | "memoryBasedWorkers" | "frameBasedWorkers">;
128
+ maxCaptureWorkers: number | undefined;
129
+ captureMode: CaptureMode;
130
+ captureStageMs: number;
131
+ }): Record<string, string | number | null>;
122
132
  /** The frames a chunk renders: its slice, or a validated sub-range of it. */
123
133
  export declare function resolveChunkFrameRange(slice: ChunkSliceJson, chunkIndex: number, frameRange: ChunkFrameRange | undefined): ChunkFrameRange;
124
134
  /** Compatibility-safe adapter seam for built-in or injected chunk renderers. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,12 +35,12 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "~25.13.0",
37
37
  "puppeteer-core": "^25.13.0",
38
- "@hyperframes/engine": "0.10.0",
39
- "@hyperframes/core": "0.10.0",
40
- "@hyperframes/lint": "0.10.0",
41
- "@hyperframes/parsers": "0.10.0",
42
- "@hyperframes/share": "0.10.0",
43
- "@hyperframes/studio-server": "0.10.0"
38
+ "@hyperframes/core": "0.10.1",
39
+ "@hyperframes/engine": "0.10.1",
40
+ "@hyperframes/lint": "0.10.1",
41
+ "@hyperframes/share": "0.10.1",
42
+ "@hyperframes/parsers": "0.10.1",
43
+ "@hyperframes/studio-server": "0.10.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.0.10",
@@ -49,7 +49,7 @@
49
49
  "tsx": "^4.21.0",
50
50
  "typescript": "^5.7.2",
51
51
  "vitest": "^4.1.12",
52
- "@hyperframes/aws-lambda": "0.10.0"
52
+ "@hyperframes/aws-lambda": "0.10.1"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=22.19.0"