Skip to content

perf(gpu): share Canny classification and root flags - #185

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

rsasaki0109 merged 1 commit into
mainfrom
codex/gpu-canny-shared-state-flags

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

Depends on #184 (Trimmed ICP selection tree); retarget to main after that exact source is merged.

Canny previously allocated separate per-pixel classification and strong-neighbor root flags. Preserve classification in the low two bits of an atomic word and OR the root flag into bit 2, removing one 4*N buffer for every aperture. Full parent indices, complete hysteresis, exact edge bytes, five/six passes, metadata and explicit image transfers remain. Required storage-buffer count falls from five to four; classification destination footprints and receipts reflect the removed allocation.

At 4K, requested private scratch falls from 165,888,008 to 132,710,408 bytes (aperture 3) or from 199,065,600 to 165,888,000 (5/7): 33,177,600 bytes saved. Two isolated surveys show 1.183–1.574x completed resident improvements across the tested 4K fixtures. Full-call results are mixed and retain adverse cases. Timings include acquisition/encoding/completion under the same default 64 MiB retention policy; shader-only or general-device speedup is not claimed. All 20 paired rows and conditions are in notes/2026-10-13_gpu_canny_shared_state_flags.md.

Validation:

  • 864 edge conditions match CPU and frozen PR Add resident GPU Canny edge extraction #180/Reduce resident GPU Canny gradient memory by half #181/Halve GPU Canny horizontal scratch without rounding #183 GPU implementations.
  • 433,320 shared state words match old classification | (old root flag << 2), including deliberately poisoned scratch; twelve contended/long/disconnected masks match frozen GPU and independent BFS.
  • Native Canny: 13 passed, zero failed, four measurements ignored. Image regression: 92 passed, zero failed, 17 measurements ignored. Historical gradient and horizontal surveys were explicitly re-run against actual frozen layouts.
  • All-feature/all-target GPU Clippy, feature-free GPU, GPU-image WASM, minimal gpu-image facade and formatting checks pass. Browser execution was not measured.

@rsasaki0109
rsasaki0109 changed the base branch from codex/gpu-icp-trim-selection-tree to main October 13, 2026 10:22
@rsasaki0109
rsasaki0109 merged commit f88542f 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