Skip to content

Five partial_cmp().expect("no NaN") sorts are latent panics; total_cmp is free #54

Description

@vyncint

Five sorts use partial_cmp(..).expect("no NaN") on f64 costs, medians and speedups: cli/main.rs:629, main.rs:777, tui/app.rs:305, report/build.rs:136, build.rs:172. Today's model produces finite costs or INFINITY (which orders), so the expect does not fire — but a NaN from a future model term or a malformed results JSON turns a report into a panic. f64::total_cmp is a total order, free, and makes the question moot.

Done when

  • No partial_cmp(..).expect remains; total_cmp in its place, with NaN documented as sorting last.
  • A test feeds a NaN cost through the ranking and the report and gets a result, not a panic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions