My code was relatively unoptimized, it ran for 95 days on an 8-core 16-thread AMD Ryzen 5750G to crunch all the data. I have never published my code or results. I should really do it...
I downloaded a digital earth model of about 30 gigabytes from http://www.viewfinderpanoramas.org/Coverage%20map%20viewfind... which had a resolution of 3 seconds, so I had the elevation of each 90x90 meters "tile" of land. I wrote a simple algo in C that: finds potential viewpoints (mountain peaks or plateaus above a minimum ), calculates the longest sightline 360° around you, taking into account an atmospheric refraction coefficient (I used 0.13 which seems to be a default used by some panorama tools like https://www.udeuschle.de). It's really basic trigonometry: look one tile ahead of you, and the next one, etc, until you find the one with the highest vertical angle of view. Stop one sightline exploration when reaching a certain maximum distance (750 km in my implementation) when it becomes mathematically impossible to find a visible tile beyond this distance. And I found the longest sightline:
In Kyrgyzstan from Pik Dankova (41.059167,77.683333) which is at 5977.5 meters (in my DEM data), you can see 538.1 km into China if you look toward bearing 169.7° (roughly south) as you see some distant minor peak at 36.295364,78.75593 which is 6444.0 meters high. However this sightline is already known. But it's only theoretical. No one ever encountered good enough atmospheric clear-sky conditions to observe it from Pik Dankova. Using the panorama tool maintained by this cool German guy, you can verify it: https://www.udeuschle.de/panoramas/panqueryfull.aspx?mode=ne...
However one notable finding my tool gave me was it discovered the second longest sightline that is competely unknown up until this day AFAIK:
In Colombia, from Pico Cristóbal Colón (10.838333,-73.687500) which is at 5668.5 meters (in my DEM data), you can see 502.6 km over the plains of the Caribbean region all the way to the Colombian Andes if you look toward bearing 206.2° (roughly south-south-west) as you see some distant peak at 6.777286,-75.692304 which is 3347.0 meters high. Here you can verify it here: https://www.udeuschle.de/panoramas/panqueryfull.aspx?mode=ne...
I am not sure if this Comlombian sighline has ever been observed.
As I said I should really publish my code and results. And at some point I would like to optimize it and re-run it using a higher-precision DEM with 30x30 meters tiles instead of 90x90 meters. I think there are a few 30-meter DEMs available but I need to find the highest-quality one.