I'm amazed at the manual lens correction feature in ACR. As an old programmer, I'm very impressed by the coding it must have taken. Finding natural lines in an image and then morphing pixels with very little artifacts is a big accomplishment.
But at the same time I'm curious why sometimes it works very well, yet other times it seems to fail to find lines that appear to be obvious to the human eye. I'm also curious why it behaves quite differently on a raw image vs. as a filter on a layer of the same image.
The sample below shows both the amazing power and the curious failures. When I first selected "Both" on the raw file, it almost perfectly leveled both vertical and horizontal lines. And significant morphing was done, with no obvious degradation.
Selecting Vertical also did a good job. The right vertical lines were found and straightened. But selecting Horizontal failed. None of the horizontal lines are close to level. Selecting Auto caused changes, but apparently with some sort of compromise that is no improvement.
And look at "Both as Filter". It was done on a 16 bit ProPhoto layer, so I can't imagine why it is so much different that the raw version. That's a problem when working on a bracketed set of images for HDR. The lens corrections are quite different when done on the raw images with widely different exposures. Some lines become less obvious in very low or very high exposures, thus the results won't align very well in an HDR merge.