Do all the levels in Nethack get generated at Start or are they generated as they are reached?

Just curious, in Nethack 343 are all the dungeon levels generated at startup, or do they only get generated by entering them? In particular, are the Amulet and Bag of Holding fixed at start or are they akin to Schroedinger's cat?
Best Answer
I have done far more experimenting with Wizard mode and save-scumming than I really ought to have.
I can say with reasonable certainty that the Dungeon branches, are determined at game start, because the CTRL-O command(in wizard mode) tells you where they are.
Level maps themselves are different if you first enter them after loading a copied save than the first time you entered them, so I believe that they are generated on first visit.
Pictures about "Do all the levels in Nethack get generated at Start or are they generated as they are reached?"



Adeon - Live Nethack Speedrun
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: RF._.studio, William Fortunato, Mikhail Nilov, RODNAE Productions