Some identical items are generated with useless stat variation, making them not stack
Problem
Some otherwise identical items can be generated with useless stat differences, preventing them from stacking and leading to odd inventory lists.
* Rings of damage can be generated with (useless) variation on their missile to-hit and damage bonus, making identical rings not stack.
* Amulets and bracers of speed, amulets of perseverance, pendants of beauty, pendants of mana, and diadems of beauty can all be generated with differing numbers of "charges" (a value not used at all for these items), and thus not stack with others of the same kind, even though all other attributes are identical.
How to reproduce it
Acquire many of those items until you can observe the bug, typically with results like this:
Code:
uncursed ring of damage [1s]
heap of 40 uncursed rings of damage [40s]
uncursed ring of damage [1s]
heap of 2 uncursed rings of damage [2s]
heap of 6 uncursed pendants of beauty {Ap+4} [18s]
heap of 2 uncursed pendants of beauty {Ap+4} [6s]
uncursed pendant of mana {Ma+2} [3s]
uncursed pendant of mana {Ma+2} [3s]
heap of 2 uncursed pendants of beauty {Ap+4} [6s]
Notes
Greater Identify can be used on rings of damage to observe the differing missile stats. For the other items, there's no in-game way to know
why you have different stacks.