Pretty sure dedupe is done manually by u/dang.
Yes, he can manually merge duplicate submissions and their comments.
But there's times when I've submitted items that are dupes and it just takes me to the recent submission and adds an upvote. Now here's something weird: I just tested this by submitting the URL from this submission with the same title and it immediately took me to the discussion from two days ago.
So I'm really confused how this dupe got through.