[perf] WebGPU GPU-owned instance runs upload one writeBuffer per element (RenderingElement3D-WebGPU.cpp) #131

Closed
opened 2026-06-17 21:18:55 +02:00 by jorijnvdgraaf · 0 comments

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).

Location: implementations/Crafter.Graphics-RenderingElement3D-WebGPU.cpp:148-151
Severity: low · Effort: moderate · Category: api-usage

Problem

For transformOwnedByGpu runs, one FlushDeviceRange per element pushes 16 strided bytes each, paying per-call WebGPU validation/encode/JS-boundary cost; the CPU-driven arm correctly batches. Currently latent — transformOwnedByGpu is set nowhere in-repo (per the file's own no-op-refactor comment).

Fix

Store instance metadata in a separate contiguous host array and upload the run in one FlushDeviceRange, or write the full run once and let the compute pass overwrite transforms.

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass). **Location:** `implementations/Crafter.Graphics-RenderingElement3D-WebGPU.cpp:148-151` **Severity:** low · **Effort:** moderate · **Category:** api-usage ### Problem For `transformOwnedByGpu` runs, one `FlushDeviceRange` per element pushes 16 strided bytes each, paying per-call WebGPU validation/encode/JS-boundary cost; the CPU-driven arm correctly batches. Currently latent — `transformOwnedByGpu` is set nowhere in-repo (per the file's own no-op-refactor comment). ### Fix Store instance metadata in a separate contiguous host array and upload the run in one `FlushDeviceRange`, or write the full run once and let the compute pass overwrite transforms.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#131
No description provided.