Skip to content

Report image draws omitted by atlas capacity limits - #1862

Open
Quik2007 wants to merge 1 commit into
linebender:mainfrom
Quik2007:qos/atlas-drop-diagnostics
Open

Quik2007 wants to merge 1 commit into
linebender:mainfrom
Quik2007:qos/atlas-drop-diagnostics

Conversation

@Quik2007

@Quik2007 Quik2007 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Problem

While debugging missing dynamic images, I found that Vello Classic silently omits an image draw when atlas allocation still fails after growing the atlas and evicting stale entries. The resolver uses no atlas location for that image and continues rendering, so the missing image has no visible explanation in the application log.

This can affect applications whose image set can exhaust the maximum atlas. Applications with small, fixed image sets are unlikely to encounter it.

Approach

Report the existing failure rather than change atlas allocation or attempt recovery. The renderer emits one warning on the first resolve pass that omits images. Later omissions are suppressed to avoid logging every affected frame.

This is limited to logging because the current renderer API has no structured diagnostic channel for this condition. It does not recover the image or let the application react programmatically.

Changes

  • Count omitted image draws during each resolve pass.
  • Keep a cumulative count over the image cache lifetime to suppress warnings after the first failing pass.
  • Emit one renderer warning containing the atlas dimensions and number of draws omitted in that pass.
  • Add a test covering per-pass reset and cumulative counter behavior.

The warning does not identify the affected image. It also cannot distinguish an image larger than the maximum atlas from an atlas occupied by other live images.

Testing

  • cargo test -p vello_encoding --lib --all-features --locked (32 passed)
  • cargo test -p vello --lib --all-features --locked
  • warning-denying Clippy for both crates on Rust 1.95
  • repository formatting and diff checks
  • the full cross-platform CI matrix

Performance impact

I found no measurable steady-state performance impact. I benchmarked the changed per-resolve bookkeeping in release mode on an AMD Ryzen 9 7940HS, pinned to one core. Each revision ran 200 million iterations in six alternating runs.

Revision Median Range
Unmodified base 1.519 ns/resolve 1.506–1.547 ns
This PR 1.526 ns/resolve 1.521–1.543 ns

The median difference was 0.007 ns, or 0.46%, and the ranges overlap. This is below the resolution of the benchmark and is not evidence of a regression.

The benchmark covers the bookkeeping performed on every image resolve. It does not include the failure-only warning. Each omitted image adds two saturating integer increments; the first failing resolve also emits one log message. Logging is more expensive than the counters, but occurs only once per image-cache lifetime after atlas allocation has already failed.

AI usage: This PR was prepared with assistance from an AI coding tool.

@Quik2007
Quik2007 force-pushed the qos/atlas-drop-diagnostics branch from 2a88eea to 9f0c290 Compare August 31, 2026 15:27
@Quik2007 Quik2007 changed the title Report image-atlas allocations that are dropped Report images omitted by a full atlas Aug 31, 2026
@Quik2007
Quik2007 force-pushed the qos/atlas-drop-diagnostics branch 3 times, most recently from 491894f to 7efa877 Compare September 1, 2026 06:47
@Quik2007 Quik2007 changed the title Report images omitted by a full atlas Report image draws omitted by atlas capacity limits Sep 1, 2026
Count image draws that resolution omits after atlas allocation fails and emit one renderer warning. Keep the signal diagnostic-only and rate-limit it over the cache lifetime.
@Quik2007
Quik2007 force-pushed the qos/atlas-drop-diagnostics branch from 7efa877 to a79561c Compare September 1, 2026 06:47
@Quik2007
Quik2007 marked this pull request as ready for review September 1, 2026 19:35
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.

1 participant