OblivoneSort
Authors/Creators
Description
# OblivoneSort 2.0.1
发布于 2026-10-31 · Released 2026-10-31
**OblivoneSort** 是一个 C++17、header-only、非稳定分布排序库:元素映射为保序 `uint64_t` key,直接计算桶号,count → prefix → scatter 一次落位,再递归细化。无第三方运行时依赖,串行核心不创建线程。
**OblivoneSort** is a C++17, header-only, unstable distribution sort: values are mapped to order-preserving `uint64_t` keys, bucket indices are computed directly, elements are placed in one count → prefix → scatter pass, then refined recursively. No third-party runtime dependencies; the serial core never spawns threads.
---
## 本版修复 Fixes
- 并行粗桶映射在桶数被 `max_buckets` 截断时按最终桶数重建,修复边界配置下的性能陷阱;
- 并行 min/max 不再把块首 NaN 当作有效边界,单个 NaN 不再禁用值域快速路径;
- 移除 MSVC `/W4` 窄化警告;
- 新增 simple 并行差分 fuzzer(`fuzz_parallel`),测试数由 7 增至 8;
- `cmake --install` 随附 `LICENSE` / `NOTICE` / `AUTHORS`;
- TSan 工作流覆盖 `main` 分支;
- 新增 2.0.1 中英文测试记录。
- The parallel coarse partition is rebuilt with the final bucket count when `max_buckets` clamps it down, fixing a performance trap in boundary configurations;
- Parallel min/max no longer treats a NaN chunk start as a valid value bound;
- MSVC `/W4` narrowing warning removed;
- New differential fuzzer for the simple parallel backend (`fuzz_parallel`); test count goes from 7 to 8;
- `cmake --install` now ships `LICENSE` / `NOTICE` / `AUTHORS`;
- The TSan workflow covers the `main` branch;
- New bilingual 2.0.1 test record.
## 性能定位 Performance positioning
数据依据:2.0.1 测试记录(13 种数据模式 × 1e6 / 1e7 两种规模,对比 `std::sort`、Boost、cpp-TimSort 等主流实现),含原始数据:
`docs/docs_2_0_1/test-record.md` · `docs/docs_2_0_1/test-data/gcc.csv` · `docs/docs_2_0_1/test-data/extreme.csv`
Based on the 2.0.1 test record (13 data patterns at 1e6 and 1e7, compared against `std::sort`, Boost and cpp-TimSort), with raw data under:
`docs/docs_2_0_1_EN/test-record.md` · `docs/docs_2_0_1/test-data/gcc.csv` · `docs/docs_2_0_1/test-data/extreme.csv`
### 串行 Serial
- **有明显优势 / clear advantage**:random、runs;
- **有一定优势 / moderate advantage**:near 5%;
- **无明显优势 / no clear advantage**:reverse;
- **存在劣势 / at a disadvantage**:sorted、equal、few、sawtooth、organ、near 0.1%、near 1%、push front、push back。
### 并行 Parallel
- **有明显优势 / clear advantage**:random、runs;
- **有一定优势 / moderate advantage**:sawtooth、few、near 5%;
- **无明显优势 / no clear advantage**:reverse、near 0.1%、near 1%;
- **存在劣势 / at a disadvantage**:sorted、equal、organ、push front、push back。
在较小规模(1e6)上各档差异整体收窄。At the smaller size (1e6) the differences narrow across the board.
## 验证 Verification
- `ctest` 8/8,GCC 15.2 与 MSVC 19.39 测试矩阵;
- ASan / UBSan 通过(GitHub Actions);
- TSan 通过(Ubuntu GitHub Actions);
- 1e8 大规模、退化配置与特殊数据(NaN / 极值 / 次正规数)全部正确。
- `ctest` 8/8 across the GCC 15.2 and MSVC 19.39 test matrix;
- ASan / UBSan pass (GitHub Actions);
- TSan passes (Ubuntu GitHub Actions);
- 1e8 large-scale, degenerate-configuration and special-data (NaN / extremes / denormals) cases all pass.
## 说明 Notes
- 与 2.0.0 完全兼容:无 API/ABI 变更,默认参数不变;
- 不稳定排序;需要额外 `n` 个元素空间;NaN 排在最后;`-0 == +0`;
- `advanced` 后端不安装、不承诺稳定 API。
- Fully compatible with 2.0.0: no API/ABI changes, default parameters unchanged;
- unstable sort; requires `n` extra elements; NaN sorts last; `-0 == +0`;
- the `advanced` backend is not installed and does not promise a stable API.
## 链接 Links
- 测试记录 / Test record: `docs/docs_2_0_1/test-record.md` · `docs/docs_2_0_1_EN/test-record.md`
- 变更 / Changelog: `CHANGELOG.md`
- 许可证 / License: Apache-2.0 — https://github.com/LSJ-XMJ/OblivoneSort/blob/main/LICENSE
- DOI: https://doi.org/10.5281/zenodo.23675733
- DOI: https://doi.org/10.5281/zenodo.23837745
Files
LSJ-XMJ/OblivoneSort-v2.0.1.zip
Additional details
Related works
- Is supplement to
- https://github.com/LSJ-XMJ/OblivoneSort (URL)
Software
- Repository URL
- https://github.com/LSJ-XMJ/OblivoneSort