The S1K special stage mode uses a bunch of pieces and then puts them together in a specific pattern to generate a stage. I believe there are two billion stages, if I remember correctly, but that's just using every single combination of the stage parts in the game in every configuration. It's not like they actually made every single one of those stages.