On the other hand, the pseudocode in installer/doc/devel/partman-auto-recipe.txt gives reasonable results, so its implementation is probably broken.