Skip to content

perf(renderer): avoid repeated direct image-heap work after slot exhaustion #362

Backlog

Description

@simnJS

What to optimize

Measure how often the renderer retries direct image-heap binding after slot exhaustion and how often the same tables fall back to another binding path. This is related to the persistent descriptor-pool pressure in #340 and concerns the separate direct image-heap allocation path.

One Linux/NVIDIA capture recorded seven first overflows and 41,753 subsequent requests for already-overflowed views across 23 garbage-collection windows. Request counts alone do not establish the cost of a retry or the cause of omitted draws.

Acceptance

  • Measure direct-heap occupancy, unique slots needed, first and repeated failures, and the CPU time and allocation cost of the fallback path.
  • Reduce repeated work after exhaustion, while allowing a later retry when enough slots become available.
  • Verify that the fallback binds equivalent resources and respects descriptor lifetimes. Check that peak memory stays within the same budget on the comparison workload.

Activity

  1. added
    help wanted
    area: gpu-memory
    perf
    on Nov 27, 2026
  2. github-actions commented on Nov 27, 2026

    @github-actions

    For the baseline, can you measure CPU time spent on repeated direct-heap failures separately from time spent building and binding the fallback descriptors in the same capture? That will show how much work skipping the retry can actually save.

    For the optimization, use the number of additional unique slots the table needs, not its total size, to decide when to retry. Include a test where reclamation first frees too few slots and then frees enough, with the fallback descriptors still in flight when the direct path becomes available again.

  3. smecherucarbarou commented on Nov 27, 2026

    @smecherucarbarou
    Contributor

    I'll take this one. I'll investigate the repeated direct image-heap failures, measure their overhead, and work on avoiding unnecessary retries while preserving fallback descriptor lifetimes and allowing recovery after reclamation.

  4. simnJS commented on Nov 27, 2026

    @simnJS
    OwnerAuthor

    A trace from the Linux VRAM investigation in #363 may help verify the table fallback. While a diagnostic limited image creation through the direct heap, the later loading spike included 5,515 MiB of live device-local image allocations and 1,031 MiB on the host heap from RenderExecutor::ResolveTableTexture. Only 947 MiB of device-local image allocations were attributed to ImageHeap::Rebind at that point. The VMA local heap reached its 9,216 MiB cap. This identifies where the images were allocated. The trace did not record the admission decision, so it cannot yet distinguish heap capacity from another reason the renderer selected ordinary texture tables.

  5. github-actions commented on Nov 27, 2026

    @github-actions

    Thanks, the #363 trace helps attribute the memory spike, but it doesn’t show why the renderer chose the fallback. Can the next capture record the admission outcome at the table binding decision and distinguish insufficient direct-heap slots from other reasons for using the ordinary table path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: gpu-memoryhelp wantedperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions