Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Record the first full-film raw capture measurement

Nguyen Xuan Anbde42b173f6b
diff --git a/changes/301.md b/changes/301.md
index 286e6f71..92d20789 100644
--- a/changes/301.md
+++ b/changes/301.md
@@ -1 +1 @@
-- Make raw capture the default for video in `scripts/render-media.mjs` and the MCP video job (issue #301). Each frame is read with `readPixels` in the draw task and sent to Node over one binary WebSocket with a one byte acknowledgement, which replaces the Blob post that failed after about 100 frames. FILM_NUMBERS `--capture jpeg` keeps the screenshot path, PNG stills are unchanged, and `npm run smoke:capture-parity` checks a decoded raw frame against its PNG seek. `ws` is a new dev dependency, bundled into the MCP server.
+- Make raw capture the default for video in `scripts/render-media.mjs` and the MCP video job (issue #301). Each frame is read with `readPixels` in the draw task and sent to Node over one binary WebSocket with a one byte acknowledgement, which replaces the Blob post that failed after about 100 frames. The full 4,488 frame film at 1280 by 720 on the RTX 3060 survived raw capture (measured once, loaded machine): 405 s in all, draw 2.9 ms and readPixels 4.4 ms a frame, but 85 ms a frame in capture, so the WebSocket round trip is too slow and the 40 s and 5 ms targets are not met. `--capture jpeg` keeps the screenshot path, PNG stills are unchanged, and `npm run smoke:capture-parity` checks a decoded raw frame against its PNG seek. `ws` is a new dev dependency, bundled into the MCP server.
diff --git a/docs/agent-render-jobs.md b/docs/agent-render-jobs.md
index 5d491d4d..2005c72b 100644
--- a/docs/agent-render-jobs.md
+++ b/docs/agent-render-jobs.md
@@ -38,7 +38,7 @@ Cancellation becomes terminal after the owned encoder and job page stop and the
Video uses H.264 (CPU by default, see `settings.encoder`), even dimensions and one streamed frame at a time.
MCP video frames are read from the drawing buffer with `readPixels` in the same task as the draw and sent to Node over one binary WebSocket on the preview server port, with a one byte acknowledgement per frame so one frame is in flight and the encoder sets the pace (issue #301).
PNG stills and render passes still use a DevTools screenshot, byte for byte as before.
-`metrics.captureSeconds` and `metrics.renderSeconds` report the two costs. A screenshot cost 28.8 ms a frame to capture and 7.4 ms to draw at 1280 by 720 on an RTX 3060. FILM_NUMBERS
+`metrics.captureSeconds` and `metrics.renderSeconds` report the two costs. A screenshot cost 28.8 ms a frame to capture and 7.4 ms to draw at 1280 by 720 on an RTX 3060. The full 4,488 frame film at 1280 by 720 on the RTX 3060 survived raw capture (measured once, loaded machine): 405 s in all, draw 2.9 ms and readPixels 4.4 ms a frame, but 85 ms a frame in capture, so the WebSocket round trip is too slow and the 40 s and 5 ms targets are not met.
The render backend can use GPU or CPU. Memory limits can reduce the actual output dimensions.
Results report actual dimensions and measured timings. They do not embed video bytes.
diff --git a/skills/render-67js-media/references/rendering.md b/skills/render-67js-media/references/rendering.md
index d3da10db..2de4f7c5 100644
--- a/skills/render-67js-media/references/rendering.md
+++ b/skills/render-67js-media/references/rendering.md
@@ -40,7 +40,7 @@ The renderer does not silently replace a failed hardware export with a lower-qua
Video capture cost (measured on an RTX 3060 at 1280x720 on a loaded machine, 20 s of the film, 480 frames, NVENC).
Screenshots (`--capture jpeg`) cost 28.8 ms a frame to capture and 7.4 ms to draw, 21.5 s for the clip.
Every report has `stageTimings.captureSeconds` and `renderSeconds`.
-`--capture raw`, the default for video, reads the drawing buffer with `readPixels` (3.3 ms a frame) and sends it to Node over a binary WebSocket, one frame in flight, acknowledged by one byte. FILM_NUMBERS
+`--capture raw`, the default for video, reads the drawing buffer with `readPixels` (3.3 ms a frame) and sends it to Node over a binary WebSocket, one frame in flight, acknowledged by one byte. The full 4,488 frame film at 1280 by 720 on the RTX 3060 survived raw capture (measured once, loaded machine): 405 s in all, draw 2.9 ms and readPixels 4.4 ms a frame, but 85 ms a frame in capture, so the WebSocket round trip is too slow and the 40 s and 5 ms targets are not met.
Returning the pixels through Playwright instead cost 55 ms a frame, and a fetch with a Blob body failed after about 100 frames, so neither is used.
A decoded raw frame matches the PNG seek of the same time at 41.0 dB PSNR on SwiftShader (`npm run smoke:capture-parity`).