Files
shinyobjectz 087949140d A page draw past Vello's buffers is painted again before its frame is encoded, in the fed render too
A page past raea's smaller Vello bump buffers draws nothing, and only its sentinel read back says so (#23). The fed
render (pages handed to raea-render, the default for a page composition's mp4) never checked: the log said "drawn
again", but the skipped draw went into the film as it was. A heavy first frame came out black, and a layer could drop
for a frame (seen as a grain overlay flickering under 70 clipped, blurred, 3D-transformed shards).

- raea-sys-page skipped.rs: wait_drawn waits for the last draw's sentinel read back (its submission alone).
- raea-gpu-device check.rs fed_checked: once every read back has answered, a skip paints the frame again at Vello's
  own sizes, and a skip even then refuses the frame by its number, as the other render paths do; runtime/export
  fed.rs calls it after each frame's page is painted.

bench/vello-skip/check.sh: shards.tsx's mp4 frame 0 has mean luma 21 (the page); with the raea before this, 0. The
wait costs nothing measurable on an ordinary 1080p page (300 frames, alternating: 256.8 and 263.6 fps before, 262.8
and 263.7 after). Still to look at: the redrawn first frame lacks one shard that a render at Vello's own sizes from
the start draws (4,400 pixels, also in a --frame 0 still, whose redraw is skip_checked's).
2026-11-08 12:54:48 -08:00

18 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# A page whose first draw is past raea's Vello bump buffers (shards.tsx): the mp4's frame 0 must be the page, not black.
# The fed render (pages handed to raea-render) never checked its draws, so a skipped draw went into the film as it was:
# a black first frame, or a layer gone for a frame (#23). It now checks before the frame goes to the encoder and
# paints the page again at Vello's own sizes. Exits 1 on a failure.
# bench/vello-skip/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
cd "$(dirname "$0")/../.." || exit 2
BIN=${RAEA_BIN:-$PWD/target/release/raea}
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-vello-skip.XXXXXX")
trap 'rm -rf "$OUT"' EXIT
"$BIN" render bench/vello-skip/shards.tsx -o "$OUT/v.mp4" > "$OUT/v.log" 2>&1 || { echo "FAIL: the render failed"; tail -3 "$OUT/v.log"; exit 1; }
grep -q "past raea's Vello buffers" "$OUT/v.log" || echo "note: the first draw fit raea's buffers this time (nothing skipped to check)"
ffmpeg -loglevel error -y -i "$OUT/v.mp4" -frames:v 1 "$OUT/f0.png" || { echo "FAIL: no frame 0"; exit 1; }
mean=$(magick "$OUT/f0.png" -colorspace gray -format "%[fx:int(mean*255)]" info:)
[ "$mean" -ge 15 ] || { echo "FAIL: frame 0's mean luma is $mean: the skipped first draw went out (black is 0, the page about 22)"; exit 1; }
echo "PASS: a skipped first draw is painted again before it's encoded (frame 0's mean luma $mean)"