The mask rewrite replaces a BFS dilation with a separable box-max, a full-frame border flood with a
bounded one, and three median passes with a single bin-and-rank - four separate equivalence
arguments, none of them obvious by inspection. The reference count in the first test was taken from
the serial implementation before any of it was picked, and is unchanged by all three commits.
Two properties the reference alone cannot cover: the mask must not depend on how many threads split
the per-pixel passes, and it must not depend on which shard a frame was accumulated into - including
the maximum, which lives in a single shard when the reflection is on one frame. A four-armed scene is
invariant under a quarter turn and so must its mask be, which is the sharpest probe available for the
x and y passes being written differently.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VfYvJT5Nb71suJCowRBn5z