← Back to Pull requests

vello_research: Download CPU-only buffers by copying their contents #2117

Closed
unknown closed this pull request without merging on Dec 04, 2026 04:41 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 07:13 UTC
Author

With use_cpu, the bump allocators are written by CPU shaders and stay on the CPU, but Command::Download looked up its source as a GPU buffer. With the debug_layers feature, render_to_texture_async always downloads the bump allocators, so it failed whenever use_cpu was set, even with no debug layers turned on:

UnavailableBufferUsed("vello.bump_buf", "download")

with_winit always enables debug_layers, so with_winit --async-pipeline --use-cpu hit this.

For a buffer that only exists on the CPU, this copies its contents into a mapped download buffer. CPU shaders run as they're recorded, so those are the contents a GPU copy would see at that point. I first had it upload the buffer to the GPU and copy it from there, the way indirect dispatches handle CPU buffers. That is one-way, though: a CPU shader that bound the buffer afterwards would panic. Today's downloads all come after the last CPU stage, so that wouldn't trigger, but it would be easy to hit later. It would also have sent the whole line soup (about 40 MB at the default capacity) to the GPU and straight back whenever the validation layer was on.

I checked it headlessly. With this change, render_to_texture_async with use_cpu and no layers gives the same image as the GPU shaders. Together with #2115 and #2116, every debug layer works with use_cpu, including validation, which downloads the line soup.

Diff: 175 lines (+131 / -44) across 2 files Reviewer: DJMcNab Review duration: 4167m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 175 lines diff across 2 files
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.309
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2117"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.4% (MEDIUM) · Higher = larger blast radius
35.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.0% · Safe to merge
14.0%