The rank = number of independent rows = number of nonzero pivots after Gaussian elimination. Watch each pivot get claimed and dependent rows collapse to all-zeros.
eps decides "zero"; over Z/pZ and GF(2) zero is exact.
See junior.md for the walkthrough and professional.md for the proof that #pivots = rank and that row rank = column rank.