Skip to content

Support bounded multi-row GPU gray dispatch - #146

Merged
rsasaki0109 merged 1 commit into
mainfrom
codex/bounded-gpu-gray-dispatch
Oct 11, 2026
Merged

rsasaki0109 merged 1 commit into
mainfrom
codex/bounded-gpu-gray-dispatch

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

GPU RGB-to-gray previously dispatched every flat workgroup on the X axis: 4096x4096 requires 65,536 groups, exceeding the requested 65,535-group limit despite valid texture dimensions. Keep the original linear shader for single-row dispatch and distribute larger workloads across a balanced rectangle of 256-lane workgroups. Reject padding groups before index multiplication to prevent u32 wrap.

Validate runtime, RGB channels, dimensions/pixel count, existing compute/binding limits and profiler capacity before allocation or cache initialization. Linear and grid pipelines initialize independently in one runtime-owned family, sharing the original layout/16-byte uniform. BT.601 bytes, gray metadata, one pass, transfer/query receipts and public signatures remain unchanged; no scratch or payload copy is added.

Validation:

  • Six new tests check every one of the 16,777,216 possible RGB values through the public large-image path (67,108,864 exact RGBA bytes), plus 120 forced-grid mappings (3,655,572 bytes) against independent CPU and frozen linear outputs. A device probe verifies 96 index/validity words at u32 boundaries and padding groups without giant textures.
  • Invalid limits/ownership/channels/capacity, independently lazy kernels, strided ROI, concurrent cold calls, live outputs and texture-pool reuse/budget are covered.
  • 148 native image/point GPU regressions pass; strict default/all-feature Clippy, two WASM compilation profiles, formatting and diff checks pass. Browser execution is not claimed.
  • Seven release resident conditions with two warmups and twenty rounds; every output is checked. The frozen shader shares the current host executor, so this is not historical API-overhead measurement. Unsupported old large-image dispatch has no baseline timing. All supported controls and the new capacity measurement are published; no speedup is claimed.

Implementation and full diagnostic note.

Based on merged PR #145 (main 95fb8e8). Merge is gated on the frozen source head, all 114 named checks succeeding, no pending/failed checks and a clean merge state.

@rsasaki0109
rsasaki0109 merged commit a9ba90e into main Oct 11, 2026
115 checks passed
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