I'm unaware of how it does the rolls on stacks, but I've found that when I reverse engineer a stack the chances of getting the higher recipe is higher. It could still be pure chance but it still has worked that way for me. It's possible it still only does one roll but the chances for success go up with each item in the stack, so instead of having a 1 in 10 chance (I'm making up numbers for the sake of my argument, I don't really know the odds) with one item, you now have a 2 in 10 with a stack of two