Sam went on a wild goose chase, ripping open framework binaries to see where this layout was happening. It turns out, it’s not even remotely that deep. On your Mac, right now, go look at this file:
/System/Library/PrivateFrameworks/ContactsUICore.framework/Versions/A/Resources/CNUIIdentityAvatarConfiguration.json
That’s it. That’s the genius algorithm. It’s a JSON file that precisely defines the size and position of these avatars.
This probably isn’t generated programmatically – it’s likely a designer somewhere at Apple, meticulously moving circles around on a canvas, nudging them pixel by pixel until they strike the right visual balance. The file is filled with truly hideous numbers that have no place in a design system — 23.5, 7.5, -6 — but it all works.