Skip to content

perf(gpu): reuse Canny horizontal storage for state flags - #186

Merged
rsasaki0109 merged 1 commit into
mainfrom
codex/gpu-canny-reuse-horizontal-state
Oct 13, 2026
Merged

rsasaki0109 merged 1 commit into
mainfrom
codex/gpu-canny-reuse-horizontal-state

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

Canny's horizontal rows are dead after the vertical gradient pass. Reuse that same atomic state/flag binding for packed rows, then overwrite it only after all gradients finish. Remove the separate horizontal buffer/binding and unused aperture-3 dummy. Requested private scratch becomes 16*N bytes for every aperture with three storage buffers; full parent indices, exact gradients/edges, five/six passes, metadata, stage destination receipts and explicit image transfers retain behavior.

At 4K, apertures 5/7 save another 33,177,600 private bytes (165,888,000 to 132,710,400); aperture 3 removes eight bytes. Two isolated surveys give 1.040–1.215x completed resident improvements across the tested 4K fixtures. All full-call 4K intervals include one; a Full HD full-call case has an adverse interval. Default pool/driver/resource behavior is included, so shader-only or general-device speedup is not claimed. All 20 rows and limitations are in notes/2026-10-13_gpu_canny_reuse_horizontal_state.md.

Validation:

  • 864 edge conditions match CPU and four frozen GPU generations. 288 complete snapshots capture rows before overwrite, compare independent integer convolution and preserve 4,018,560 exact final state words against actual frozen PR perf(gpu): share Canny classification and root flags #185.
  • Nine cold native allocation cases verify exactly three leases, distinct state/parent buffers and actual buffer sizes summing to 16*N, including 4K and aperture 3.
  • Native Canny: 15 passed, zero failed, five measurements ignored. Image regression: 94 passed, zero failed, 18 measurements ignored. The historical PR Halve GPU Canny horizontal scratch without rounding #183/perf(gpu): share Canny classification and root flags #185 paired call test was re-run against actual frozen layouts; contaminated timing attempts were discarded in full.
  • GPU all-feature/all-target Clippy, feature-free GPU, GPU-image WASM, minimal gpu-image facade and formatting checks pass. Browser execution was not measured.

@rsasaki0109
rsasaki0109 merged commit df2a200 into main Oct 13, 2026
125 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