In general, identity resolution is a difficult problem. See #20116 (comment) and many other similar comments over the years.
However, maybe we could provide a hook that applications can do to implement their own identity resolution when EF starts tracking a graph. This likely wouldn't cover difficult were merging needs to happen, but simple cases where duplicates can be essentially ignored could become much easier.