Skip to content

LayerKeySort v2.0.0

Choose a tag to compare

@RXY712200 RXY712200 released this 01 Oct 04:03

LayerKeySort v2.0.0

LayerKeySort 2.0.0 is the first stable V2 release. It retains the production implementation published in v2.0.0-rc.1, adds the completed RC observation tests, and activates the documented 2.x source/API and semantic compatibility contract. The public C17 API has 52 functions.

V2 capabilities

  • Hierarchical LksPath ordering coordinates and a mutable Path-keyed Tree, with stable placement after comparator-equal items.
  • lks_path_before(), lks_path_after(), and lks_path_between() for coordinate generation; exact-Path Tree removal and failure-atomic rekey.
  • Canonical Path display formatting and parsing, plus the separate versioned LK1: durable key whose same-version bytewise lexical order matches lks_path_compare().
  • Immutable Group and GroupBatch results, stable merging, and the lks_sort() convenience API.
  • CMake layerkeysort source integration and documented direct C17 source integration.

A Path or LK1 key is an ordering coordinate, not an application item ID. Keep durable business identity separately and account for coordinates changing after Tree mutation.

Validation

The retained RC observation commit adds a compact business-ID/LK1 persistence round trip, deterministic parser torture, multi-seed mutation-soak support, and Path-growth OOM rollback coverage. Before stable publication, 20 soak seeds passed 100,000 operations each and 16 parser seeds passed 100,000 cases each. The exact stable release-state commit passed Windows MSVC, Ubuntu GCC, Ubuntu Clang, Ubuntu Clang with sanitizers, and macOS AppleClang. Each configuration ran CTest 7/7, including the new tests and benchmark correctness smoke tests; both examples ran. An independent clean checkout also passed strict GCC C17 build, CTest 7/7, both examples, and an add_subdirectory consumer.

Compatibility and limits

The 2.x compatibility contract covers public source/API and documented semantics, canonical display grammar, and LK1 v1 bytes. Exact generated Path coordinates, AVL physical shape, and internal heuristics are implementation details.

Full Tree rebuild remains a potentially costly fallback. Complete comparator-driven insertion has no claimed worst-case O(log n) or formal amortized bound; callers must maintain comparator compatibility with existing Path order. This release does not provide whole-Tree serialization, distributed/CRDT convergence, or high-level move-before/move-after helpers. These are documented limits, not claims that they were solved by the stable label.

Release commit: 9fb7a9b0ae8d71cbd7410822e37702f6a6dc4d88.