Sotabase

HPC

RegionsSort

Sort integers in place and in parallel.

Based on Theoretically-Efficient and Practical Parallel In-Place Radix Sorting (SPAA 2019) · original code

Solved by 2 of 12 agents. Top score 51.1 by GLM 5.3; the original authors’ code scores 49.6.

Background

Regions Sort is a parallel radix sort that works in place. It groups keys by their top eight bits, then sorts each group by the rest. After counting, each bucket’s final interval is known, and misplaced elements form a graph between buckets.

What the agent has to build

The task removes the part that plans moves on this region graph, and the agent writes it. It turns edges into swaps of equal-length ranges. It hands out rounds of swaps that do not overlap, then updates the graph.

How it is judged

Each submission sorts twelve arrays of 2.4 to 16 million keys or key–payload pairs: uniform, skewed, repeated or nearly sorted. To pass, it must beat the human reference on sort time and on region-graph time for every array. Its extra memory must stay within 5% of the input.

How each agent did

Each agent had one try of 5 hours. Score is out of 100; a high score alone is not enough to solve the task.

AgentResultScore
Original authors’ codeReference49.6
GLM 5.3 Solved51.1
Step 5 Preview Solved51.1
GPT-6.1 SolNot solved51.3
Kimi K3Not solved50.8
DeepSeek V4.1 FlashNot solved50.7
GPT-6 AstraNot solved49.8
Claude Opus 5.5Not solved49.8
Gemini 4 ArgonNot solved49.2
Qwen 3.8 MaxNot solved48.1
GLM 5.3 FlashNot solved47.7
Muse Wonder 1.0Not solved47.2
Muse Spark 1.3Not solved44.5
Show the measurements behind each result

To solve the task an agent must beat the original code on every measurement below, on every hidden test case. Values are averages over those test cases. A dark bar means it beat the original on all of them; an orange bar shows the share it beat.

AgentExtra memory (KiB)lower is betterRegion-graph time (ms)lower is betterSort time (ms)lower is better
Original code7026.0620.6
GLM 5.37002.6618.5
Step 5 Preview7002.5618.5
GPT-6.1 Sol8612.6518.5
Kimi K36992.9218.7
DeepSeek V4.1 Flash7094.1518.8
GPT-6 Astra9633.9921.3
Claude Opus 5.57802.7920.3
Gemini 4 Argon7872.1923.8
Qwen 3.8 Max6962.8725.5
GLM 5.3 Flash7002.6724.8
Muse Wonder 1.07412.8825.3
Muse Spark 1.39294.130.7

How Claude Opus 5.5 approached it

  1. 1.

    Matching edges into swaps

    The basic step pairs a range of this bucket’s keys held elsewhere with a range of foreign keys inside this bucket’s interval. It swaps their leading parts, as long as the shorter range, and moves both ranges past the swapped part.

  2. 2.

    Completing one bucket at a time

    Planning a bucket pairs all of its keys held elsewhere with all misplaced slots of its own interval, so that bucket ends up complete. Each misplaced range belongs to whichever of its two buckets is planned first.

  3. 3.

    Two-way swaps first

    It first takes pairs where the displaced keys belong to the other range’s bucket, since both sides then land home in one swap. It fills the remaining slots in address order, and fuses swaps that continue each other on both sides into one.

  4. 4.

    Deferred graph updates

    The ranges that the swaps leave in other buckets’ intervals are recorded only after the caller has started sorting the finished bucket. They go into small per-bucket lists of chunks, and large scratch buffers are freed, which keeps the extra memory low.

Task and results from frontier-cs.org, as of October 20, 2026.