Partial Smoothness And Constant Rank