[TD] Improve heuristic metrics collection (#109305)
Fixes a bug with heuristic metrics collection where the metrics would sometimes inaccurately claim a heuristic to have ranked a test more highly than any other heuristic.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109305
Approved by: https://github.com/clee2000