By the way, one helpful tool that helped me navigate the EDID dump was Kaitai Struct [2]. It shows a side by side view with the hex view and the EDID structure, and it highlights the hex values in real time as you navigate the structure. Unfortunately [3] it doesn't support the extension blocks that the author needs.
I had a problem with the monitor where the EDID gets constantly erased if the HDMI cable is unplugged in certain conditions. Usually there's a service menu hidden somewhere you can enable so that the EDID EEPROM becomes writable. That doesn't seem to work in my case, so I ended up opening the monitor and hard wired the write enable pin. This happens so often (it's an old monitor I got for free) I drilled a hole and put a switch on the pin lol.
Why doesn't macOS use the ports that monitors are connected to, to determine their layout (only treating a monitor as having moved if its port's EDID doesn't match the EDID in that port from before sleeping)?
Ports are not a good monitor identifier, as they can be dynamic and seemingly non-deterministic when you start to involve hubs, docks and muxes, and having a monitor change identifier because you used USB port 1 instead of port 3 for your dock is not particularly helpful.
In the Linux world, stable identifiers are made from a combination of product name and serial number.
Almost certainly the most common use case for multiple screens on Macs at this point is notebooks connected to an external monitor, some of the time. On modern Macbooks it's mostly all just Thunderbolt ports too, which are supposed to be interchangeable, people can plug in whatever wherever without thinking about. People may also run a monitor via a TB dock, which again may plug in wherever. Though even with desktops in general, tying meatspace spatial information to port plugin fundamentally seems like a bad idea. Physical screens are much less likely to be moved then a cable, and the number of people who'd prefer to be able to treat the same type of port as functionally identical vs those who want that mental overhead seems low.
That's a poor excuse for shuffling screens that, like rather many (so not a rare bug), don't have unique serial numbers in their EDIDs, just because the user folded the laptop to sleep, and unfolded it the next day after breakfast to continue working/using.
Resolving assignments of cloned screens in the absence of physical-plugging-involving hotplug (that thus only comes from the monitor(s) also turning off when the laptop goes to sleep) by random instead of remembering physical ports/paths to them, across sometime as tame as a suspend-to-RAM, is frankly terrible UX.
Trying to use uniqueness features to be sticky across port swaps is good.... but I'd not be surprised if my grandparents would actually assume the way to swap them is by swapping the ports they are plugged into. Especially I'd expect them to be confused/surprised by swapping the plugs _not_ resulting in swapped content.
Docks with numbered ports make me want to have all things aligned. First monitor left to right needs to connect to port 1 and have number 1 in the system. I know this is not required but feels untidy if not done.
> An EDID override like this would be helpful for macOS as well, where the monitors swapping around after standby is a real annoyance [0] [1]
Are you sure this is still true? I had this problem for a very long time but it seems to have been fixed with a recent macOS update. It must have been one of the Ventura point releases.
I recently went down this rabbit hole and assumed the duplicated serial number in the EDID was playing a role in triggering it but even after switching to different monitors later on MacOS would still do this all the time. Just recently I moved my keyboard and mouse to the primary display that's connected over USB C and so far the problem has not reoccurred. No idea if having them on the secondary display was triggering the bug or if moving to the primary is just a way to mitigate it but FWIW, unless I've hit a string of good luck, it seems that for displays that also have USB combined MacOS takes the HIDs connected into account when deciding to flip your displays around every two seconds.