Measured on an RTX 5080, one worker (nsys), 16M EIGER rotation set, per frame:
spot-finding kernels 757 -> ~383 us. Output is bit-identical: integer sums
and a deterministic candidate/spot order throughout.
- flag_strong reads the image only where a strong pixel can be: the plain
ring pass notes each 32-pixel word's largest value, a geometry table gives
the rings each word touches, and a word below the lowest of their
thresholds is skipped. One thread per word writes the whole word, so the
ring buffer needs no clearing or atomics. 128 -> 12 us.
- analyze_pixel with candidates uses 16-row tiles (only tiles near a
candidate are worked, and each warp's serial chain of rows is short) and
issues the entering/leaving row loads before the window scans; the window
count is summed in 32 bits. 254 -> 72 us. The dense path keeps its tiling.
- analyze_candidates reads its column window with unconditional, unrolled
loads; through value_at each load waited for its previous-pass bit and
the row before. 74 -> 34 us.
- scatter_bits emits a block's range with the whole warp (prefix sum over
the words' bit counts, same order). 32 -> 6 us.
- finish_components split into label (one block), sum (all blocks, integer
atomics) and filter/compact (one block); a component's sums no longer walk
the list from its first member to its last. 26 -> 12 us.
Tried and not kept (slower on sm_120): warp-aggregated ring sums and a
low-value histogram fast path in reduce_rings_shared, a precomputed
tile-needed map, unrolling analyze_pixel's row loop.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3