Find a contact in a pair record's chain by sub-shape ids.
All chain contacts share the id-sorted body pair, so the caller's existing body-order sort covers orientation — only the two sub-shape ids need matching.
global contact state
persistent pair state (holds the per-record chain heads)
pair record index to search
sub-shape ID for body A
sub-shape ID for body B
The contact if found, null otherwise
Find a contact in a pair record's chain by sub-shape ids.
All chain contacts share the id-sorted body pair, so the caller's existing body-order sort covers orientation — only the two sub-shape ids need matching.