vaweGitHub

Same page in. Same frames out.

A vawe film is an HTML page that the renderer seeks to each frame’s time. Ask for the frame at 4.2 seconds twice, in any order, and it comes back the same. The clock is replaced before the page runs, and a test renders pages twice and compares every frame.

The clock is virtual.

Before any script on the page runs, a virtual clock replaces every source of ambient state. Date and performance.now return film time, not the wall clock; requestAnimationFrame callbacks flush once per seek, and timers fire when the seek passes their due time. Math.random is reseeded from the seek time, so a scatter that looks random is the same scatter on every render.

The page itself is seeked, never played: the renderer sets the clock, calls window.seek(t) when the page defines one, then seeks every CSS and Web Animation to t before the screenshot. Ordinary code that reads the time keeps working, and still paints a pure function of t.

core/engine/page-clock.js · harness/media/render-page.mjs
page-clock.js
Date, performance.now   film time in ms
requestAnimationFrame   flushed once per seek
setTimeout/setInterval  fire when t passes them
Math.random             reseeded from t

A test proves it.

tests/media/render-page-determinism.test.mjs renders two fixture pages twice each and compares the decoded frame hashes. One page paints from window.seek(t) on a canvas; the other reads Date.now, performance.now and Math.random directly. Both renders must match frame for frame, and the frames must differ over time, so a page that froze would fail too. bin/vawe-dev e2e runs it.

tests/media/render-page-determinism.test.mjs · harness/dev/e2e.mjs
the test
render page -> frame hashes A
render page -> frame hashes B
assert A === B
assert frames differ over t

Parallel slices, the same pixels.

Because the frame at t depends on nothing before it, the renderer splits a film into fixed 60-frame slices and captures several at once, each on its own fresh page of one shared browser. The slice size is a constant, never the worker count: a page keeps raster state between seeks, so a frame reached by seeking can differ in the last decimal place from the same frame on a fresh page. Fixing the boundaries makes the pixels identical for any number of workers.

harness/media/render-page.mjs, SLICE_FRAMES

60fps final, 30fps for a fast look.

One page becomes one mp4: bin/vawe ship renders 60fps at full size with motion blur and audio, and bin/vawe dev renders a half-size, 30fps draft for a quick check. Frames are seeked at fractional times, so the render rate is independent of the page. Determinism is not a mode you opt into: every render goes through the same virtual clock.

harness/cli/verbs.mjs · harness/media/render-page.mjs

When it matters, and when it does not.

Determinism matters when nobody looks at every frame. Then the guarantee has to come from the renderer.

  1. An agent approves a draft. The final render must show the same moments as the draft it approved.
  2. One template makes many ad variants. The shared background must be the same in every variant.
  3. A render is split across machines or workers. Frame 4000 from one worker must match frame 4000 from another.
  4. A pipeline checks for regressions. Two renders of the same input are diffed, and any pixel change is a bug. Without determinism every diff is noise, and people stop trusting the check.

It matters less when a person is the last step. A person who watches and approves one edit is already the check. Live compositing has no second render to match. A generative model that makes variation on purpose solves a different problem.

A headless browser does not give determinism for free. A real clock, an unseeded random call or a fetch in the middle of a render breaks it. So an engine that promises it must state its rules. HyperFrames publishes its own rules: integer frame time, no system timers, no unseeded random and no fetch during a render. vawe makes the same promise with a virtual clock instead of a ban.

hyperframes.heygen.com/concepts/determinism · read 2026-09-19

The causes of drift, measured.

Two renders of one page once gave 70 of 216 different frames. The post lists each cause and its fix.