AFAICS this sort of thing is unavoidable; we just try to make it as unlikely as possible.  Those asserts are the lowest values I could make the test pass at; they're not strict bounds.  If you pull the latest branch and #define DEBUG_INDEP in mapper.c you can see the order that things are chosen and why items are moving around.  Note that the 'a' line is the chooseleaf type (the rack) and the 'b' line are the devices nested beneath that appear in the final result.