What looks wrong
crates/moon-perf/src/implementation.rs documents three orderings that the code does not implement. This was noticed while looking for a pure function to test; the behaviour was not encoded as a test, because a test would turn the disagreement into a contract.
Output::compare_perf
The doc comment says a positive PerfReport means self performed better than baseline. The shift is baseline_iters_per_sec / self_iters_per_sec - 1, which is negative when self is faster. PerfReport's display then draws an up arrow for a positive shift, so a slower run is shown as an improvement.
Output::sort
The comment says tests with no metadata go at the end. The comparator returns Greater when the left row has metadata and the right row does not, so rows without metadata sort first.
Output's display
The comment says important tests should print at the top. sort orders Importance ascending (Fluff = 0 ... Critical = 4) and the display walks that order, so the least important rows come first.
Why this is an issue and not a fix
The daily test lane does not change production behaviour. Whichever reading is intended (the comments or the code) needs a human decision before a test pins it.
What looks wrong
crates/moon-perf/src/implementation.rsdocuments three orderings that the code does not implement. This was noticed while looking for a pure function to test; the behaviour was not encoded as a test, because a test would turn the disagreement into a contract.Output::compare_perfThe doc comment says a positive
PerfReportmeansselfperformed better thanbaseline. The shift isbaseline_iters_per_sec / self_iters_per_sec - 1, which is negative whenselfis faster.PerfReport's display then draws an up arrow for a positive shift, so a slower run is shown as an improvement.Output::sortThe comment says tests with no metadata go at the end. The comparator returns
Greaterwhen the left row has metadata and the right row does not, so rows without metadata sort first.Output's displayThe comment says important tests should print at the top.
sortordersImportanceascending (Fluff = 0...Critical = 4) and the display walks that order, so the least important rows come first.Why this is an issue and not a fix
The daily test lane does not change production behaviour. Whichever reading is intended (the comments or the code) needs a human decision before a test pins it.