Sorting with Persistent Comparison Errors
- The paper presents algorithmic milestones achieving O(n log n) time with O(log n) maximum dislocation under persistent error models.
- It systematically analyzes multiple models—recurrent random, dirty versus clean, and adversarial—to highlight trade-offs between error persistence and sorting quality.
- The findings demonstrate that, due to fixed comparator biases, approximate sorting with controlled dislocation becomes the natural objective over exact recovery.
Searching arXiv for recent and foundational papers on persistent comparison errors in sorting. Sorting with persistent comparison errors studies comparison-based ordering when the response associated with a pair of elements is not freshly randomized at each query. Instead, once the comparator induces an outcome for a pair, repeating the same comparison yields the same answer. In the Braverman–Mossel setting, each pairwise comparison is wrong with fixed probability and then remains fixed; in learning-augmented variants, a fast but unreliable comparator induces a fixed tournament that may disagree with the true order; and in adversarial formulations, sufficiently close items or comparisons incident to a bad set may be answered arbitrarily (Geissmann et al., 2018, Geissmann et al., 2017, Bai et al., 2023, Trevisan, 2023, Jaiswal et al., 11 Feb 2025). Across these formulations, exact sorting is either impossible or no longer the operative objective, and the focus shifts to approximate orders with controlled dislocation, to approximation guarantees that respect an ambiguity radius, or to minimizing the number of expensive exact comparisons.
1. Model families and the meaning of persistence
The defining feature of persistence is that repeated queries on the same pair do not provide independent evidence. In the recurrent random model, the input consists of distinct elements, each pairwise comparison is wrong with fixed probability , errors are independent across pairs, and once the comparison outcome for a pair is determined, repeating that comparison later always yields the same outcome (Geissmann et al., 2017). The 2018 optimal-sorting formulation states the same basic regime as the persistent comparison error model introduced by Braverman and Mossel: every comparison between two elements is independently wrong with fixed probability , and comparisons cannot be repeated in any useful way because the outcome for a pair is persistent (Geissmann et al., 2018).
A second family replaces probabilistic recurrent errors by a fixed flawed comparator. In the dirty-versus-clean model, the algorithm receives a clean comparator , which is exact but expensive, and a dirty comparator, which is fast but may be wrong. For any distinct , the dirty relation induces exactly one directed edge, so it forms a tournament rather than a total order, and it need not be transitive, so cycles can occur. This directly models persistent comparison errors as a fixed incorrect predictor of the true order (Bai et al., 2023).
A third family strengthens the adversarial aspect. In the adversarial comparator model, if , then the comparator must return the correct order, while if , the answer may be arbitrary and can depend on the full history of previous queries; the objective becomes -approximate sorting or selection rather than exact recovery (Trevisan, 2023). In the robust-sorting tournament model, a tournament 0 is 1-imperfect with respect to a hidden order 2 if every comparison between two good nodes 3 is correct with respect to 4, while any comparison involving at least one node in 5 can be arbitrary (Jaiswal et al., 11 Feb 2025).
| Model | Persistence mechanism | Primary objective |
|---|---|---|
| Recurrent random errors | Each pair is wrong with fixed probability 6, and repetitions return the same outcome | Minimize maximum and total dislocation (Geissmann et al., 2017) |
| Dirty and clean comparisons | Dirty comparator is a fixed possibly cyclic tournament; clean comparator is exact and expensive | Minimize clean comparisons (Bai et al., 2023) |
| Adversarial comparator | Close pairs may be answered arbitrarily, possibly adaptively | 7-approximate sorting/selection (Trevisan, 2023) |
| 8-imperfect tournament | Edges incident to bad nodes may be arbitrary | Maximize agreement with hidden order (Jaiswal et al., 11 Feb 2025) |
A common misconception is to treat these settings as ordinary noisy sorting with resampling. That is inaccurate. In the persistent regime, repeated comparison does not attenuate error by majority vote, because the same pairwise edge reappears unchanged. This distinction drives both the impossibility results and the algorithm design.
2. Quality criteria and error measures
The standard quality notion in persistent-error sorting is dislocation. If 9 has true rank 0 and appears at position 1 in the output permutation, then its dislocation is
2
The maximum dislocation is
3
and the total dislocation is
4
Equivalent formulations use 5, 6, and
7
These measures are central in the Braverman–Mossel line of work and in subsequent 8- and 9-time algorithms (Geissmann et al., 2017, Geissmann et al., 2018).
The dirty-comparison model uses a different, explicitly local error measure. For each item,
0
Thus 1 counts how many dirty comparisons incident to 2 disagree with the true order. This is an element-wise error measure rather than a global count of bad pairs. If one introduces a global error measure 3, then Jensen’s inequality gives
4
and for dirty comparisons 5 (Bai et al., 2023).
Adversarial formulations replace dislocation by approximation with respect to an ambiguity radius. The definition 6 means 7. A 8-approximate sorting is one in which every inversion involves elements differing by at most 9, and a 0-approximate 1-selection is one where the returned item can appear as the 2-th item of some 3-approximate sorting. The paper proves the equivalence
4
where 5 is the true 6-th smallest element (Trevisan, 2023).
The robust-sorting tournament model measures output quality by common subsequence length. If 7 is the returned ordering and 8 the hidden truth, the target is to maximize 9, and the main guarantee is
0
This metric is tailored to a setting in which only a bounded set of vertices can corrupt pairwise outcomes (Jaiswal et al., 11 Feb 2025).
These definitions reflect a broader shift in objective. Because perfect sorting is impossible in the persistent-error model, the natural goal is not exact recovery but the strongest achievable structural approximation under the available comparator semantics.
3. Approximate sorting algorithms under recurrent random errors
A basic algorithmic milestone is Window Sort, designed for recurrent random comparison errors. It starts with window 1; in each iteration, every element compares only against its 2 left neighbors and 3 right neighbors in the current permutation, computes a local score, reorders by the resulting computed ranks, and then halves the window size until 4. If 5 is currently at position 6, then its computed rank is
7
where 8 is the number of local comparisons where 9 is reported larger than the other element. The algorithm runs in 0 time, since an iteration with window 1 does 2 work and the geometric sum over halving windows is 3 (Geissmann et al., 2017).
The analysis is controlled by local error sets. For an element 4 and window size 5, 6 is the set of errors among comparisons between 7 and every 8. If for all elements 9 and for all window sizes 0,
1
then Window Sort returns a sequence whose maximum dislocation is at most
2
From Chernoff bounds and a union bound, the paper derives that with probability at least 3, Window Sort has maximum dislocation at most
4
where
5
Its expected total dislocation is at most
6
The paper also gives a slower window-shrinking variant 7, with runtime
8
valid for 9 (Geissmann et al., 2017).
A subsequent line of work shows that these dislocation guarantees can be achieved in optimal comparison time. The 2018 paper on optimal sorting under persistent comparison errors presents the first randomized 0-time algorithm with 1 maximum dislocation and 2 total dislocation with high probability. Its structure rests on two subproblems: inserting one element into an almost-sorted sequence while preserving 3-scale dislocation, and simultaneously inserting 4 elements into an almost-sorted sequence of 5 elements so that the resulting 6-element sequence remains almost sorted. The key rank-estimation primitive is a noisy binary search that, if 7 has maximum dislocation at most 8, finds an approximate insertion position 9 satisfying
0
in 1 time with probability at least 2. The full RiffleSort algorithm randomly partitions the input into batches 3, approximately sorts 4 using WindowSort, then alternates merge steps based on approximate ranks and repair steps using WindowSort (Geissmann et al., 2018).
The 2025 paper on persistent random comparison faults rephrases the same high-level architecture in terms of NoisySearch and BasketSort. For constants 5, and in particular for the special case 6, it states that randomized RiffleSort runs in
7
worst-case time and returns a permutation with maximum dislocation 8 and total dislocation 9 with high probability. NoisySearch takes an approximately sorted sequence 00 of size 01 with maximum dislocation at most 02, and returns an index 03 in
04
in 05 time with probability at least 06. BasketSort takes a sequence 07 with an upper bound 08, runs in
09
time, and outputs a sequence with maximum dislocation 10 and total dislocation 11 with high probability (Geissmann et al., 27 Aug 2025).
Taken together, these results establish a progression from quadratic-time multiscale local repair to 12-time approximate sorting with asymptotically optimal dislocation guarantees.
4. Dirty comparators, clean repair, and learning-augmented sorting
The dirty-versus-clean model isolates a distinct persistent-error scenario: a cheap predictor is fixed and potentially wrong, while a second comparator is exact but expensive. Formally, the dirty relation induces exactly one directed edge on each distinct pair, hence a tournament, and it may contain cycles. The per-item disagreement count is
13
The central theorem states that there is a randomized algorithm that sorts within 14 running time, 15 dirty queries, and
16
clean comparisons in expectation. A matching lower bound shows that no sorting algorithm can use
17
clean comparisons (Bai et al., 2023).
The algorithmic idea is randomized incremental BST insertion. Items are processed in uniformly random order. Each new item first follows a dirty search path in the current BST, while maintaining boundary values 18 that delimit where the item could still fit. When the dirty path reaches a nil leaf, the algorithm backtracks to the last valid step 19 such that 20, and then resumes with clean comparisons from that point. The dirty phase is therefore used only as guidance; the clean phase verifies and repairs precisely the part of the path where the dirty comparator became inconsistent with the true order.
The analysis hinges on two facts. First, the random insertion order makes the BST balanced enough in expectation, yielding 21 for the dirty-search length 22. Second, the clean correction is governed by 23. If the active subtree size at step 24 satisfies 25, then
26
From this, the paper derives
27
and therefore the clean search for item 28 uses expected length
29
Summing over the items yields the overall
30
clean-comparison bound (Bai et al., 2023).
A notable feature is smooth degradation. If every 31 is small, then 32 per item and the clean comparison complexity is 33. If the predictor is poor and 34 can be as large as 35, then
36
matching classical comparison sorting. The same paper also treats multiple dirty predictors: if predictor 37 has per-item errors 38, then there is a randomized algorithm using
39
clean comparisons, via a reduction to prediction with expert advice using Hedge (Bai et al., 2023).
This framework differs sharply from recurrent random errors. It does not attempt to average away uncertainty by repeated dirty queries. Instead, it exploits the structure of a fixed flawed predictor and pays exact-comparison cost only where local inconsistency forces repair.
5. Lower bounds and impossibility phenomena
Persistent comparison errors impose strong information-theoretic limits. In the recurrent random model, no randomized algorithm can achieve maximum dislocation 40 with high probability, and no randomized algorithm can achieve expected total dislocation 41, regardless of running time. One proof route uses a pairwise inversion lemma: for any randomized algorithm 42 and any 43, the probability that 44 outputs 45 and 46 in the wrong relative order is at least
47
From this, choosing pairs at distance 48 yields the 49 maximum-dislocation barrier, and considering disjoint adjacent pairs yields the 50 expected total-dislocation barrier (Geissmann et al., 2017).
The optimal-sorting papers sharpen the computational side of the barrier. They state that if one could guarantee 51 maximum dislocation in 52 time under persistent errors, then one would obtain an 53-time exact sorting algorithm even without errors, contradicting the classical lower bound for comparison sorting. Accordingly, 54 time is necessary for 55-scale maximum dislocation, while 56 maximum dislocation and 57 total dislocation are asymptotically optimal targets (Geissmann et al., 2018, Geissmann et al., 27 Aug 2025).
The dirty-comparison setting has an analogous lower bound, but indexed by local prediction error rather than by dislocation. No sorting algorithm can use
58
clean comparisons. The lower-bound argument is information-theoretic: if too few clean comparisons are made, the algorithm cannot distinguish among the many permutations consistent with the dirty comparator and the error budget (Bai et al., 2023).
Adversarial comparison models introduce further impossibility phenomena. In the threshold-59 adversarial comparator model, no algorithm can do better than a factor-60 approximation in general, because adversarial comparisons can make a cluster of nearby values indistinguishable. The same paper cites the Ajtai–Feldman–Hassidim–Nelson lower bound
61
for deterministic 62-approximate sorting and selection, while randomized algorithms achieve polylogarithmic overhead over linear-time baselines (Trevisan, 2023).
Related lower bounds appear in downstream problems. For longest increasing subsequence under persistent comparison errors, the achievable approximation factor is asymptotically limited: there exists a distribution over instances on which no algorithm can guarantee better than an 63 approximation with high probability, and any 64-approximation algorithm requires 65 comparisons even in the absence of errors (Geissmann, 2018).
These lower bounds show that persistent errors do not merely perturb classical sorting. They change the optimization target and define a new frontier where logarithmic maximum displacement, linear total displacement, or logarithmic clean-comparison dependence on local error become the natural optimum.
6. Related formulations, structural insights, and applications
Several adjacent areas refine the structural picture of persistence. In the energy-based noisy comparator model, comparison outcomes are randomized with bias determined by 66 and by a weight 67, through probabilities of the form
68
The sorting process is modeled as a finite Markov chain on permutations, and the paper shows that repeatedly comparing adjacent elements can be better than comparing arbitrary pairs: for three elements, the stationary ratios include
69
The conclusion is about long-run behavior: local adjacent-comparison dynamics can concentrate more stationary mass on the correctly sorted permutation than more global noisy dynamics (Geissmann et al., 2016).
A related Markovian viewpoint appears in swap-based noisy sorting. In 70, a random pair of positions at distance at most 71 is compared, the comparison is wrong with probability 72, and a swap is performed if the noisy comparison declares the pair out of order. For 73, the chain is reversible and the stationary distribution satisfies
74
where 75 is the inversion count. The paper proves that, with high probability for 76,
77
and that the convergence-time proxies 78 and 79 are both 80. For 81, the chain is non-reversible and stationary quality is much worse, with
82
and
83
This yields a clear trade-off between faster convergence for larger 84 and better stationary quality for smaller 85 (Gavenčiak et al., 2018).
Persistent-error sorting also functions as a subroutine in other problems. For LIS under persistent comparison errors, approximate sorting with low maximum dislocation is the key bridge. If an approximate order 86 satisfies 87, then every pair of elements separated by at least 88 positions in 89 appears in the correct relative order in the true sorted order, and the longest 90-distant subsequence 91 satisfies
92
Using an 93-time approximate sorting algorithm with maximum dislocation 94, the paper obtains an 95-approximation to LIS in 96 time with probability at least 97 (Geissmann, 2018).
Robust sorting in a 98-imperfect tournament yields a different application profile. The robust-sorting paper gives a randomized algorithm that queries
99
edges and outputs 00 such that
01
Its quick-sort-like recursion uses triangle detection, sampled balance tests, and a triangle-versus-concatenation-loss bound. The same framework leads to the first 02 FPT linear-time approximation algorithm for Ulam-03-Median, with runtime
04
and approximation factor 05 with probability at least 06 (Jaiswal et al., 11 Feb 2025).
The broader significance of these results is methodological rather than merely technical. Persistent comparison errors force algorithms to work with structure—local neighborhoods, nearly sorted intermediates, error-sensitive repairs, tournament geometry, and concentration in stationary distributions—because repetition alone does not create new information. This suggests that the central organizing principle of the area is not noise reduction by redundancy, but approximation under irrevocable comparator bias.