Unwinnable
While any given game of NetHack may be very difficult to complete, it is generally understood that every game is winnable — that is, no game is created that the player cannot win.
There is, however, a couple of ways that a game may be rendered unwinnable. If the player unsuccesfully performs an altar conversion by sacrificing at a cross-aligned altar with negative alignment, he or she is converted to the alignment of the altar. If this happens before the player has completed the quest, the game is unwinnable. If the player had once already entered the quest, is neutral, and is not a wizard, the player can wish for the Eye of the Aethiopica to branchport to the quest. The quest must be completed to get the Bell of Opening, but cannot be entered if the player is not of his or her original alignment. A player's alignment can only be converted once, and the quest leader will "see through" a helm of opposite alignment. Thus, having one's alignment changed via altar conversion before completing the quest yields an unwinnable game.
Also, the game may be rendered unwinnable if a demon prince steals the Amulet of Yendor and then accepts a bribe from the player. Because accepting a bribe causes the demon to be removed from the game, along with their inventory, the Amulet will cease to exist. Because the player obviously needs the amulet to ascend, the game is then rendered unwinnable.
The best a player can do in such a situation is escape the dungeon with the Candelabrum of Invocation, the Book of the Dead and any other sources of bragging rights.