linebender / linebender/vello

[vello_hybrid] A single encoder with too many commands can permanently stall (Metal backend)

Open
#1,246 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Context

This issue is split out from another broader performance investigation regarding Vello Hybrid. If Vello Hybrid has a lot of work to do, and pushes a lot of work onto the `CommandEncoder`, it is possible to permanently stall depending on the wgpu graphics backend.

### Repro

Run a very expensive scene (e.g. the complex compositing/mixing scene), on a large monitor using the Metal graphics backend. The scene will never render. Using `lldb` to inspect the process yields:

```
frame #3: 0x00000001a3b8c90c Metal`-[_MTLCommandBuffer initWithQueue:retainedReferences:synchronousDebugMode:] + 188
```

We get the same diagnostics as https://github.com/gfx-rs/wgpu/issues/1960.

As a quick validation, I wrote a proof-of-concept where Vello Hybrid owns the `CommandEncoder` and periodically flushes it. With this change the stall no longer reproduces.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the complex compositing/mixing scene with the Metal graphics backend on a large monitor and inspect the Vello Hybrid CommandEncoder ownership. Use the referenced wgpu diagnostics and the proof-of-concept periodic flush as investigation points. Done means the expensive scene renders without permanently stalling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.