The assumption that is made when considering the reaction of magnesium and 2 m HCl is that the solid magnesium is uniform all throughout so that the reactant's mass can be calculated. Also, in order to obtain a complete reaction, there should be an excess HCl to completely consume the magnesium.