However, I accidentally stumbled upon a seed that worked totally differently. How is this possible since almost all other seeds work fine?
I did a bunch of searching on Seed 2664 on Pocket Edition, and I finally found a feature that looked just like the Windows 10 seed... but about 600 meters due north across the ocean and with east and west swapped! And the views are the same... but then not the same. It's like the Through the Looking Glass book where things on the other side of the mirror are the same but not quite the same. It's fun to look at the two images below and spot all the differences.
It seems obvious that there are at least two "passes" to terrain generation. In the first pass, the shape of the land is formed and biomes are assigned. This is done via some function that extends the terrain infinitely in all directions (blue arrows in the concept diagram below):
The origin -- i.e., coordinates (0,0) -- of this map is apparently not fixed but assigned after
terrain generation. Because the origin also becomes the world spawn point, the game has to make sure
that Steve does not spawn in deep water in the ocean. So the first candidate is point A. I have
noticed that, although Windows 10 Edition and Pocket Edition are normally near identical, sometimes
Pocket Edition spawns Steve in a slightly different location than Win10 -- i.e., maybe a few meters
away. If this is the case, it's possible that in the case of Seed 2664, the deep water check PASSED
for Pocket Edition and failed for Windows 10 Edition. So, for Windows 10, the game tried another
origin candidate, point B. That one worked. Also it chose a different direction for west (the
direction you face at spawn). Once the origin is chosen, chunks are assigned, then the details
are filled in: trees, ore locations, cave locations, generated structures, etc. Because of the
different origin, the randomizer was thrown off just enough to produce different results.