From suharto_anggono at yahoo.com  Sat Apr  7 00:03:07 2018
From: suharto_anggono at yahoo.com (Suharto Anggono Suharto Anggono)
Date: Fri, 6 Apr 2018 22:03:07 +0000 (UTC)
Subject: [Rd] Part of fastpass in 'sort.list' can make sorting unstable
References: <1729171495.2659788.1523052187300.ref@mail.yahoo.com>
Message-ID: <1729171495.2659788.1523052187300@mail.yahoo.com>

In the code of functions 'order' and 'sort.list' in R 3.5.0 alpha (in https://svn.r-project.org/R/branches/R-3-5-branch/src/library/base/R/sort.R), in "fastpass, take advantage of ALTREP metadata", there is "try the reverse since that's easy too...". If it succeeds, ties are reordered, violating stability of sorting.

Example:
x <- sort(c(1, 1, 3))
x  # 1 1 3
sort.list(x, decreasing=TRUE)  # should be 3 1 2



[Rd] Part of fastpass in 'sort.list' can make sorting unstable
Suharto Anggono Suharto Anggono