I've been working on similar (but much simpler and 2d) algorithm, and the gist of it was:
- divide infinite world into 2d chunks of constant size that easily fit in memory
- when player is nearby - deterministicaly generate edges of the visible chunks basing on perlin/simplex noise and random number generator seeded with the world coordinates of the chunk
- fill the chunks basing on 2d markov chains trained on hand-crafted map, starting with the edges going inwards
It needed a lot of training data to produce something that makes sense with even small number of possible tiles, so in the end I just generated everything with simplex/perlin noise and some heuristics.
I guess instead of markov chains I could use explicit rules to fill the chunks, like this seems to do.
But it had the advantage that it was very fast - because you didn't need to remember everything from the starting place of the player. You could teleport 1000 screens left, and then back, and everything worked fast and regenerated everything the exact same way.