diff --git a/CHANGELOG.md b/CHANGELOG.md index 1333cbe..1f0955f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ All notable changes to Celerity are documented here. This project follows [Keep ### Fixed - `PartialSort.TopK` now throws `ArgumentException` when its `destination` overlaps its `source`, instead of silently returning a wrong answer and writing to the source it documents as untouched. Disjoint slices of one array are still accepted, matching `RadixSort` and `CountingSort`. +- Corrected `RadixSort.ArgSort` XML documentation: only its `ReadOnlySpan` overload rejects `indices` that shares storage with `keys`. Documentation only. - Eight documentation links pointed at anchors that do not exist: seven `CeleritySet` / `SwissSet` references in `docs/api/collections.md` and one in `CHANGELOG.md`. GitHub deletes `<`, `>` and `,` from a heading without substituting a separator, so `CeleritySet<T, THasher>` anchors as `#celeritysett-thasher`, not the `#celerityset-t-thasher` everyone writes. Closes [#339](https://github.com/marius-bughiu/Celerity/issues/339). ## [2.5.0] - 2026-08-02 diff --git a/src/Celerity.Sorting/RadixSort.cs b/src/Celerity.Sorting/RadixSort.cs index 965cf24..dbec107 100644 --- a/src/Celerity.Sorting/RadixSort.cs +++ b/src/Celerity.Sorting/RadixSort.cs @@ -154,12 +154,23 @@ public static void SortWithScratch(Span keys, Span values, /// /// The keys to rank. Not modified. /// Receives keys.Length indices into , in ascending key order. - /// is shorter than , or shares storage with it. + /// + /// is shorter than . For + /// , it is also thrown when + /// shares storage with . See remarks for + /// cross-type aliases. + /// /// + /// Aliasing is checked only by because its + /// and have the same element type. For the + /// other overloads, making their differently typed spans overlap requires reinterpreting one + /// buffer as another type; that is out-of-contract rather than checked. + /// /// The point of an argsort is to avoid moving a wide payload: rank once, then gather. This form /// rents three buffers, so a hot loop that already owns its scratch should copy the keys itself /// and call with /// an identity index array as the payload — that is exactly what this does. + /// /// public static void ArgSort(ReadOnlySpan keys, Span indices) {