Search arXiv⌕ Search

arXiv · 2611.24786

SotSort: a stable quicksort with a tunable buffer

Abstract

SotSort is a stable comparison sort whose single code path runs with anything from a fixed 16 KB buffer to a full n-element buffer. Its core is a stable quicksort that partitions blocks through the buffer and gathers them with rotations. This report summarises the design, states which parts are borrowed, and compares an implementation against blitsort, fluxsort, glidesort, driftsort, GrailSort and WikiSort. On one 2-vCPU machine, with 32- and 64-bit integers, the constant-memory mode takes between 0.32 and 0.82 of blitsort's time on 17 of 22 input classes and between 0.92 and 1.07 on the other five. With a comparator that rules out the vector partition it is slower than blitsort on 4 of 11 classes, by up to 2.3 times on sorted input. Against Virtual-Memory Powersort, on its authors' own harness and with the same auxiliary memory, the first measurement lost on most inputs; after three changes it located (one of them adopts that algorithm's paging scheme), SotSort is faster in 43 of 48 type and input combinations at n=10^6 on two machines. At n=10^7 on partially sorted integers it is between 7% faster and 7% slower depending on the machine, and on near-random input it is still slower: by 9% on integers at n=10^7, and by 5 to 17% at n=10^6 when comparisons are expensive. All numbers are preliminary.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Lucas Sotomayor. 2026-11-19. SotSort: a stable quicksort with a tunable buffer. https://searcharxiv.org/abs/2611.24786

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Properties of Concurrent Algorithms that Allow Asynchrony

In this paper, we investigate the conditions under which a concurrent system is able to guarantee convergence deterministically even without synchronization. In general, an algorithm is deemed asynchrony-tolerant iff the global states form a DAG even if the nodes can execute based on outdated/stale values from each other. In this paper, we show that the induction of a partial order (PO) among the local states visited by individual nodes is necessary and sufficient to allow asynchrony. There are certain problems for which the predicate that defines the problem, itself, induces a partial order among the local states (called \textit{PO-inducing problems}). On the other hand, \textit{non-PO-inducing problems} is another class of problems in which a predicate defining the problem cannot induce a partial order among local states. We introduce these classes of problems. We study example PO-inducing and non-PO-inducing problems, and provide example PO-inducing (in other words, asynchrony-tolerant) algorithms (algorithms under which any node traverses a partial order of local states) for all these problems.

cs.DS↗

Improved Rank Aggregation under Fairness Constraint

Aggregating multiple input rankings into a consensus ranking is essential in various fields such as social choice theory, hiring, college admissions, web search, and databases. A major challenge is that the optimal consensus ranking might be biased against individual candidates or groups, especially those from marginalized communities. This concern has led to recent studies focusing on fairness in rank aggregation. The goal is to ensure that candidates from different groups are fairly represented in the top-$k$ positions of the aggregated ranking. We study this fair rank aggregation problem by considering the Kendall tau as the underlying metric. While we know of a polynomial-time approximation scheme (PTAS) for the classical rank aggregation problem, the corresponding fair variant only possesses a quite straightforward 3-approximation algorithm due to Wei et al., SIGMOD'22, and Chakraborty et al., NeurIPS'22, which finds closest fair ranking for each input ranking and then simply outputs the best one. In this paper, we first provide a novel algorithm that achieves $(2+ε)$-approximation (for any $ε> 0$), significantly improving over the 3-approximation bound. Next, we provide a $2.881$-approximation fair rank aggregation algorithm that works irrespective of the fairness notion, given one can find a closest fair ranking, beating the 3-approximation bound. We complement our theoretical guarantee by performing extensive experiments on various real-world datasets to establish the effectiveness of our algorithm further by comparing it with the performance of state-of-the-art algorithms.

cs.DS↗

Learning Multinomial Logits in $O(n \log n)$ time

A Multinomial Logit (MNL) model is composed of a finite universe of items $[n]=\{1,\dots,n\}$, each assigned a positive weight. A query specifies an admissible subset---called a slate---and the model chooses one item from that slate with probability proportional to its weight. This query model is also known as the Plackett--Luce model or conditional sampling oracle in the literature. Although MNLs have been studied extensively, a basic computational question remains open: given query access to slates, how efficiently can we learn weights so that, for every slate, the induced choice distribution is within total variation distance $\varepsilon$ of the ground truth? This question is central to MNL learning and has direct implications for modern recommender system interfaces. We provide both adaptive and non-adaptive algorithms for this task. Our first adaptive algorithm makes $O(\frac{n\log n}{\varepsilon^2})$ queries and learns every choice distribution in total variation distance $\varepsilon$. We also provide a second adaptive algorithm that with $O(\frac{n \log n}{\varepsilon^3})$ queries provides a stronger guarantee: each choice distribution is approximated to a multiplicative $1\pm\varepsilon$ error (except for subsets of mass smaller than $\varepsilon$). We complement these algorithms with lower bounds of $Ω(\frac{n\log n}{\varepsilon^2})$ for total variation distance and $Ω(\frac{n \log n}{\varepsilon^3})$ for the multiplicative error guarantee, showing the optimality of our adaptive algorithms. Our non-adaptive algorithm makes $O\left(\frac{n^{2}}{\varepsilon^{3}}\log n \log\frac{n}{\varepsilon}\right)$ queries to obtain guarantees under the multiplicative error notion. We complement this result with an $Ω(\frac{n^2 \log n}{\varepsilon^2})$ lower bound for any non-adaptive algorithm, showing that our algorithm is almost tight in $n$ (within a $\log n$ factor).

cs.DS↗