The Stars Are Also Fire II.
I said here that I remembered only one of the two ways that Poul Anderson's AI might survive the end of the universe. The two ways are presented on p. 546 of The Stars Are Also Fire (New York, 1994). See also the above link.
Sophotects/AI, reproducing in any matter, not just on planets, spread and communicate between galaxies at sub-light speeds. If there is a heat death of the universe, then they will continue to use energy from disintegrating black holes and particles. If there is a cosmic contraction, then they will experience an infinite number of events and thoughts in the finite time before the singularity. In either case, they will be immortal.
Thus, only the first is a way to survive a heat death but both are ways to survive the end of the universe. "In the end was the Word..." (p. 547) This has to be the ultimate sf speculation.