Skip to content

A page of many layers the size of the frame draws them all, and one of more than Vello's image atlas holds fails its render - #94

Merged
shinyobjectz merged 1 commit into
shinyobjectz:mainfrom
JimGHTB12:image-atlas-room
Nov 10, 2026
Merged

shinyobjectz merged 1 commit into
shinyobjectz:mainfrom
JimGHTB12:image-atlas-room

Conversation

@JimGHTB12

Copy link
Copy Markdown
Contributor

A page with about ten or more elements the size of the frame, each with a perspective transform or a filter, loses some of them from some frames. Nothing is printed and the render exits 0. This is what took a cursor and a mark out of single frames of the film made with raea last week, different frames on each run.

Repro

bench/layer-atlas/fit.tsx (new): 18 divs of 1920x1080, each with its own slightly projective matrix3d and one white tile, on black. No filter, no opacity, no images.

raea render bench/layer-atlas/fit.tsx -o fit.mp4
raea render bench/layer-atlas/fit.tsx --at 0,1,2,3,4,5 -o stills

On main, 32 of the video's 48 frames are short of 18 tiles, and stills 1, 3 and 5 draw 10 of 18. Each of those stills is whole when asked for alone.

Why

  1. A projective element gets a warp layer (blitz-paint push_warp_layer), and a filtered one a filter layer. raea-sys-filters places each in its parent as a placeholder image the size of its box, with a new blob id on every paint.
  2. raea-sys-page hands the layer's pixels to Vello with override_image, and Vello copies them into its image atlas.
  3. The atlas stops at 8192 px a side: room for 28 images of 1920x1080. It lets go only of images the last two resolves didn't use, in one sweep a resolve (vendor/vello_encoding/src/image_cache.rs).
  4. An image that finds no room is written at zero size and the draw carries on (resolve.rs: "If the atlas is already maximum size, there's nothing we can do").

So the atlas fills with the last two frames' placeholders, and the frame's last layers in paint order, the nearest ones, are left out. Layers a few px apart in size also cut a guillotine atlas up, so even with the old images gone 18 of them didn't always fit in room for 28. The fed render never read a page's refusal either, so nothing could have stopped the video.

Change

vendor/vello_encoding, when an image finds no room at the atlas's largest size:

  • What the resolve hasn't used is let go, the longest unused first (ImageCache::evict_unused). Last frame's placeholders go before a picture this frame's layers drew.
  • If an image is still left out, the atlas is packed again with this resolve's images alone, the tallest first, once a resolve (repack_with).
  • The images still left out are counted (take_images_left_out).
  • An empty image is no longer looked for a place. The allocator has none for it, and the atlas grew to 8192 looking.

raea-sys-page reads the count after each Vello draw (skipped.rs) and refuses the frame, as it does for a page past the bump buffers. raea_gpu_device::check::fed_checked now reads refusals, so a refused frame fails a video as it fails a still.

Nothing changes for a page whose images fit: the new steps run only where an image was about to be left out.

Testing

Unit tests, no GPU:

  • vello_encoding resolve::tests::images_new_in_each_frame_all_get_a_place: 18 frame-sized images, new in each of 40 frames, a few px apart in size. Unpatched it fails at the second frame (10 of 18 placed). It also checks the count for a frame of 40, and that an empty image neither counts nor grows the atlas.
  • image_cache::tests: the two new steps.
  • raea-gpu-device check::tests: a refused frame fails the fed render by its number. It fails without the fed_checked change.

Renders, on Windows 11 with an RTX 4070 Laptop (Vulkan), release builds, main at bb0a176:

main this branch
bench/layer-atlas/check.sh: video of 18 layers 32 of 48 frames short of 18 tiles 18 tiles in all 48
six stills of it in one call stills 1, 3, 5 draw 10 18 in each
video of 40 layers renders, every frame short fails: frame 0: a page (1920x1080) was drawn without 12 of its images: ...
18 planes with larger, changing perspective (240 frames, two runs) 74 and 74 frames missing a plane, and the runs disagree on 78 frames none missing, and the runs agree
the same, 24 planes none missing in 240 frames
the same, 26 planes fails at frame 4, naming it
ms a frame, 18 planes 25.0 24.2 and 24.6

One still that main drew whole is identical on this branch, pixel for pixel.

The film itself (1,622 frames at 1080p, about twenty frame-sized planes, some blurred), as a video:

main this branch
two renders, frames that differ by more than 6 grey levels 36 0
frames refused 0
frame 700 against a still of that frame alone one run 137 px off (encoding), the other 44,443 px 142 px
frame 918 drawn without two of its planes, in both videos and as a still on its own both planes drawn, in the video and the still

tools/size.sh, layers.sh, names.sh, one-version.sh, no-void.sh and public-guard.sh pass on the branch.

Limits

  • The atlas's size is unchanged, so a page still can't draw more images in one frame than 8192 px a side holds: 28 the size of a 1080p frame when they pack perfectly, about 24 when their sizes differ, 6 at 4K. It now fails instead of drawing without them.
  • An image wider or taller than 8192 px, which Vello also left out silently, now fails its render too. That is a behaviour change for any page that has one and didn't notice.
  • The count is process-wide (a static, like set_bump_full), cleared before each draw and read right after it. raea has one Vello renderer, so it is left at that.
  • Each layer still costs video memory by its box (about 64 to 85 MiB for a frame-sized one here). This doesn't change that.
  • Frame 918's two planes are named by comparing the two builds' pictures. Nothing on main counts what it left out, so that it is main that lacks them is read from the pictures (two more pane outlines on this branch), not measured.
  • Not run: macOS and Linux, P26, WPT. cargo dupes and cargo shear aren't installed here.

Reviewed over two rounds by GPT-6.1 Sol (high effort), a different model family from the one that wrote it. It found one small thing (a measuring resolve counted too), which is fixed, and nothing more in the second round.

Created with Claude Fable 5.2 in T3 Code (Claude Code).

🤖 Generated with Claude Code

…f more than Vello's image atlas holds fails its render

An element with a perspective transform or a filter is drawn apart and placed in the page as an image the size of
its box (raea-sys-filters' placeholder), new in every frame, and Vello copies each into its image atlas. The atlas
stops at 8192 px a side, room for 28 images the size of a 1080p frame, and lets go only of what the last two
resolves didn't use, in one sweep a resolve. So a page of ten such layers or more filled it with the last frames'
images, the frame's last layers (the nearest ones) found no room, and Vello drew them at no size without an error.
A film staged on about twenty frame-sized planes lost a cursor or a mark from single frames, different ones on each
run, with "0 errors, 0 warns".

vendor/vello_encoding, when an image finds no room at the atlas's largest size:
- what the resolve hasn't used is let go, the longest unused first (ImageCache::evict_unused), so last frame's
  placeholders go before a picture this frame's layers drew;
- if an image is still left out, the atlas is packed again with the resolve's images alone, the tallest first
  (repack_with, once a resolve). Images met in paint order cut a guillotine atlas up: 18 a few px apart in size
  didn't all find a place in room for 28;
- the images left out after that are counted (take_images_left_out).
An empty image is no longer looked for a place (the allocator has none for it, and the atlas grew to its largest
looking), and isn't one left out.

raea-sys-page reads the count after each Vello draw (skipped.rs) and refuses the frame, and the fed render now reads
refusals (raea_gpu_device::check::fed_checked): it had no one to read them, so a refused page went into a video as
it came. A still's render read them already.

Tests: vello_encoding's resolver places all 18 frame-sized images of each of 40 frames (unpatched: 10 of 18 from
the second frame) and counts the ones left out of a frame of 40; the cache's two new steps; fed_checked fails a
refused frame by its number.

bench/layer-atlas/check.sh, 18 layers the size of the frame, each with one white tile, on Windows 11 with an RTX 4070
Laptop (Vulkan). Before: 32 of the video's 48 frames short of 18 tiles, stills 1, 3 and 5 of six drew 10, and 40
layers rendered with every frame short. After: 18 tiles in every frame of the video and in each still, and the
40-layer render fails with "frame 0: a page (1920x1080) was drawn without N of its images".

Not changed: the atlas's size. A page still can't draw more images in one frame than 8192 px a side holds (28 the
size of a 1080p frame at best, 6 at 4K); it now fails instead of drawing without them. An image wider or taller
than 8192 px, which Vello also left out silently, fails its render too.

Co-Authored-By: Claude <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T22:05:41.334971Z 0198736 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shinyobjectz
shinyobjectz merged commit db99733 into shinyobjectz:main Nov 10, 2026
4 checks passed
@shinyobjectz

Copy link
Copy Markdown
Owner

Merged, thanks. This explains the frames that went missing from last week's film, and failing loudly instead of drawing without them is the behaviour we want. I'll run bench/layer-atlas on macOS with the next build and report here if anything differs.

shinyobjectz added a commit that referenced this pull request Nov 17, 2026
…rences and guide copies (the music and sound guides, craft's rubric and verbs; cli.md's raea motion, raea bug and clothes flags; feed.md's bug_report and final tag; files.md's rules and render progress), and the bug and rules tools taught
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants