From b33e4e0f71bc3bbc24668900a46618b667ecd907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=98=95=E5=AE=87?= <118583582+RXY712200@users.noreply.github.com> Date: Thu, 26 Nov 2026 18:46:48 +0800 Subject: [PATCH 1/3] docs(repo): present Full v4.2.0 workflows and measured tradeoffs --- CONTRIBUTING.md | 18 +-- README.md | 115 ++++++++--------- README.zh-CN.md | 117 ++++++++--------- docs/FULL.md | 158 +++++++++-------------- docs/FULL.zh-CN.md | 184 ++++++++------------------- docs/PRODUCT_LINES.md | 6 +- docs/PRODUCT_LINES.zh-CN.md | 7 +- docs/index.html | 245 ++++++------------------------------ 8 files changed, 276 insertions(+), 574 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12185f3..3942d82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,13 +10,13 @@ ## Products, building and versions -The root build and [development guide](docs/DEVELOPMENT.md) describe **Full**. +The root build and [development guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) describe **Full v4.2.0**. For **Mini**, use [mini/README.md](mini/README.md) and [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md). See the [product-line and release policy](docs/PRODUCT_LINES.md) before changing tags, release packaging or shared workflows. Full and Mini have independent version and API contracts. Review and run checks for both when a change crosses lines. -For Full, consult the [validation guide](docs/VALIDATION.md). +For Full, consult the [validation guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/VALIDATION.md). ## Testing @@ -24,8 +24,8 @@ Add or update relevant regression tests and run them before opening a change. Re ## Public API changes -Public API changes should be deliberate and documented. Describe behavior and compatibility impact in the change. For Full, review the active V4 contract in [docs/V4_FREEZE.md](docs/V4_FREEZE.md) -and [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md). For Mini, review +Public API changes should be deliberate and documented. Describe behavior and compatibility impact in the change. For Full, review the active V4 contract in [docs/V4_FREEZE.md](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_FREEZE.md) +and [docs/COMPATIBILITY.md](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md). For Mini, review [mini/docs/CONTRACT.md](mini/docs/CONTRACT.md). Do not apply one product's compatibility claims to the other. @@ -35,7 +35,7 @@ Include a concise description, the reason for the change, tests performed, and b Release-facing changes also need a complete documentation and presentation review, including examples, diagrams, and GitHub Pages navigation. The -[development guide](docs/DEVELOPMENT.md) describes the Stable-release check. +[development guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) describes the Stable-release check. [Governance baseline](docs/governance/BASELINE.md) · [Ownership](docs/governance/OWNERSHIP.md) · [Rulesets](docs/governance/RULESETS.md) @@ -50,11 +50,11 @@ review, including examples, diagrams, and GitHub Pages navigation. The - 将改动限定在实际所需范围。 - 避免无关格式变动。 -文档版本:以下固定候选提交中的中文指南属于已集成至 main、尚未发布的 Full 4.2.0-rc.1 文档;历史记录译本只解释其原版本,不表示候选实现已发布。已发布 Stable 4.1.0 的权威文档仍见 [Stable API(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)、[Stable 使用说明(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/USAGE.md)及[原始变更日志](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/CHANGELOG.md)。 +文档适用 Full v4.2.0;发布状态和已发布 Stable 入口见 [Full 首页](docs/FULL.zh-CN.md)。历史译本按原记录版本理解。 ### 产品、构建及版本 -根目录构建和[开发指南;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/DEVELOPMENT.zh-CN.md)对应 **Full**。使用 **Mini** 时,请参见 [mini/README.md](mini/README.md)和 [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md)。改变标签、发行打包或共享工作流前,请查阅[产品线和发布策略](docs/PRODUCT_LINES.zh-CN.md)。Full 与 Mini 有独立的版本及 API 契约;跨产品改动须审查并执行两边的检查。Full 的验证见[验证指南;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/VALIDATION.zh-CN.md)。 +根目录构建和[开发指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md)对应 **Full v4.2.0**。使用 **Mini** 时,请参见 [mini/README.md](mini/README.md)和 [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md)。改变标签、发行打包或共享工作流前,请查阅[产品线和发布策略](docs/PRODUCT_LINES.zh-CN.md)。Full 与 Mini 有独立的版本及 API 契约;跨产品改动须审查并执行两边的检查。Full 的验证见[验证指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/VALIDATION.zh-CN.md)。 ### 测试 @@ -62,12 +62,12 @@ review, including examples, diagrams, and GitHub Pages navigation. The ### 公共 API 变更 -公共 API 变更应是有意的决定,并写入文档。说明行为和兼容性影响。Full 请核对 [V4 契约;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_FREEZE.zh-CN.md)及[兼容性说明;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/COMPATIBILITY.zh-CN.md)。Mini 请核对 [Mini 契约](mini/docs/CONTRACT.md)。两条产品线的兼容声明各自适用。 +公共 API 变更应是有意的决定,并写入文档。说明行为和兼容性影响。Full 请核对 [V4 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_FREEZE.zh-CN.md)及[兼容性说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md)。Mini 请核对 [Mini 契约](mini/docs/CONTRACT.md)。两条产品线的兼容声明各自适用。 ### Pull Request 提供简明的改动内容、理由、已执行测试及行为或兼容影响。 -影响发布的改动还须完整检查文档与公开呈现,包括示例、图表和 GitHub Pages 导航。[开发指南;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/DEVELOPMENT.zh-CN.md)描述 Stable 发布检查。 +影响发布的改动还须完整检查文档与公开呈现,包括示例、图表和 GitHub Pages 导航。[开发指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md)描述 Stable 发布检查。 [治理基线](docs/governance/BASELINE.zh-CN.md) · [归属](docs/governance/OWNERSHIP.zh-CN.md) · [规则部署](docs/governance/RULESETS.zh-CN.md) diff --git a/README.md b/README.md index 0b85758..c3ca874 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,85 @@ # LayerKeySort -## Full Stable and the 4.2 candidate +English | [简体中文](README.zh-CN.md) -Main now contains **4.2.0-rc.1**. Published Stable and Latest remain **4.1.0**. For downloadable source and distribution assets, use the [Stable release](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0). RC.1 has been integrated into main, but has not been tagged or published. Mini follows an independent release line. +**High-performance C17 libraries for dynamic ordering, stable sorting, batch ordered processing and historical ordering.** Full combines stable occurrence Handles, bounded local blocks and label/AVL precedence with independently owned snapshots. Choose one API family or combine them. -Full provides stable Handles for live occurrences. The application owns payload, durable identity and transactions. The 4.2 candidate uses bounded labels for cross-block precedence, with AVL fallback. The [pinned evidence](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/FULL_RC1_EVIDENCE.md) compares candidate elapsed time with Stable 4.1 on matched workloads. +## Choose the workflow -| Workload | Windows | Linux | -| --- | ---: | ---: | -| All live-order cells | 0.629 (37.1% lower) | 0.640 (36.0% lower) | -| Compare-heavy cells | 0.198 (80.2% lower) | 0.219 (78.1% lower) | +| Your job | Full API | What it provides | +| --- | --- | --- | +| Edit relative positions in an editor, timeline or playlist | `LksOrder` | Insert, remove, move, logical traversal and precedence; surviving Handles retain identity | +| Maintain priorities or comparator-based collections | `LksManagedOrder` | Stable equal insertion, bound lookup and contextual comparison | +| Sort a pointer array once | `lks_sort` | Stable ordering, copied/scratch preparation, input unchanged on OOM | +| Sort chunks and merge ordered batches | `LksGroup`, `LksGroupBatch` | Immutable copied pointer arrays, stable equality precedence and fresh merge results | +| Save historical order and associations | `LksSnapshot` | Independent bytes, sortable LS1 keys, LKS4SNP1 encoding and fresh-handle restoration | -Each ratio divides candidate by control elapsed time, and the table reports the median of those ratios across matched conditions on each host. Initial populations were 1k, 10k and 100k occurrences. A flat-history composition was faster for endpoint-only lifecycle workloads. For relative edits with history and restore, compare using the target workload. See the [candidate verification record](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_2_0_RC1.md) and [candidate implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/IMPLEMENTATION_WALKTHROUGH.md). The [historical V4 architecture design](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/design/V4_ARCHITECTURE.md) remains available as design history. Local links below describe the integrated RC.1 on main; the published Stable remains v4.1.0. +Applications own payloads and business identities. Full supplies ordering components; a database can use them alongside its own transactions, storage and recovery. One-shot sorting is supported, with pointer-copy and scratch costs. The live-order comparisons below do not benchmark `qsort` or `std::sort`. +## Measured value -English | [简体中文](README.zh-CN.md) +In the archived Windows/Linux matched live-order study, Full v4.2.0's unchanged operational implementation used **37.1% / 36.0% less elapsed time than 4.1 overall**, and **80.2% / 78.1% less in compare-heavy cells**. It won 45/45 cells per host against both Stable controls. Results depend on the tested workload and control. -**A family of independent C17 libraries for maintaining the order of changing collections.** +![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) -LayerKeySort maintains *live sequence order* as applications insert, remove, and move occurrences. It is not a replacement for one-shot array sorting. The application owns its items and business identities; each product defines its own order-management contract. +Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md). -## How Full works — start with the source guides +![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) -**New to the Full implementation?** These four **Chinese-language, source-grounded guides** are the main entry point for understanding how Full works internally. They describe the integrated **Full 4.2.0-rc.1** source revision, covering the 16 production C modules and their actual execution paths. They do **not** describe Mini, and they do not replace the public header or frozen compatibility contract. +The scatter fixes 100,000 initial occurrences and seed 17. Main elapsed axis is logarithmic; linear panels show near-coincident points at their measured coordinates. Memory is separately measured diagnostic **peak requested bytes**, shown in MiB, rather than process RAM. In this compare-heavy example Full requested 4,278,776 bytes versus native OM 13,437,504 bytes, about 68% lower. The graph retains all eight variants. -1. **[Implementation walkthrough · 从源码理解完整实现](docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)** — **Start here.** Understand why Full maintains live occurrence order rather than merely sorting an array; trace the Block/AVL/Handle structure, insert–move–remove workflows, ManagedOrder, Snapshot, LS1, serialization and restore, and the distinctions between current and legacy code. -2. **[Public API index and key contracts · 64 个公开 API](docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)** — Find all **64 frozen Full public functions**, grouped by purpose and mapped to implementation files. Check required parameters, error outcomes, borrowed ownership, Handle/Cursor lifetimes, callback restrictions, concurrency boundaries, and practical traversal examples before integrating. -3. **[Internal algorithms and data structures · 内部算法详解](docs/IMPLEMENTATION_INTERNALS.zh-CN.md)** — Follow the principal helpers across all **16 production C modules**: bounded blocks, implicit AVL maintenance, splitting/merging and redistribution, insertion and move commit paths, bulk reconstruction, allocation diagnostics, stable merges, and V3 LK1 compatibility. -4. **[Validation and source-evidence map · 测试与验证指南](docs/IMPLEMENTATION_VALIDATION.zh-CN.md)** — Locate concrete test functions and assertions for important guarantees; learn the CMake, API/wire fixture, distribution and CI checks, plus how to reproduce them and distinguish examined source from executed tests. +Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. -**Suggested route:** read **1 → 2 → 3 → 4** when studying or maintaining Full; for application integration, start with **2** alongside the [Full usage and integration guides](docs/FULL.md). All four are implementation explanations tied to a fixed source SHA, not a claim of exhaustive formal verification. +All time/memory figures: [Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) -## Choose a product +## Build and first use -| | **[Full](docs/FULL.md)** | **[Mini](mini/README.md)** | -| --- | --- | --- | -| Latest published Stable | **[v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0)** | **[v1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0)** | -| Current `main` source | **4.2.0-rc.1** (integrated, untagged/unpublished; [historical 4.1.0 update](docs/V4_1_0.md)) | **1.0.0** (unchanged) | -| Best fit | More complete ordering and historical workflows | Lightweight local, mutable sequences | -| Live ordering | Relative operations, stable resident handles, comparator-managed option | Relative operations and stable occurrence handles | -| Arbitrary live-order comparison | Available under the Full contract | O(n) worst case | -| Snapshots and persistence | Immutable snapshots, LS1 keys, explicit wire format and restore | Not provided | -| Group and Batch utilities | Provided | Not provided | -| Core implementation | Bounded blocks and balanced index | Independent non-intrusive doubly linked list | -| Public API | 64 functions (Full v4) | 18 functions (Mini v1) | -| Build from this repository | Root `CMakeLists.txt` | `mini/CMakeLists.txt` | +```sh +cmake -S . -B build -DLKS_BUILD_BENCHMARKS=ON +cmake --build build --config Debug --parallel +ctest --test-dir build -C Debug --output-on-failure +``` -**Full and Mini are independent products, not parent-and-child dependencies.** Their version numbers, public APIs, compatibility promises and release cycles are separate. Neither library links to the other's production source. +Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.md) cover managed order, Groups and snapshot restore. -These are **capability distinctions, not benchmarks or claims that one product is universally faster**. Choose Mini when its narrower contract is enough; choose Full when its additional ordering, snapshot or batch capabilities are required. +CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.md). -## Start with the product you need +## Full version evolution -| Product | Overview and usage | API / contract | Download | -| --- | --- | --- | --- | -| Full | [Full README](docs/FULL.md) · [Integration](docs/INTEGRATION.md) · [Examples](examples/README.md) | [API](docs/API.md) · [V4 frozen contract](docs/V4_FREEZE.md) | [Published v4.1.0 Stable](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) · [4.1.0 changes](docs/V4_1_0.md) | -| Mini | [Mini README](mini/README.md) · [Usage](mini/docs/USAGE.md) · [Example](mini/examples/basic.c) | [Mini v1 public contract](mini/docs/CONTRACT.md) | [Mini v1.0.0 release](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | - -For Mini, use the release's **Mini-only source ZIP**; GitHub's automatic Source code archive downloads the **whole repository**. Full publishes a separate two-file amalgamation asset. Follow the chosen product's instructions; the root CMake build remains Full by default. +| Edition | Main engineering change | Compatibility and evidence | +| --- | --- | --- | +| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.md) | +| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.md) | +| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.md) | -## Repository layout +**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. -- `include/`, `src/`, root `CMakeLists.txt`, `tests/`, `benchmarks/` and most of `docs/`: **Full**. -- `mini/`: independent **Mini** implementation, documentation, tests and build. -- `consumers/layer-order-workbench/`: **Mini consumer application and validation**, not Mini production code or a third ordering library. -- `.github/`, selected `tools/` and [product-line policy](docs/PRODUCT_LINES.md): repository-level integration and product-specific maintenance tooling. +## Full and Mini are independent -A possible Embedded/MCU edition is **only a future concept**. No Embedded product, API or release is currently offered. +| | Full | [Mini](mini/README.md) | +| --- | --- | --- | +| Capabilities | Relative and comparator order, stable sort, Group/Batch, snapshots and restore | Lightweight relative edits and stable occurrence Handles | +| Representation | Bounded blocks, labels and balanced index | Independent non-intrusive doubly linked list | +| Arbitrary precedence | Label path with logarithmic AVL fallback | O(n) worst case | +| Public API | 64 functions | 18 functions | +| Build | Root `CMakeLists.txt` | `mini/CMakeLists.txt` | +| Published release | [Full 4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | [Mini 1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | -## Versions, compatibility and maintenance +Neither product links the other's production code. These are capability distinctions, not Mini performance rankings. Workbench is a Mini consumer/validation application under `consumers/layer-order-workbench/`. Embedded/MCU remains a future concept. -- Full's published tags use `v*` (current published Stable: `v4.1.0`). -- Mini's published tags use `mini-v*` (current Stable `mini-v1.0.0`). -- GitHub's repository-wide **Latest** designation is not a per-product version selector. Use each product's explicit release link. -- Old Full releases and V1–V4 research remain available as history; they are not Mini contracts. -- License: [MIT](LICENSE). Each product keeps its own documentation and validation requirements. +## Contracts and practical costs -Read [product-line and release policy](docs/PRODUCT_LINES.md) ([简体中文](docs/PRODUCT_LINES.zh-CN.md)) and [contribution guidelines](CONTRIBUTING.md) before cross-product changes. +Handles represent live occurrences and expire on own removal/source destruction; they are not durable application IDs. Keep comparator semantics and all affected sorted borrowers consistent when editing shared payloads. Reinsertion can fail and remove/edit/reinsert is not transactional. Caller synchronization is required for conflicting access; callback guards and marker atomics are not container locks. -## Roadmaps and evidence +Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. -- **Full:** [Full engineering roadmap and completed three-step optimization cycle, Issue #3](https://github.com/RXY712200/LayerKeySort/issues/3); [historical problem ledger, Issue #4](https://github.com/RXY712200/LayerKeySort/issues/4). -- **Mini and its consumers:** [Mini roadmap, Issue #7](https://github.com/RXY712200/LayerKeySort/issues/7). -- **Full examples and validation:** [Full README](docs/FULL.md) · [Full validation](docs/VALIDATION.md). -- **Mini examples and validation:** [Mini README](mini/README.md) · [Mini development](mini/docs/DEVELOPMENT.md). +## Documentation and maintenance -## External project directory +1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. +2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. +3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. +4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. -- [Quiveld — author's independent projects directory](https://quiveld.com/projects/independent/). +[Architecture](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) -Do not infer real-world adoption, universal platform support, or performance superiority from a feature table. Evaluate your application's actual ordering and resource requirements. +[Full roadmap #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini roadmap #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [Product-line policy](docs/PRODUCT_LINES.md) · [Contributing](CONTRIBUTING.md) · [MIT license](LICENSE) · [Author’s independent project directory](https://quiveld.com/projects/independent/) diff --git a/README.zh-CN.md b/README.zh-CN.md index 506518c..851d1fa 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,94 +1,85 @@ # LayerKeySort -文档版本:以下固定候选提交中的中文指南属于已集成至 main、尚未发布的 Full 4.2.0-rc.1 文档;历史记录译本只解释其原版本,不表示候选实现已发布。已发布 Stable 4.1.0 的权威文档仍见 [Stable API(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)、[Stable 使用说明(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/USAGE.md)及[原始变更日志](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/CHANGELOG.md)。 - -## Full:Stable 与候选版 - -主分支现已集成 **4.2.0-rc.1**;已发布 Stable 和 Latest 仍为 **4.1.0**。需要可下载的源码或发行包时,请使用 [Stable 发行页](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0)。RC.1 已合入 main,尚未打标签或发布。Mini 使用独立的版本和发布路径。 +[English](README.md) | 简体中文 -Full 用稳定 Handle 表示实时顺序中的单次存活实例;应用持有业务对象、身份和事务。4.2 候选版在跨块比较中优先使用有界标签,必要时回退到 AVL。以下是 [固定候选证据;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/FULL_RC1_EVIDENCE.zh-CN.md) 中相对 Stable 4.1 的配对耗时比与耗时降幅: +**面向动态顺序、稳定排序、批量有序处理和历史顺序的高性能 C17 库。** Full 将稳定实例 Handle、有界局部块、标签/AVL 先后查询与独立快照结合起来。各类接口可以独立使用,也可以组合。 -| 负载 | Windows | Linux | -| --- | ---: | ---: | -| 全部实时顺序条件 | 0.629(降低 37.1%) | 0.640(降低 36.0%) | -| 比较密集条件 | 0.198(降低 80.2%) | 0.219(降低 78.1%) | +## 按任务选择工作流 -比值为候选耗时除以对照耗时。先分别计算同一平台每个匹配条件的耗时比,再取这些比值的中位数。初始规模为 1k、10k 和 100k 个实例。端点编辑和平面历史的生命周期对照中,平面组合更快。需要相对编辑与历史恢复时,先按目标负载比较。参见 [候选验证;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_2_0_RC1.zh-CN.md) 与 [候选实现导读;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)。另见[历史 V4 架构设计的完整中文译本;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/design/V4_ARCHITECTURE.zh-CN.md)。下文仓库内链接随 main 说明已集成 RC.1;已发布 Stable 仍为 v4.1.0,固定链接保留其版本标签。 +| 任务 | Full API | 提供的能力 | +| --- | --- | --- | +| 编辑器、时间线、播放列表中的相对编辑 | `LksOrder` | 插入、删除、移动、逻辑遍历及先后查询;存活 Handle 保持身份 | +| 持续维护优先级或比较器集合 | `LksManagedOrder` | 稳定等值插入、边界查询与容器内先后比较 | +| 一次性指针数组排序 | `lks_sort` | 稳定排序、复制及临时数组准备、OOM 时输入不变 | +| 排序分片及有序批次归并 | `LksGroup`、`LksGroupBatch` | 不可变指针数组副本、稳定等值优先及独立归并结果 | +| 保存历史顺序和关联数据 | `LksSnapshot` | 独立字节、可排序 LS1、LKS4SNP1 编码及新句柄恢复 | +应用拥有对象和业务身份。Full 提供顺序组件;数据库可将其与自身事务、存储、恢复组合。支持一次性排序,但有指针复制和临时存储成本。下方实时顺序比较并未测试 `qsort` 或 `std::sort`。 -[English](README.md) | 简体中文 +## 实测价值 -**面向持续变化的集合顺序,提供多个彼此独立的 C17 动态顺序维护库。** +在 Windows/Linux 配对实时顺序归档研究中,Full v4.2.0 沿用的运行实现相对 4.1 **总体耗时降低 37.1%/36.0%**,**比较密集条件降低 80.2%/78.1%**。相对两个 Stable 对照,每平台均胜出 45/45 个条件。结论适用于受测负载和具体对照。 -LayerKeySort 解决的是集合长期使用时不断插入、删除、移动实例的顺序管理问题,而不是 `qsort` 一类的一次性排序。业务对象及业务身份由应用自己管理;每个产品拥有独立的顺序管理契约。 +![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) -## Full 核心实现:建议从这四份源码文档开始 +先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 -**想知道 LayerKeySort Full 究竟是怎样实现的,而不只是照着 API 调用?** 这四份中文文档是理解 Full 内部机制的主要入口。它们以已集成的 **Full 4.2.0-rc.1 固定源码提交**为依据,覆盖全部 **16 个生产 C 模块**及其主要执行路径;**不适用于 Mini**,也不替代公开头文件和冻结的兼容性契约。 +![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) -1. **[① 完整实现导读:从源码理解 Full](docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)** — **建议先读。** 从整体架构和数据模型入手,解释 Block、AVL、稳定 Handle 如何维护动态顺序,并沿实际调用链梳理插入、移动、删除、ManagedOrder、Snapshot、LS1、序列化、恢复以及新旧代码的分工。 -2. **[② 公开 API 索引与关键使用契约](docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)** — 列出 **64 个公开函数**及对应源码,集中说明必填参数、错误返回、对象所有权、Handle/Cursor 生命周期、回调限制、并发边界与遍历示例。适合实际调用前查阅。 -3. **[③ 内部数据结构与算法实现详解](docs/IMPLEMENTATION_INTERNALS.zh-CN.md)** — 深入 **16 个生产 C 模块**的主要内部函数:分块与 AVL 维护、块拆分和修复、移动的不同分支、预分配与提交、批量恢复、稳定归并、内存诊断,以及 V3 LK1 兼容过程。适合想研究或修改算法的人。 -4. **[④ 测试、验证与可复现审计指南](docs/IMPLEMENTATION_VALIDATION.zh-CN.md)** — 将关键行为对应到具体测试函数与断言,说明 CMake 构建、API 和 Wire 固定样本、CI、分发验证及如何复现;同时明确区分“读过测试”和“实际执行测试”。 +散点固定初始 100,000 个实例和种子 17。主耗时轴为对数,线性面板按实测坐标放大近邻点。内存是独立诊断的**峰值请求字节**(以 MiB 展示),不是进程 RAM。此比较密集条件 Full 为 4,278,776 字节,原生 OM 为 13,437,504 字节,约低 68%。图保留全部八种实现。 -**阅读顺序:** 想完整研究 Full,推荐按 **① → ② → ③ → ④** 阅读;如果主要想在自己的 C/C++ 程序里使用 Full,可以先看 **②**,结合 [Full 产品与集成指南](docs/FULL.zh-CN.md)实践。文档基于明确的源码 SHA,不宣称形式化证明了所有代码或所有环境下的正确性。 +Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 -## 选择适合你的产品 +全部时间/内存图:[Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) -| | **[Full](docs/FULL.zh-CN.md)** | **[Mini](mini/README.zh-CN.md)** | -| --- | --- | --- | -| 最新**已发布** Stable | **[v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0)** | **[v1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0)** | -| 当前 `main` 源码 | **4.2.0-rc.1**(已集成,未打标签/发布;[已发布更新;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_1_0.zh-CN.md)) | **1.0.0**(未改动) | -| 主要定位 | 更完整的顺序管理及历史工作流 | 轻量本地可变序列 | -| 实时顺序管理 | 相对插入/移动、稳定实例句柄、可选比较器管理 | 相对插入/移动、稳定 occurrence 句柄 | -| 任意两实例实时顺序比较 | 按 Full 契约支持 | 最坏 O(n) | -| 历史快照与持久化 | 不可变快照、LS1、独立 Wire 格式与恢复 | 不提供 | -| Group / Batch 工具 | 提供 | 不提供 | -| 核心实现 | 有界分块与平衡索引 | 独立的非侵入式双向链表 | -| 公开 API | 64 函数(Full v4) | 18 函数(Mini v1) | -| 本仓库构建入口 | 根目录 `CMakeLists.txt` | `mini/CMakeLists.txt` | +## 构建与首次运行 -**Full 与 Mini 是同一个项目家族的独立产品,不存在父子依赖关系。** 二者版本号、公开 API、兼容性要求及发布周期分别管理,互不链接对方的生产源码。 +```sh +cmake -S . -B build -DLKS_BUILD_BENCHMARKS=ON +cmake --build build --config Debug --parallel +ctest --test-dir build -C Debug --output-on-failure +``` -表格比较的是**能力,不是性能排名**,也不表示任何产品在所有场景下更快。只需 Mini 的轻量功能时选择 Mini;需要更完整的排序管理、快照或批量工具时选择 Full。 +运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 -## 从对应产品开始 +CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.zh-CN.md)。 -| 产品 | 入门和使用 | API / 契约 | 正式下载 | -| --- | --- | --- | --- | -| Full | [Full 专属 README](docs/FULL.zh-CN.md) · [中文集成](docs/INTEGRATION.zh-CN.md) · [示例;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/examples/README.zh-CN.md) | [API;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/API.zh-CN.md) · [V4 冻结契约;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_FREEZE.zh-CN.md) | [已发布 v4.1.0 Stable](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) · [4.1.0 更新;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_1_0.zh-CN.md) | -| Mini | [Mini 专属 README](mini/README.zh-CN.md) · [使用指南](mini/docs/USAGE.md) · [示例](mini/examples/basic.c) | [Mini v1 公开契约](mini/docs/CONTRACT.md) | [Mini v1.0.0 Release](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | +## Full 版本演进 -下载 Mini 时请使用 Release 中的 **Mini-only 源码 ZIP**;GitHub 自动生成的 Source code 压缩包包含**整个仓库**。Full 则另有两文件 amalgamation 分发包。具体集成方法以各自产品文档为准;根目录 CMake 仍默认构建 Full。 +| 版本 | 主要工程变化 | 兼容性与证据 | +| --- | --- | --- | +| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.zh-CN.md) | +| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.zh-CN.md) | +| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.zh-CN.md) | -## 仓库目录说明 +**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 -- `include/`、`src/`、根 `CMakeLists.txt`、`tests/`、`benchmarks/` 和大部分 `docs/`:**Full**。 -- `mini/`:独立的 **Mini** 实现、文档、测试和构建系统。 -- `consumers/layer-order-workbench/`:**Mini 消费者工程及验证程序**,不是 Mini 生产源码,也不是第三套排序库。 -- `.github/`、部分 `tools/` 和[产品线政策](docs/PRODUCT_LINES.zh-CN.md):仓库治理和产品专属维护工具。 +## Full 与 Mini 相互独立 -未来可能研究 Embedded/MCU 版本,但**目前只是构想**,没有已发布的 Embedded 产品、API 或交付承诺。 +| | Full | [Mini](mini/README.zh-CN.md) | +| --- | --- | --- | +| 能力 | 相对/比较器顺序、稳定排序、Group/Batch、快照及恢复 | 轻量相对编辑及稳定实例 Handle | +| 表示 | 有界块、标签及平衡索引 | 独立非侵入式双向链表 | +| 任意先后查询 | 标签路径与最坏对数 AVL 回退 | 最坏 O(n) | +| 公开 API | 64 函数 | 18 函数 | +| 构建 | 根 `CMakeLists.txt` | `mini/CMakeLists.txt` | +| 已发布版本 | [Full 4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | [Mini 1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | -## 版本、兼容性与维护 +两者均不链接对方生产代码。这是能力区别,不是 Mini 性能排名。Workbench 是 `consumers/layer-order-workbench/` 下的 Mini 消费者/验证应用。Embedded/MCU 仍为未来构想。 -- Full 的已发布标签使用 `v*`(当前已发布 Stable 为 `v4.1.0`)。 -- Mini 的已发布标签使用 `mini-v*`(当前 Stable:`mini-v1.0.0`)。 -- GitHub 仓库级 **Latest** 不等于各产品各自的最新版本;请使用上表的独立发布页面。 -- Full 早期版本和 V1–V4 研究属于保留的历史资料,不代表 Mini 的契约。 -- 许可证:[MIT](LICENSE)。各产品独立维护自己的文档及验收标准。 +## 契约及实际成本 -跨产品修改前请阅读[产品线与发布管理规范](docs/PRODUCT_LINES.zh-CN.md)([English](docs/PRODUCT_LINES.md))及[贡献指南](CONTRIBUTING.md)。 +Handle 表示存活实例,删除自身或销毁来源即失效,不是持久业务 ID。修改共享载荷时,须保持比较语义及全部相关有序借用结构一致。重新插入可能失败,删除/修改/重插不是事务。冲突访问需外部同步;回调守卫与来源标记原子操作不是容器锁。 -## 路线图与验证资料 +局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 -- **Full:** [Full 工程路线与三大步骤完成记录 Issue #3](https://github.com/RXY712200/LayerKeySort/issues/3);[历史问题台账 Issue #4](https://github.com/RXY712200/LayerKeySort/issues/4)。 -- **Mini 与其消费者:** [Mini 路线图 Issue #7](https://github.com/RXY712200/LayerKeySort/issues/7)。 -- **Full 示例与验证:** [Full README](docs/FULL.zh-CN.md) · [验证;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/VALIDATION.zh-CN.md)。 -- **Mini 示例与验证:** [Mini README](mini/README.zh-CN.md) · [开发与验证](mini/docs/DEVELOPMENT.md)。 +## 文档与维护 -## 外部项目目录 +1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 +2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 +3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 +4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 -- [Quiveld — 作者的独立项目目录](https://quiveld.com/projects/independent/)。 +[架构](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) -不要从功能表推断实际采用比例、所有平台均受支持或某一产品拥有普遍性能优势。请结合实际操作负载和资源限制选型。 +[Full 路线 #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini 路线 #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [产品线规则](docs/PRODUCT_LINES.zh-CN.md) · [贡献说明](CONTRIBUTING.md) · [MIT 许可](LICENSE) · [作者独立项目目录](https://quiveld.com/projects/independent/) diff --git a/docs/FULL.md b/docs/FULL.md index bc96639..dd07c39 100644 --- a/docs/FULL.md +++ b/docs/FULL.md @@ -1,75 +1,48 @@ -# LayerKeySort Full — v4.1.0 Stable +# LayerKeySort Full — v4.2.0 Stable -## Full Stable and the 4.2 candidate +English | [简体中文](FULL.zh-CN.md) -Main now contains **4.2.0-rc.1**. Published Stable and Latest remain **4.1.0**. For downloadable source and distribution assets, use the [Stable release](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0). RC.1 has been integrated into main, but has not been tagged or published. Mini follows an independent release line. +**High-performance C17 libraries for dynamic ordering, stable sorting, batch ordered processing and historical ordering.** Full combines stable occurrence Handles, bounded local blocks and label/AVL precedence with independently owned snapshots. Choose one API family or combine them. -Full provides stable Handles for live occurrences. The application owns payload, durable identity and transactions. The 4.2 candidate uses bounded labels for cross-block precedence, with AVL fallback. The [pinned evidence](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/FULL_RC1_EVIDENCE.md) compares candidate elapsed time with Stable 4.1 on matched workloads. +## Choose the workflow -| Workload | Windows | Linux | -| --- | ---: | ---: | -| All live-order cells | 0.629 (37.1% lower) | 0.640 (36.0% lower) | -| Compare-heavy cells | 0.198 (80.2% lower) | 0.219 (78.1% lower) | +| Your job | Full API | What it provides | +| --- | --- | --- | +| Edit relative positions in an editor, timeline or playlist | `LksOrder` | Insert, remove, move, logical traversal and precedence; surviving Handles retain identity | +| Maintain priorities or comparator-based collections | `LksManagedOrder` | Stable equal insertion, bound lookup and contextual comparison | +| Sort a pointer array once | `lks_sort` | Stable ordering, copied/scratch preparation, input unchanged on OOM | +| Sort chunks and merge ordered batches | `LksGroup`, `LksGroupBatch` | Immutable copied pointer arrays, stable equality precedence and fresh merge results | +| Save historical order and associations | `LksSnapshot` | Independent bytes, sortable LS1 keys, LKS4SNP1 encoding and fresh-handle restoration | -Each ratio divides candidate by control elapsed time, and the table reports the median of those ratios across matched conditions on each host. Initial populations were 1k, 10k and 100k occurrences. A flat-history composition was faster for endpoint-only lifecycle workloads. For relative edits with history and restore, compare using the target workload. See the [candidate verification record](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_2_0_RC1.md) and [candidate implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/IMPLEMENTATION_WALKTHROUGH.md). The [historical V4 architecture design](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/design/V4_ARCHITECTURE.md) remains available as design history. Local links below describe the integrated RC.1 on main; the published Stable remains v4.1.0. +Applications own payloads and business identities. Full supplies ordering components; a database can use them alongside its own transactions, storage and recovery. One-shot sorting is supported, with pointer-copy and scratch costs. The live-order comparisons below do not benchmark `qsort` or `std::sort`. -![Matched live-order elapsed ratios by host](https://raw.githubusercontent.com/RXY712200/LayerKeySort/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) +## Measured value +In the archived Windows/Linux matched live-order study, Full v4.2.0's unchanged operational implementation used **37.1% / 36.0% less elapsed time than 4.1 overall**, and **80.2% / 78.1% less in compare-heavy cells**. It won 45/45 cells per host against both Stable controls. Results depend on the tested workload and control. -[← LayerKeySort product family](../README.md) | English | [简体中文](FULL.zh-CN.md) +![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) -This page documents **Full**, the original library at the repository root. It is not the Mini API. For authoritative compatibility and format contracts, consult [V4_FREEZE](V4_FREEZE.md), not this onboarding page. +Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md). -Dynamic ordering for changing collections in C17, with stable live handles and -sortable immutable snapshot keys. +![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) -**Live order: contextual handles. Historical/persistent order: immutable snapshot keys.** +The scatter fixes 100,000 initial occurrences and seed 17. Main elapsed axis is logarithmic; linear panels show near-coincident points at their measured coordinates. Memory is separately measured diagnostic **peak requested bytes**, shown in MiB, rather than process RAM. In this compare-heavy example Full requested 4,278,776 bytes versus native OM 13,437,504 bytes, about 68% lower. The graph retains all eight variants. -**[LayerKeySort Full v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) is the current published Stable Release.** -The Release provides the verified amalgamation ZIP and SHA-256 manifest from the annotated source tag. -[4.1.0 update details](V4_1_0.md) document smaller Resident/Snapshot storage and workload-specific regressions. -[V4_FREEZE](V4_FREEZE.md) freezes the V4.0 API, LS1 and LKS4SNP1 contracts. -V4 completes the fixed Preview.1–5 / RC.1 development cycle. -[Historical v4.0.0 Stable record](V4_STABLE.md), [RC validation record](V4_RC1.md). -V3.1.0 remains a historical Stable release for applications requiring Path/Tree contracts; -V4 is a major source break, not a drop-in upgrade. +Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. -The active post-v4 roadmap and current technical debt are tracked in -[Issue #3](https://github.com/RXY712200/LayerKeySort/issues/3). Historical Issue #2 -is closed and preserved as the V2/V3/V4-development record. +## Complete time/memory comparison -## What problem does LayerKeySort solve? +![Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) -LayerKeySort is **not a replacement for one-shot array sorting** such as `qsort` -or `std::sort`. It is for collections that stay alive and keep changing order: +![Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) -- layer stacks and editor object lists, -- video/audio timelines, -- CAD/game/node/workflow editors, -- playlists and local document editors, -- other long-lived collections with repeated insert/remove/move operations. +![Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) -The core question is not “sort these N items once”, but “keep this collection in -order while it is edited for minutes or hours, then capture or persist a historical -ordering when needed”. +![Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) -LayerKeySort is usually the wrong tool if all you need is a one-shot sort, a simple -database `position` column, distributed/CRDT ordering, or persistent business identity. -Applications own identity and storage; LayerKeySort owns ordering semantics. +Each plot uses the same initial size, seed, units and linear-detail rules. Open the SVG for full-size inspection; exact coordinates, accounting and raw hashes are in the evidence linked above. -## Choose a workflow - -- LksOrder: editable relative order, stable resident handles, before/after moves. -- LksManagedOrder: comparator-managed order, stable equal insertion. -- LksGroup/LksGroupBatch: flat immutable sequences and stable merge. -- LksSnapshot: copied historical associations, LS1 and explicit wire persistence; - restoration gives fresh live handles. - -Items/business identity remain application-owned. Handle is not persistent; -snapshot key is not live position. V3 Path/Tree APIs are absent from the V4 header; -see [migration](MIGRATION_V3_V4.md). - -## First successful run +## Build and first use ```sh cmake -S . -B build -DLKS_BUILD_BENCHMARKS=ON @@ -77,55 +50,46 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -Run build/layerkeysort_example (MSVC: build/Debug/layerkeysort_example.exe). -[Minimal example](../examples/basic.c): create, insert, query, remove and destroy. -[Seven examples](../examples/README.md) use only public headers. - -```c -#include -int main(void) { - int item = 42; - const LksOrderHandle *handle = NULL; - LksOrder *order = lks_order_create(); - if (!order) return 1; - if (lks_order_insert_back(order, &item, &handle) != LKS_STATUS_OK) { - lks_order_destroy(order); return 2; - } - lks_order_destroy(order); /* item remains application-owned */ - return 0; -} -``` +Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.md) cover managed order, Groups and snapshot restore. + +CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.md). + +## Full version evolution + +| Edition | Main engineering change | Compatibility and evidence | +| --- | --- | --- | +| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.md) | +| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.md) | +| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.md) | + +**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. + +## Full and Mini are independent + +| | Full | [Mini](../mini/README.md) | +| --- | --- | --- | +| Capabilities | Relative and comparator order, stable sort, Group/Batch, snapshots and restore | Lightweight relative edits and stable occurrence Handles | +| Representation | Bounded blocks, labels and balanced index | Independent non-intrusive doubly linked list | +| Arbitrary precedence | Label path with logarithmic AVL fallback | O(n) worst case | +| Public API | 64 functions | 18 functions | +| Build | Root `CMakeLists.txt` | `mini/CMakeLists.txt` | +| Published release | [Full 4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | [Mini 1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | -## Integrate +Neither product links the other's production code. These are capability distinctions, not Mini performance rankings. Workbench is a Mini consumer/validation application under `consumers/layer-order-workbench/`. Embedded/MCU remains a future concept. -CMake >=3.21: add_subdirectory, offline FetchContent or installed -find_package(LayerKeySort CONFIG REQUIRED), target LayerKeySort::layerkeysort. -No Python/private headers for ordinary consumers. Deterministic two-file C17 -source ZIP plus SHA256SUMS; C++17 clients link the C library. -[Integration guide](INTEGRATION.md). +## Contracts and practical costs -## Limits and evidence +Handles represent live occurrences and expire on own removal/source destruction; they are not durable application IDs. Keep comparator semantics and all affected sorted borrowers consistent when editing shared payloads. Reinsertion can fail and remove/edit/reinsert is not transactional. Caller synchronization is required for conflicting access; callback guards and marker atomics are not container locks. -V4 avoids resident Path growth/global relabel. Structural work O(B+log M), -private B64; allocator/comparator/callback/OS costs remain. No whole-library hard -latency or universal speed guarantee. Full snapshot export O(N+A); frequent -exports/retained history can dominate time/memory. Mutable sources require caller -serialization; items/contexts stay alive, ordering semantics stay consistent. -Dangling handles cannot safely be tested after removal. +Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. -The [4.1.0 update record](V4_1_0.md) links newer 100k–10m internal studies, -including improved requested storage and documented performance regressions. -Earlier [Preview.4 evidence](../benchmarks/results/v4-preview4/README.md) and -[v4.0.0 Stable evidence](V4_STABLE.md) remain historical. New internal -research should answer concrete engineering questions; external adoption or -editor traces are useful but not mandatory prerequisites. +## Documentation and maintenance -## Documentation +1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. +2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. +3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. +4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. -- [Usage](USAGE.md), [API](API.md), [Examples](../examples/README.md) -- [Compatibility](COMPATIBILITY.md), [Migration](MIGRATION_V3_V4.md) -- [Validation](VALIDATION.md), [Development](DEVELOPMENT.md) -- [Architecture](ARCHITECTURE.md), [Changelog](../CHANGELOG.md) +[Architecture](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) -Earlier Preview guides and captured V3 benchmarks are historical, not the current -primary API. License: [MIT](../LICENSE). +[Full roadmap #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini roadmap #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [Product-line policy](PRODUCT_LINES.md) · [Contributing](../CONTRIBUTING.md) · [MIT license](../LICENSE) · [Author’s independent project directory](https://quiveld.com/projects/independent/) diff --git a/docs/FULL.zh-CN.md b/docs/FULL.zh-CN.md index 6801903..61663d9 100644 --- a/docs/FULL.zh-CN.md +++ b/docs/FULL.zh-CN.md @@ -1,82 +1,48 @@ -# LayerKeySort Full — v4.1.0 Stable +# LayerKeySort Full — v4.2.0 Stable -文档版本:以下固定候选提交中的中文指南属于已集成至 main、尚未发布的 Full 4.2.0-rc.1 文档;历史记录译本只解释其原版本,不表示候选实现已发布。已发布 Stable 4.1.0 的权威文档仍见 [Stable API(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)、[Stable 使用说明(英文)](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/USAGE.md)及[原始变更日志](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/CHANGELOG.md)。 +[English](FULL.md) | 简体中文 -## Full:Stable 与候选版 +**面向动态顺序、稳定排序、批量有序处理和历史顺序的高性能 C17 库。** Full 将稳定实例 Handle、有界局部块、标签/AVL 先后查询与独立快照结合起来。各类接口可以独立使用,也可以组合。 -主分支现已集成 **4.2.0-rc.1**;已发布 Stable 和 Latest 仍为 **4.1.0**。需要可下载的源码或发行包时,请使用 [Stable 发行页](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0)。RC.1 已合入 main,尚未打标签或发布。Mini 使用独立的版本和发布路径。 +## 按任务选择工作流 -Full 用稳定 Handle 表示实时顺序中的单次存活实例;应用持有业务对象、身份和事务。4.2 候选版在跨块比较中优先使用有界标签,必要时回退到 AVL。以下是 [固定候选证据;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/FULL_RC1_EVIDENCE.zh-CN.md) 中相对 Stable 4.1 的配对耗时比与耗时降幅: +| 任务 | Full API | 提供的能力 | +| --- | --- | --- | +| 编辑器、时间线、播放列表中的相对编辑 | `LksOrder` | 插入、删除、移动、逻辑遍历及先后查询;存活 Handle 保持身份 | +| 持续维护优先级或比较器集合 | `LksManagedOrder` | 稳定等值插入、边界查询与容器内先后比较 | +| 一次性指针数组排序 | `lks_sort` | 稳定排序、复制及临时数组准备、OOM 时输入不变 | +| 排序分片及有序批次归并 | `LksGroup`、`LksGroupBatch` | 不可变指针数组副本、稳定等值优先及独立归并结果 | +| 保存历史顺序和关联数据 | `LksSnapshot` | 独立字节、可排序 LS1、LKS4SNP1 编码及新句柄恢复 | -| 负载 | Windows | Linux | -| --- | ---: | ---: | -| 全部实时顺序条件 | 0.629(降低 37.1%) | 0.640(降低 36.0%) | -| 比较密集条件 | 0.198(降低 80.2%) | 0.219(降低 78.1%) | +应用拥有对象和业务身份。Full 提供顺序组件;数据库可将其与自身事务、存储、恢复组合。支持一次性排序,但有指针复制和临时存储成本。下方实时顺序比较并未测试 `qsort` 或 `std::sort`。 -比值为候选耗时除以对照耗时。先分别计算同一平台每个匹配条件的耗时比,再取这些比值的中位数。初始规模为 1k、10k 和 100k 个实例。端点编辑和平面历史的生命周期对照中,平面组合更快。需要相对编辑与历史恢复时,先按目标负载比较。参见 [候选验证;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_2_0_RC1.zh-CN.md) 与 [候选实现导读;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)。另见[历史 V4 架构设计的完整中文译本;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/design/V4_ARCHITECTURE.zh-CN.md)。下文仓库内链接随 main 说明已集成 RC.1;已发布 Stable 仍为 v4.1.0,固定链接保留其版本标签。 +## 实测价值 -![两平台的配对耗时比](https://raw.githubusercontent.com/RXY712200/LayerKeySort/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) +在 Windows/Linux 配对实时顺序归档研究中,Full v4.2.0 沿用的运行实现相对 4.1 **总体耗时降低 37.1%/36.0%**,**比较密集条件降低 80.2%/78.1%**。相对两个 Stable 对照,每平台均胜出 45/45 个条件。结论适用于受测负载和具体对照。 +![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) -[← LayerKeySort 产品家族首页](../README.zh-CN.md) | [English](FULL.md) | 简体中文 +先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 -本页专门介绍仓库根目录的 **Full** 产品,而不是 Mini。公共 API、持久化格式与兼容性契约以 [V4_FREEZE;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_FREEZE.zh-CN.md) 等权威文档为准。 +![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) -LayerKeySort 是一个 **C17 动态顺序管理库**。它解决的不是“把一组元素一次排好”, -而是“一个集合长期存在,并且持续发生插入、删除、移动、遍历、保存历史顺序和恢复”。 +散点固定初始 100,000 个实例和种子 17。主耗时轴为对数,线性面板按实测坐标放大近邻点。内存是独立诊断的**峰值请求字节**(以 MiB 展示),不是进程 RAM。此比较密集条件 Full 为 4,278,776 字节,原生 OM 为 13,437,504 字节,约低 68%。图保留全部八种实现。 -**实时顺序使用稳定的容器内句柄;历史/持久化顺序使用不可变快照和 LS1 键。** +Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 -**[LayerKeySort Full v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) 是当前已发布的 Stable 版本。** -该 Release 提供与注解源码标签对应、经过校验的 amalgamation ZIP 和 SHA-256 清单。 -[4.1.0 更新记录;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_1_0.zh-CN.md)说明了内存优化与已测出的部分性能回退。 -V4 的 Preview.1–5 → RC.1 → v4.0.0 Stable 历史开发周期仍然保留。 -V3.1.0 仍作为历史 Stable 保留给依赖 Path/Tree 契约的应用;V4 是源码级大版本变化, -不是可以直接替换头文件的兼容升级。 +## 全部时间/内存比较 -当前 post-v4 roadmap 与技术债统一记录在 -[Issue #3](https://github.com/RXY712200/LayerKeySort/issues/3)。 -历史 Issue #2 已关闭但完整保留。 +![Windows 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) -## 它适合什么? +![Windows 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) -LayerKeySort 最适合长期维护复杂本地 mutable collection 的软件,例如: +![Linux 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) -- 图层编辑器; -- 视频 / 音频时间线; -- CAD、游戏编辑器; -- 节点 / 工作流编辑器; -- 播放列表编辑器; -- 本地文档编辑系统; -- 大型 UI / 树结构中的某一层扁平顺序。 +![Linux 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) -典型操作不是“排序一次”,而是: +每图采用同一初始规模、种子、单位及线性细节规则。点击查看原 SVG;完整坐标、统计口径和原始哈希见上方证据。 -```text -把 A 插到 B 前面 -把 C 移到 D 后面 -删除 E -加入 F -读取第一个 / 下一个 -捕获当前历史顺序 -保存后恢复并继续编辑 -``` - -如果你只需要一次性排序、简单 SQL `position` 字段、CRDT/分布式协同顺序, -或者跨进程长期业务 ID,LayerKeySort 通常不是最合适的工具。 - -## 四个主要入口 - -- `LksOrder`:显式相对顺序,支持前/后插入、移动、遍历和稳定 resident handle。 -- `LksManagedOrder`:由比较器维护顺序,保证相等元素的稳定插入语义。 -- `LksGroup` / `LksGroupBatch`:不可变平面序列、稳定构建和合并。 -- `LksSnapshot`:历史快照、LS1、LKS4SNP1、序列化和恢复。 - -业务对象与业务 ID 始终由应用拥有。 - -**Handle 不是持久化 ID。LS1 也不是 live position。** - -## 最小示例 +## 构建与首次运行 ```sh cmake -S . -B build -DLKS_BUILD_BENCHMARKS=ON @@ -84,86 +50,46 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -构建后运行 `build/layerkeysort_example`。使用 MSVC 时运行 `build/Debug/layerkeysort_example.exe`。 [最小示例源码](../examples/basic.c) - -```c -#include - -int main(void) { - int item = 42; - const LksOrderHandle *handle = NULL; - LksOrder *order = lks_order_create(); - if (!order) return 1; - - if (lks_order_insert_back(order, &item, &handle) != LKS_STATUS_OK) { - lks_order_destroy(order); - return 2; - } - - lks_order_destroy(order); /* item 仍由应用拥有 */ - return 0; -} -``` - -完整公开示例见 [examples/README.md](../examples/README.md)。 - -## 集成 - -支持 CMake `add_subdirectory`、离线 FetchContent、本地安装 + -`find_package(LayerKeySort CONFIG REQUIRED)`。CMake 最低版本为 3.21,链接目标为 `LayerKeySort::layerkeysort`。普通使用者无需 Python 或私有头文件。发布提供可重复生成的两文件 C17 源码 ZIP 和 SHA256SUMS,C++17 应用可链接 C 库。 - -见: +运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 -- [中文集成指南](INTEGRATION.zh-CN.md) -- [英文完整集成指南](INTEGRATION.md) -- [API 参考;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/API.zh-CN.md) -- [使用指南](USAGE.zh-CN.md) -- [V3 → V4 迁移;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/MIGRATION_V3_V4.zh-CN.md) +CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.zh-CN.md)。 -## 已知成本与边界 +## Full 版本演进 -V4 不再为 live resident 维护 Path/LK1,因此避免了 V3 的全范围 live-coordinate relabel -和 live Path 增长;但它仍然有真实成本: +| 版本 | 主要工程变化 | 兼容性与证据 | +| --- | --- | --- | +| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.zh-CN.md) | +| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.zh-CN.md) | +| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.zh-CN.md) | -- 每 resident allocation; -- block slack 和局部指针移动; -- comparator / callback / allocator / OS 成本; -- 完整 snapshot/export 是显式 `O(N+A)`; -- 保留大量历史 snapshot 会占用相应历史内存。 +**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 -调用者须串行访问可变来源,维持应用对象和比较器上下文的生命周期及排序语义。移除后不得用悬空句柄查询其有效性。不承诺所有操作的统一硬延迟上界, -也不承诺 universal binary ABI、CRDT、持久化 live handle 或数据库职责。 +## Full 与 Mini 相互独立 -较新的 [4.1.0 更新记录;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_1_0.zh-CN.md)包含 10 万至千万级研究、 -内存收益和真实的性能回退;不保证所有负载都更快。早期的 -[Preview.4 evidence](../benchmarks/results/v4-preview4/README.md) 和 -[v4.0.0 Stable 历史记录;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_STABLE.zh-CN.md)仍然完整保留。 +| | Full | [Mini](../mini/README.zh-CN.md) | +| --- | --- | --- | +| 能力 | 相对/比较器顺序、稳定排序、Group/Batch、快照及恢复 | 轻量相对编辑及稳定实例 Handle | +| 表示 | 有界块、标签及平衡索引 | 独立非侵入式双向链表 | +| 任意先后查询 | 标签路径与最坏对数 AVL 回退 | 最坏 O(n) | +| 公开 API | 64 函数 | 18 函数 | +| 构建 | 根 `CMakeLists.txt` | `mini/CMakeLists.txt` | +| 已发布版本 | [Full 4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | [Mini 1.0.0](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | -## 长期方向 +两者均不链接对方生产代码。这是能力区别,不是 Mini 性能排名。Workbench 是 `consumers/layer-order-workbench/` 下的 Mini 消费者/验证应用。Embedded/MCU 仍为未来构想。 -LayerKeySort 的长期定位是 **dynamic ordering library**,而不是传统 sorting library。 -核心边界保持在: +## 契约及实际成本 -1. Mutable Order Engine; -2. Immutable Historical Representation; -3. Immutable Batch Utilities。 +Handle 表示存活实例,删除自身或销毁来源即失效,不是持久业务 ID。修改共享载荷时,须保持比较语义及全部相关有序借用结构一致。重新插入可能失败,删除/修改/重插不是事务。冲突访问需外部同步;回调守卫与来源标记原子操作不是容器锁。 -不为了版本号仓促启动 V5,也不设立必须尽快推广的时间表。 -未来以明确的正确性、性能、内存或兼容性问题驱动内部工程研究; -真实编辑器数据有价值,但不是继续开发的前提。 +局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 -Mini 已在独立的 `mini/` 目录发布 v1.0.0 Stable,但不属于 Full V4 的 API 契约;Embedded 等其他产品线仍只是未来设想,不代表已经实现。 -详见 [Issue #3](https://github.com/RXY712200/LayerKeySort/issues/3)。 +## 文档与维护 -## 文档 +1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 +2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 +3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 +4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 -- [架构;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/ARCHITECTURE.zh-CN.md) -- [API;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/API.zh-CN.md) -- [兼容性;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/COMPATIBILITY.zh-CN.md) -- [验证;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/VALIDATION.zh-CN.md) -- [开发维护;已集成但未发布 RC.1 文档](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/DEVELOPMENT.zh-CN.md) -- [4.1.0 更新记录;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_1_0.zh-CN.md) -- [v4.0.0 Stable 历史记录;历史记录中文译本](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/V4_STABLE.zh-CN.md) -- [中文变更日志(候选快照,含明确标记的历史发布记录)](https://github.com/RXY712200/LayerKeySort/blob/16bdde588b1bbf996bf5b6392a5fb91fb45d3576/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](../CHANGELOG.md) +[架构](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) -License: [MIT](../LICENSE)。 +[Full 路线 #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini 路线 #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [产品线规则](PRODUCT_LINES.zh-CN.md) · [贡献说明](../CONTRIBUTING.md) · [MIT 许可](../LICENSE) · [作者独立项目目录](https://quiveld.com/projects/independent/) diff --git a/docs/PRODUCT_LINES.md b/docs/PRODUCT_LINES.md index 00cf15d..5038e84 100644 --- a/docs/PRODUCT_LINES.md +++ b/docs/PRODUCT_LINES.md @@ -6,15 +6,17 @@ LayerKeySort is **one repository with independently versioned products**, not on product with interchangeable build modes. This policy describes repository-wide naming and delivery; each product's own README and API contract remain authoritative. +The prepared Full edition is v4.2.0; its implementation and evidence are described in the [Full entry](FULL.md). Published Stable/Latest remains v4.1.0 until separate publication. Mini and Workbench are unchanged. + ## Products and locations -| Product | Sources, build and docs | Public identity | Status (2026-10-25) | +| Product | Sources, build and docs | Public identity | Edition / published status | | --- | --- | --- | --- | | Full | Repository root: `include/`, `src/`, root `CMakeLists.txt`, `docs/` | `LayerKeySort`, `layerkeysort` | Current published Stable [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | | Mini | Self-contained `mini/` subtree | `LayerKeySort Mini`, `layerkeysort_mini` | [v1.0.0 Stable](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | Full and Mini are **alternative implementations for different requirements**, -not a dependency hierarchy. Full offers larger ordering and snapshot workflows. +not a dependency hierarchy. Full offers dynamic order, stable sorting, batch processing and historical workflows. Mini deliberately uses a separate, lightweight doubly linked list, has its own 18-function contract and does not import Full production code. A consumer can copy and build `mini/` without the repository root. Neither package's numeric diff --git a/docs/PRODUCT_LINES.zh-CN.md b/docs/PRODUCT_LINES.zh-CN.md index 6e08125..66b692a 100644 --- a/docs/PRODUCT_LINES.zh-CN.md +++ b/docs/PRODUCT_LINES.zh-CN.md @@ -5,15 +5,16 @@ LayerKeySort 采用**单仓库、多独立产品、独立版本号**。这不是将同一套源码用开关裁剪成 “完整版”和“精简版”。各产品的公开 API、兼容性和生命周期,以各自文档为准。 +准备中的 Full 版本为 v4.2.0,实现及证据见 [Full 入口](FULL.zh-CN.md)。另行发布前,已发布 Stable/Latest 仍为 v4.1.0;Mini 与 Workbench 不变。 + ## 产品划分 -| 产品 | 所在目录与构建入口 | 名称 | 当前状态(2026-10-25) | +| 产品 | 所在目录与构建入口 | 名称 | 版本/发布状态 | | --- | --- | --- | --- | | Full | 仓库根目录:`include/`、`src/`、根 `CMakeLists.txt`、`docs/` | `LayerKeySort` / `layerkeysort` | 当前已发布 Stable:[v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0) | | Mini | 自包含的 `mini/` 子目录 | `LayerKeySort Mini` / `layerkeysort_mini` | [v1.0.0 Stable](https://github.com/RXY712200/LayerKeySort/releases/tag/mini-v1.0.0) | -Full 与 Mini 是针对不同需求的**并行产品**,不是父子依赖关系。Full 面向更完整的 -顺序管理和快照工作流;Mini 使用独立的简单双向链表实现,冻结 18 个公开函数,不依赖 +Full 与 Mini 是针对不同需求的**并行产品**,不是父子依赖关系。Full 面向动态顺序、稳定排序、批处理及历史工作流;Mini 使用独立的简单双向链表实现,冻结 18 个公开函数,不依赖 Full 的生产源码。只复制 `mini/` 就能单独构建,两个产品的数字版本之间没有兼容关系。 不为了目录对称而将已有 Full 从仓库根目录迁移到 `full/`。默认根构建面向 Full; diff --git a/docs/index.html b/docs/index.html index 9f46a31..777809a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,211 +1,36 @@ - - - - - - LayerKeySort Full — keep changing collections in order - - - - - -
-
-
-

LayerKeySort Full · C17 library · v4.1.0 Stable

Main contains integrated 4.2.0-rc.1, untagged and unpublished. Published Stable and Latest remain v4.1.0.

-

Keep changing collections in order.

-

LayerKeySort keeps changing collections in explicit or comparator-managed order. Live occurrences have stable contextual handles; immutable snapshots provide sortable historical keys. Your application owns item identity.

- -
-
-

A small change in position

-
BeforeBackgroundPlayerHUD
-
AfterBackgroundPlayerEffectsHUD
-

Live moves preserve resident handles. Capture an immutable snapshot when historical or persistent order is needed; snapshot keys are not live positions or permanent item IDs.

-
-
- -
-
-

Start here

-

Choose your next step

-
- -
- -
-
-

Getting the code

-

One library, several ways to use it

-

For a small C project, download the two-file amalgamation from the Full v4.1.0 Release. Copy layerkeysort.h and layerkeysort.c into your project and compile the implementation as C17.

-

Already using CMake? Choose FetchContent, add_subdirectory, or a local install with find_package. The integration guide has complete commands; 中文集成指南 covers the same first-use paths.

-

LayerKeySort Full v4.1.0 is the current published Stable Release, with compatible memory optimizations, a verified amalgamation ZIP and SHA-256 manifest. Performance remains workload-dependent. V3.1.0 remains available for legacy Path/Tree contracts.

-
- -
- -
-
-

See the model

-

Watch positions change

-

The historical V3 visualizer replays Path snapshots recorded from the production C implementation. It helps explain manual and comparator-managed Trees; the browser does not execute the C library.

-
- Open visualizer -
- -
-

Before you adopt it

-

Measure the workload that matters to you

-

V4 avoids live Path growth and collection-wide coordinate relabel. Local block/index work, allocation and comparator costs remain; full snapshot export and retained history can dominate time and memory. The strongest fit is a long-lived editor-like collection with repeated insert/remove/move operations, not one-shot sorting or distributed/CRDT ordering. Read the benchmark evidence, test your own workload, and follow the post-v4 roadmap.

-
-
- -
-
-

LayerKeySort Full · C17 库 · v4.1.0 Stable

固定候选提交中的中文 API 与使用指南描述已集成至 main、尚未发布的 4.2.0-rc.1;历史译文仍按原版本理解。已发布 4.1.0 的权威说明见 Stable API(英文)。

-

让不断变化的集合保持顺序

-

LayerKeySort 以显式或比较器托管方式维护变化中的集合。实时实例有稳定的上下文 Handle;不可变快照提供可排序的历史键。对象身份由应用管理。

- -
-
-

一次局部位置变化

-
之前背景角色界面
-
之后背景角色效果界面
-

实时移动保留居民 Handle。需要历史或持久顺序时捕获不可变快照;快照键独立于实时位置和永久对象身份。

-
-
- -
-
-

从这里开始

-

选择下一步

-
- -
- -
-
-

获取源码

-

多种集成方式

-

小型 C 项目可从 Full v4.1.0 发行页下载双文件合并包。复制 layerkeysort.h 与 layerkeysort.c 到项目,并按 C17 编译实现。

-

使用 CMake 时可选择 FetchContent, add_subdirectory,或通过 find_package使用本地安装。中文集成指南给出完整命令。

-

LayerKeySort Full v4.1.0是当前已发布 Stable,含兼容的内存优化、经过验证的合并包及 SHA-256 清单。性能取决于负载;旧 Path/Tree 契约继续由 V3.1.0 提供。

-
- -
- -
-
-

观察模型

-

观察位置变化

-

历史 V3 可视化回放从生产 C 实现采集的 Path 快照,帮助理解手动和比较器托管 Tree。浏览器仅回放记录。

-
- 打开可视化 -
- -
-

采用之前

-

测量自己的目标负载

-

V4 避免实时 Path 增长和全集坐标重标。仍有局部块及索引维护、分配和比较器成本;完整导出及历史保留可能主导耗时与内存。较适合反复执行插入、删除及移动的长期编辑型集合。一次性排序或分布式/CRDT 顺序有其他需求。参见 候选快照中的中文基准证据(含历史记录),运行自己的负载,并关注 V4 之后的路线。

-
-
-

LayerKeySort Full · MIT 许可的 C17 库

- -
-
-
- - - + + +LayerKeySort Full v4.2.0 — ordering, sorting and history +
+

LayerKeySort Full · C17 · v4.2.0

Dynamic order, stable sorting and independent history.

High-performance C17 ordering components. Choose explicit editing, comparator-maintained order, one-shot stable sorting, immutable batches or historical snapshots; use the families independently.

+

Build and integrate · Usage · Full documentation

+

Target edition: Full v4.2.0 Stable. Main remains 4.2.0-rc.1 until authorized integration; published Stable/Latest remains v4.1.0. The 4.2.0 tag and assets have not been published. Published downloads

+
LksOrderRelative insert/move/remove and precedence
LksManagedOrderStable comparator order and bound lookup
lks_sortStable one-shot pointer-array sorting
LksGroup / LksGroupBatchImmutable sorted chunks and stable merge
LksSnapshotIndependent associations, LS1, wire and restoration
+

Version evolution

+
Full editionEngineering change
4.0Stable Handles, bounded blocks/AVL, snapshots and batches
4.1Shared block owner and compact Snapshot metadata
4.2Affected-slot updates, bounded labels/AVL fallback and fixed-width wire
+

Measured time and memory

+

Against 4.1: 37.1% lower Windows / 36.0% lower Linux elapsed overall; 80.2% / 78.1% lower compare-heavy elapsed. Each host has 45 cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation.

+
Median paired Full/control elapsed ratios; lower is faster
Median paired Full/control elapsed ratios; lower is faster
+
Windows compare-heavy elapsed versus requested peak memory, including linear details
Windows compare-heavy elapsed versus requested peak memory, including linear details
+

Scatter: 100,000 initial occurrences, seed 17; formal median ms on a logarithmic main axis, separately measured diagnostic peak requested memory in MiB, not process RAM. Linear details preserve measured coordinates. Native OM can win update-heavy cells; endpoint flat history is faster; bulk Treap restore is unmeasured. All figures and evidence

+

Applications own payloads, identity, transactions and synchronization; Handles are not durable IDs. Snapshot/export is O(N+A); history retention and restore consume memory. Full provides no database, transaction manager or CRDT.

+

Selection · 64 APIs and contracts · Examples

+

Mini independently provides an 18-function lightweight linked-sequence component; Workbench is its consumer and validation application. Neither depends on Full. Mini

+

Historical visualizers: V3 · V1. They depict older versions and do not execute Full v4.2.0.

+

LayerKeySort Full · C17 · v4.2.0

动态顺序、稳定排序与独立历史。

高性能 C17 顺序组件。按任务选择显式编辑、比较器维护、一次性稳定排序、不可变批处理或历史快照;各家族可独立使用。

+

构建与集成 · 使用指南 · Full 文档

+

目标文档为 Full v4.2.0 Stable。授权集成前 main 仍为 4.2.0-rc.1;已发布 Stable/Latest 仍为 v4.1.0。4.2.0 标签及资产尚未发布。 已发布下载

+
LksOrder相对插入、移动、删除与先后查询
LksManagedOrder稳定比较器顺序与边界查询
lks_sort一次性稳定指针数组排序
LksGroup / LksGroupBatch不可变排序分片与稳定归并
LksSnapshot独立关联、LS1、线格式与恢复
+

版本演进

+
Full 版本工程变化
4.0稳定 Handle、有界块/AVL、快照及批处理
4.1共享块 owner、紧凑快照元数据
4.2受影响槽位更新、有界标签/AVL 回退、固定宽度线格式
+

实测时间与内存

+

相对 4.1 总体耗时降低 Windows 37.1%/Linux 36.0%;比较密集降低 80.2%/78.1%。每平台 45 条件、初始 1k/10k/100k、每轨迹 20k 操作、每条件/实现七个正式样本。

+
配对耗时比中位数;越小越快
配对耗时比中位数;越小越快
+
Windows 比较密集:耗时与峰值请求内存,含线性放大图
Windows 比较密集:耗时与峰值请求内存,含线性放大图
+

散点固定初始 100,000 项、种子 17。耗时中位数以 ms 展示,主图对数轴;独立诊断峰值请求内存以 MiB 展示,不是进程 RAM。线性放大保留实测坐标。原生 OM 可在更新密集条件胜出;端点平面历史更快;Treap 批量恢复尚未测量。 全部图表与证据

+

应用拥有载荷、身份、事务与同步;Handle 不是持久 ID。快照/导出 O(N+A),历史保留及恢复需要内存。Full 不提供数据库、事务管理器或 CRDT。

+

选型 · 64 API 与契约 · 示例

+

Mini 独立提供 18 函数的轻量双向链表顺序组件,Workbench 为其消费者与验证应用;两者均不依赖 Full。 Mini

+

历史可视化:V3 · V1. 它们展示旧版本,不执行 Full v4.2.0。

+
From 4a1671164e2cd5c34f060aa04b0ddb01c7773f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=98=95=E5=AE=87?= <118583582+RXY712200@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:10:14 +0800 Subject: [PATCH 2/3] docs: pin repaired Full guides and improve mobile figure access --- CONTRIBUTING.md | 16 ++++++++-------- README.md | 32 ++++++++++++++++---------------- README.zh-CN.md | 32 ++++++++++++++++---------------- docs/FULL.md | 40 +++++++++++++++++++++------------------- docs/FULL.zh-CN.md | 40 +++++++++++++++++++++------------------- docs/index.html | 32 +++++++++++++++++++------------- 6 files changed, 101 insertions(+), 91 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3942d82..52622a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,13 +10,13 @@ ## Products, building and versions -The root build and [development guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) describe **Full v4.2.0**. +The root build and [development guide](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.md) describe **Full v4.2.0**. For **Mini**, use [mini/README.md](mini/README.md) and [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md). See the [product-line and release policy](docs/PRODUCT_LINES.md) before changing tags, release packaging or shared workflows. Full and Mini have independent version and API contracts. Review and run checks for both when a change crosses lines. -For Full, consult the [validation guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/VALIDATION.md). +For Full, consult the [validation guide](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/VALIDATION.md). ## Testing @@ -24,8 +24,8 @@ Add or update relevant regression tests and run them before opening a change. Re ## Public API changes -Public API changes should be deliberate and documented. Describe behavior and compatibility impact in the change. For Full, review the active V4 contract in [docs/V4_FREEZE.md](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_FREEZE.md) -and [docs/COMPATIBILITY.md](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md). For Mini, review +Public API changes should be deliberate and documented. Describe behavior and compatibility impact in the change. For Full, review the active V4 contract in [docs/V4_FREEZE.md](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_FREEZE.md) +and [docs/COMPATIBILITY.md](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.md). For Mini, review [mini/docs/CONTRACT.md](mini/docs/CONTRACT.md). Do not apply one product's compatibility claims to the other. @@ -35,7 +35,7 @@ Include a concise description, the reason for the change, tests performed, and b Release-facing changes also need a complete documentation and presentation review, including examples, diagrams, and GitHub Pages navigation. The -[development guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) describes the Stable-release check. +[development guide](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.md) describes the Stable-release check. [Governance baseline](docs/governance/BASELINE.md) · [Ownership](docs/governance/OWNERSHIP.md) · [Rulesets](docs/governance/RULESETS.md) @@ -54,7 +54,7 @@ review, including examples, diagrams, and GitHub Pages navigation. The ### 产品、构建及版本 -根目录构建和[开发指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md)对应 **Full v4.2.0**。使用 **Mini** 时,请参见 [mini/README.md](mini/README.md)和 [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md)。改变标签、发行打包或共享工作流前,请查阅[产品线和发布策略](docs/PRODUCT_LINES.zh-CN.md)。Full 与 Mini 有独立的版本及 API 契约;跨产品改动须审查并执行两边的检查。Full 的验证见[验证指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/VALIDATION.zh-CN.md)。 +根目录构建和[开发指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.zh-CN.md)对应 **Full v4.2.0**。使用 **Mini** 时,请参见 [mini/README.md](mini/README.md)和 [mini/docs/DEVELOPMENT.md](mini/docs/DEVELOPMENT.md)。改变标签、发行打包或共享工作流前,请查阅[产品线和发布策略](docs/PRODUCT_LINES.zh-CN.md)。Full 与 Mini 有独立的版本及 API 契约;跨产品改动须审查并执行两边的检查。Full 的验证见[验证指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/VALIDATION.zh-CN.md)。 ### 测试 @@ -62,12 +62,12 @@ review, including examples, diagrams, and GitHub Pages navigation. The ### 公共 API 变更 -公共 API 变更应是有意的决定,并写入文档。说明行为和兼容性影响。Full 请核对 [V4 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_FREEZE.zh-CN.md)及[兼容性说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md)。Mini 请核对 [Mini 契约](mini/docs/CONTRACT.md)。两条产品线的兼容声明各自适用。 +公共 API 变更应是有意的决定,并写入文档。说明行为和兼容性影响。Full 请核对 [V4 契约](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_FREEZE.zh-CN.md)及[兼容性说明](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.zh-CN.md)。Mini 请核对 [Mini 契约](mini/docs/CONTRACT.md)。两条产品线的兼容声明各自适用。 ### Pull Request 提供简明的改动内容、理由、已执行测试及行为或兼容影响。 -影响发布的改动还须完整检查文档与公开呈现,包括示例、图表和 GitHub Pages 导航。[开发指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md)描述 Stable 发布检查。 +影响发布的改动还须完整检查文档与公开呈现,包括示例、图表和 GitHub Pages 导航。[开发指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.zh-CN.md)描述 Stable 发布检查。 [治理基线](docs/governance/BASELINE.zh-CN.md) · [归属](docs/governance/OWNERSHIP.zh-CN.md) · [规则部署](docs/governance/RULESETS.zh-CN.md) diff --git a/README.md b/README.md index c3ca874..dd9d66d 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,17 @@ Applications own payloads and business identities. Full supplies ordering compon In the archived Windows/Linux matched live-order study, Full v4.2.0's unchanged operational implementation used **37.1% / 36.0% less elapsed time than 4.1 overall**, and **80.2% / 78.1% less in compare-heavy cells**. It won 45/45 cells per host against both Stable controls. Results depend on the tested workload and control. -![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) +![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) -Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md). +Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.md). -![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) +![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) The scatter fixes 100,000 initial occurrences and seed 17. Main elapsed axis is logarithmic; linear panels show near-coincident points at their measured coordinates. Memory is separately measured diagnostic **peak requested bytes**, shown in MiB, rather than process RAM. In this compare-heavy example Full requested 4,278,776 bytes versus native OM 13,437,504 bytes, about 68% lower. The graph retains all eight variants. -Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. +Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. -All time/memory figures: [Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) +All time/memory figures: [Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) ## Build and first use @@ -40,17 +40,17 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.md) cover managed order, Groups and snapshot restore. +Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/README.md) cover managed order, Groups and snapshot restore. -CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.md). +CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/INTEGRATION.md). ## Full version evolution | Edition | Main engineering change | Compatibility and evidence | | --- | --- | --- | -| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.md) | -| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.md) | -| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.md) | +| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_STABLE.md) | +| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.md) | +| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.md) | **Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. @@ -71,15 +71,15 @@ Neither product links the other's production code. These are capability distinct Handles represent live occurrences and expire on own removal/source destruction; they are not durable application IDs. Keep comparator semantics and all affected sorted borrowers consistent when editing shared payloads. Reinsertion can fail and remove/edit/reinsert is not transactional. Caller synchronization is required for conflicting access; callback guards and marker atomics are not container locks. -Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. +Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. ## Documentation and maintenance -1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. -2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. -3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. -4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. +1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. +2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. +3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. +4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. -[Architecture](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) +[Architecture](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/CHANGELOG.md) [Full roadmap #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini roadmap #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [Product-line policy](docs/PRODUCT_LINES.md) · [Contributing](CONTRIBUTING.md) · [MIT license](LICENSE) · [Author’s independent project directory](https://quiveld.com/projects/independent/) diff --git a/README.zh-CN.md b/README.zh-CN.md index 851d1fa..447cd77 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -20,17 +20,17 @@ 在 Windows/Linux 配对实时顺序归档研究中,Full v4.2.0 沿用的运行实现相对 4.1 **总体耗时降低 37.1%/36.0%**,**比较密集条件降低 80.2%/78.1%**。相对两个 Stable 对照,每平台均胜出 45/45 个条件。结论适用于受测负载和具体对照。 -![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) +![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) -先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 +先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 -![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) +![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) 散点固定初始 100,000 个实例和种子 17。主耗时轴为对数,线性面板按实测坐标放大近邻点。内存是独立诊断的**峰值请求字节**(以 MiB 展示),不是进程 RAM。此比较密集条件 Full 为 4,278,776 字节,原生 OM 为 13,437,504 字节,约低 68%。图保留全部八种实现。 -Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 +Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 -全部时间/内存图:[Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) +全部时间/内存图:[Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) · [Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) · [Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) · [Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) ## 构建与首次运行 @@ -40,17 +40,17 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 +运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 -CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.zh-CN.md)。 +CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/INTEGRATION.zh-CN.md)。 ## Full 版本演进 | 版本 | 主要工程变化 | 兼容性与证据 | | --- | --- | --- | -| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.zh-CN.md) | -| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.zh-CN.md) | -| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.zh-CN.md) | +| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_STABLE.zh-CN.md) | +| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.zh-CN.md) | +| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.zh-CN.md) | **下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 @@ -71,15 +71,15 @@ CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find Handle 表示存活实例,删除自身或销毁来源即失效,不是持久业务 ID。修改共享载荷时,须保持比较语义及全部相关有序借用结构一致。重新插入可能失败,删除/修改/重插不是事务。冲突访问需外部同步;回调守卫与来源标记原子操作不是容器锁。 -局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 +局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 ## 文档与维护 -1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 -2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 -3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 -4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 +1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 +2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 +3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 +4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 -[架构](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) +[架构](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/CHANGELOG.md) [Full 路线 #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini 路线 #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [产品线规则](docs/PRODUCT_LINES.zh-CN.md) · [贡献说明](CONTRIBUTING.md) · [MIT 许可](LICENSE) · [作者独立项目目录](https://quiveld.com/projects/independent/) diff --git a/docs/FULL.md b/docs/FULL.md index dd07c39..1c060d4 100644 --- a/docs/FULL.md +++ b/docs/FULL.md @@ -20,25 +20,25 @@ Applications own payloads and business identities. Full supplies ordering compon In the archived Windows/Linux matched live-order study, Full v4.2.0's unchanged operational implementation used **37.1% / 36.0% less elapsed time than 4.1 overall**, and **80.2% / 78.1% less in compare-heavy cells**. It won 45/45 cells per host against both Stable controls. Results depend on the tested workload and control. -![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) +![Median paired Full/control elapsed ratios on Windows and Linux; lower is faster](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/live-ratios.svg) -Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md). +Ratios are Full/control elapsed time: the median of paired cell ratios, not throughput percentage or a ratio of unrelated medians. Each host has 45 matched cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation. All seven controls and adverse conditions are retained in [the full evidence](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.md). -![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) +![Windows compare-heavy: formal median elapsed in ms against diagnostic peak requested memory in MiB, with linear detail panels](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) The scatter fixes 100,000 initial occurrences and seed 17. Main elapsed axis is logarithmic; linear panels show near-coincident points at their measured coordinates. Memory is separately measured diagnostic **peak requested bytes**, shown in MiB, rather than process RAM. In this compare-heavy example Full requested 4,278,776 bytes versus native OM 13,437,504 bytes, about 68% lower. The graph retains all eight variants. -Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. +Full/native tag-range OM overall ratios were 1.052/1.020; some update-heavy conditions favor native OM. For arbitrary relative editing with history, Full/tested Treap lifecycle wall-time ratios were 0.580/0.526 (five cells/host, incremental Treap restore). Endpoint flat history was faster: Full/flat 1.137/1.136 (13 cells/host). Bulk Treap restore is unmeasured. See [selection guidance](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_SELECTION_GUIDE.md) for practical tradeoffs. ## Complete time/memory comparison -![Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) +![Windows compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.svg) -![Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) +![Windows update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.svg) -![Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) +![Linux compare-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.svg) -![Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) +![Linux update-heavy](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.svg) Each plot uses the same initial size, seed, units and linear-detail rules. Open the SVG for full-size inspection; exact coordinates, accounting and raw hashes are in the evidence linked above. @@ -50,17 +50,17 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.md) cover managed order, Groups and snapshot restore. +Run `build/layerkeysort_example` (MSVC: `build/Debug/layerkeysort_example.exe`). [basic.c](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/basic.c) creates a container, inserts, queries, removes and destroys it. [Usage](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/USAGE.md) includes stable sorting; [seven public examples](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/README.md) cover managed order, Groups and snapshot restore. -CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.md). +CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_package(LayerKeySort CONFIG REQUIRED)`; link `LayerKeySort::layerkeysort`. Include only ``. The two-file distribution compiles as C17 and supports C++17 callers. [Integration commands](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/INTEGRATION.md). ## Full version evolution | Edition | Main engineering change | Compatibility and evidence | | --- | --- | --- | -| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.md) | -| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.md) | -| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.md) | +| 4.0 | Stable occurrence Handles, bounded blocks/AVL, immutable history and batch utilities | Frozen 64 functions / 14 types, LS1 and LKS4SNP1; [historical release record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_STABLE.md) | +| 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.md) | +| **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.md) | **Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. @@ -81,15 +81,17 @@ Neither product links the other's production code. These are capability distinct Handles represent live occurrences and expire on own removal/source destruction; they are not durable application IDs. Keep comparator semantics and all affected sorted borrowers consistent when editing shared payloads. Reinsertion can fail and remove/edit/reinsert is not transactional. Caller synchronization is required for conflicting access; callback guards and marker atomics are not container locks. -Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. +Local block/index work is bounded by private block policy plus balanced-index maintenance, with allocator/comparator costs in addition. Snapshot capture/export is O(N+A); retained histories and restore scratch consume memory. Full supplies no general binary ABI, database, transaction manager or CRDT. The [complete API contracts](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.md) and [performance evidence](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.md) describe applicability and unmeasured alternatives. ## Documentation and maintenance -1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. -2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. -3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. -4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. +1. [Implementation walkthrough](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_WALKTHROUGH.md) — execution paths across 16 production modules. +2. [Complete API guide](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.md) — all 64 functions, lifetime, failure and concurrency. +3. [Internal algorithms](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_INTERNALS.md) — bounded blocks, labels, AVL, wire and stable merging. +4. [Validation and distribution](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_VALIDATION.md) — tests, fixtures and reproducible integration. -[Architecture](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) +[Architecture](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/ARCHITECTURE.md) · [Compatibility](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.md) · [V3 migration](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/MIGRATION_V3_V4.md) · [Development](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.md) · [Changelog](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/CHANGELOG.md) [Full roadmap #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini roadmap #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [Product-line policy](PRODUCT_LINES.md) · [Contributing](../CONTRIBUTING.md) · [MIT license](../LICENSE) · [Author’s independent project directory](https://quiveld.com/projects/independent/) + +Integration navigation handoff: the two Repo-owned Full entries in `docs/index.html` select this preparation branch for review. After separately authorized integration, change them to `blob/main/docs/FULL.md` and `blob/main/docs/FULL.zh-CN.md`. Current Full technical documents and figures remain pinned to the immutable Full preparation revision; retain v4.1.0 download access until publication. diff --git a/docs/FULL.zh-CN.md b/docs/FULL.zh-CN.md index 61663d9..932421c 100644 --- a/docs/FULL.zh-CN.md +++ b/docs/FULL.zh-CN.md @@ -20,25 +20,25 @@ 在 Windows/Linux 配对实时顺序归档研究中,Full v4.2.0 沿用的运行实现相对 4.1 **总体耗时降低 37.1%/36.0%**,**比较密集条件降低 80.2%/78.1%**。相对两个 Stable 对照,每平台均胜出 45/45 个条件。结论适用于受测负载和具体对照。 -![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) +![Windows 与 Linux 的 Full/对照配对耗时比中位数;越小越快](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/live-ratios.zh-CN.svg) -先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 +先计算各匹配条件的 Full/对照耗时比,再取中位数;不是吞吐量百分比,也不是不相关中位数相除。每平台 45 个条件,初始 1k/10k/100k 个实例、20k 次轨迹操作,每条件/实现七次正式样本。[完整证据](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.zh-CN.md)保留全部七个对照及不利条件。 -![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) +![Windows 比较密集:正式耗时中位数 ms 与诊断峰值请求内存 MiB,含线性放大图](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) 散点固定初始 100,000 个实例和种子 17。主耗时轴为对数,线性面板按实测坐标放大近邻点。内存是独立诊断的**峰值请求字节**(以 MiB 展示),不是进程 RAM。此比较密集条件 Full 为 4,278,776 字节,原生 OM 为 13,437,504 字节,约低 68%。图保留全部八种实现。 -Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 +Full/原生标签区间 OM 总体比为 1.052/1.020;部分更新密集条件有利于原生 OM。任意相对编辑加历史的生命周期墙钟比相对受测 Treap 为 0.580/0.526(每平台五条件,Treap 逐项恢复)。端点平面历史组合更快,Full/平面为 1.137/1.136(每平台 13 条件)。Treap 批量恢复未测。实际取舍见[选型指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_SELECTION_GUIDE.zh-CN.md)。 ## 全部时间/内存比较 -![Windows 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) +![Windows 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-compare-heavy.zh-CN.svg) -![Windows 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) +![Windows 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/windows-update-heavy.zh-CN.svg) -![Linux 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) +![Linux 比较密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-compare-heavy.zh-CN.svg) -![Linux 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/f9c7762d48dad57a19ed9750b94e397154317509/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) +![Linux 更新密集](https://raw.githubusercontent.com/RXY712200/LayerKeySort/c119c930b36becbc24392f6bb29bef761e72ea09/benchmarks/research/full-v4.2.0-rc.1/linux-update-heavy.zh-CN.svg) 每图采用同一初始规模、种子、单位及线性细节规则。点击查看原 SVG;完整坐标、统计口径和原始哈希见上方证据。 @@ -50,17 +50,17 @@ cmake --build build --config Debug --parallel ctest --test-dir build -C Debug --output-on-failure ``` -运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 +运行 `build/layerkeysort_example`(MSVC:`build/Debug/layerkeysort_example.exe`)。[basic.c](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/basic.c)完成创建、插入、查询、删除和销毁。[使用说明](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/USAGE.zh-CN.md)含稳定排序,[七个公开示例](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/examples/README.zh-CN.md)覆盖托管顺序、Group 和快照恢复。 -CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/INTEGRATION.zh-CN.md)。 +CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find_package(LayerKeySort CONFIG REQUIRED)`;链接 `LayerKeySort::layerkeysort`。只包含 ``。两文件分发按 C17 编译,支持 C++17 调用。见[集成命令](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/INTEGRATION.zh-CN.md)。 ## Full 版本演进 | 版本 | 主要工程变化 | 兼容性与证据 | | --- | --- | --- | -| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_STABLE.zh-CN.md) | -| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_1_0.zh-CN.md) | -| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/V4_2_0.zh-CN.md) | +| 4.0 | 稳定实例 Handle、有界块/AVL、独立历史及批处理 | 冻结 64 函数/14 类型、LS1 与 LKS4SNP1;[历史发行记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_STABLE.zh-CN.md) | +| 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.zh-CN.md) | +| **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.zh-CN.md) | **下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 @@ -81,15 +81,17 @@ CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find Handle 表示存活实例,删除自身或销毁来源即失效,不是持久业务 ID。修改共享载荷时,须保持比较语义及全部相关有序借用结构一致。重新插入可能失败,删除/修改/重插不是事务。冲突访问需外部同步;回调守卫与来源标记原子操作不是容器锁。 -局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 +局部块/索引工作受私有块策略及平衡索引维护约束,另有分配器/比较器成本。快照捕获/导出为 O(N+A),保留历史及恢复临时数组占用内存。Full 不提供通用二进制 ABI、数据库、事务管理器或 CRDT。[完整 API 契约](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)与[性能证据](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/FULL_RC1_EVIDENCE.zh-CN.md)说明适用范围及未测替代方案。 ## 文档与维护 -1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 -2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 -3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 -4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 +1. [实现导读](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_WALKTHROUGH.zh-CN.md)——16 个生产模块的执行路径。 +2. [完整 API 指南](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_API_REFERENCE.zh-CN.md)——全部 64 函数、寿命、失败及并发。 +3. [内部算法](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_INTERNALS.zh-CN.md)——有界块、标签、AVL、线格式及稳定归并。 +4. [验证与分发](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/IMPLEMENTATION_VALIDATION.zh-CN.md)——测试、固定样例与可复现集成。 -[架构](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/f9c7762d48dad57a19ed9750b94e397154317509/CHANGELOG.md) +[架构](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/ARCHITECTURE.zh-CN.md) · [兼容性](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/COMPATIBILITY.zh-CN.md) · [V3 迁移](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/MIGRATION_V3_V4.zh-CN.md) · [开发](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/DEVELOPMENT.zh-CN.md) · [中文变更日志](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/CHANGELOG.zh-CN.md) · [原始 Changelog](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/CHANGELOG.md) [Full 路线 #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini 路线 #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [产品线规则](PRODUCT_LINES.zh-CN.md) · [贡献说明](../CONTRIBUTING.md) · [MIT 许可](../LICENSE) · [作者独立项目目录](https://quiveld.com/projects/independent/) + +集成导航交接:`docs/index.html` 的两个 Repo 所有 Full 入口目前选择本准备分支,便于审核;另行授权集成后将其切换为 `blob/main/docs/FULL.md` 与 `blob/main/docs/FULL.zh-CN.md`。当前 Full 技术文档及图形继续固定于不可变 Full 准备提交;实际发布前保留 v4.1.0 下载入口。 diff --git a/docs/index.html b/docs/index.html index 777809a..8869201 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,36 +1,42 @@ -LayerKeySort Full v4.2.0 — ordering, sorting and history +LayerKeySort Full v4.2.0 — ordering, sorting and history

LayerKeySort Full · C17 · v4.2.0

Dynamic order, stable sorting and independent history.

High-performance C17 ordering components. Choose explicit editing, comparator-maintained order, one-shot stable sorting, immutable batches or historical snapshots; use the families independently.

-

Build and integrate · Usage · Full documentation

-

Target edition: Full v4.2.0 Stable. Main remains 4.2.0-rc.1 until authorized integration; published Stable/Latest remains v4.1.0. The 4.2.0 tag and assets have not been published. Published downloads

+

Build and integrate · Usage · Full documentation

+

Target edition: Full v4.2.0 Stable. Main remains 4.2.0-rc.1 until authorized integration; published Stable/Latest remains v4.1.0. The 4.2.0 tag and assets have not been published. During review, the Full documentation entry selects this Repo preparation branch; after integration its two language-specific entry links must select main. Published downloads

LksOrderRelative insert/move/remove and precedence
LksManagedOrderStable comparator order and bound lookup
lks_sortStable one-shot pointer-array sorting
LksGroup / LksGroupBatchImmutable sorted chunks and stable merge
LksSnapshotIndependent associations, LS1, wire and restoration

Version evolution

Full editionEngineering change
4.0Stable Handles, bounded blocks/AVL, snapshots and batches
4.1Shared block owner and compact Snapshot metadata
4.2Affected-slot updates, bounded labels/AVL fallback and fixed-width wire

Measured time and memory

Against 4.1: 37.1% lower Windows / 36.0% lower Linux elapsed overall; 80.2% / 78.1% lower compare-heavy elapsed. Each host has 45 cells, 1k/10k/100k initial occurrences, 20k trace operations and seven formal samples per cell/implementation.

-
Median paired Full/control elapsed ratios; lower is faster
Median paired Full/control elapsed ratios; lower is faster
-
Windows compare-heavy elapsed versus requested peak memory, including linear details
Windows compare-heavy elapsed versus requested peak memory, including linear details
-

Scatter: 100,000 initial occurrences, seed 17; formal median ms on a logarithmic main axis, separately measured diagnostic peak requested memory in MiB, not process RAM. Linear details preserve measured coordinates. Native OM can win update-heavy cells; endpoint flat history is faster; bulk Treap restore is unmeasured. All figures and evidence

+
Median paired Full/control elapsed ratios; lower is faster
Median paired Full/control elapsed ratios; lower is faster. Scroll within the figure for readable labels; the original-size link includes the full legend and details. Open original-size figure
+
Windows compare-heavy elapsed versus requested peak memory, including linear details
Windows compare-heavy elapsed versus requested peak memory, including linear details. Scroll within the figure for readable labels; the original-size link includes the full legend and details. Open original-size figure
+

Scatter: 100,000 initial occurrences, seed 17; formal median ms on a logarithmic main axis, separately measured diagnostic peak requested memory in MiB, not process RAM. Linear details preserve measured coordinates. Native OM can win update-heavy cells; endpoint flat history is faster; bulk Treap restore is unmeasured. All figures and evidence

Applications own payloads, identity, transactions and synchronization; Handles are not durable IDs. Snapshot/export is O(N+A); history retention and restore consume memory. Full provides no database, transaction manager or CRDT.

-

Selection · 64 APIs and contracts · Examples

+

Selection · 64 APIs and contracts · Examples

Mini independently provides an 18-function lightweight linked-sequence component; Workbench is its consumer and validation application. Neither depends on Full. Mini

Historical visualizers: V3 · V1. They depict older versions and do not execute Full v4.2.0.

LayerKeySort Full · C17 · v4.2.0

动态顺序、稳定排序与独立历史。

高性能 C17 顺序组件。按任务选择显式编辑、比较器维护、一次性稳定排序、不可变批处理或历史快照;各家族可独立使用。

-

构建与集成 · 使用指南 · Full 文档

-

目标文档为 Full v4.2.0 Stable。授权集成前 main 仍为 4.2.0-rc.1;已发布 Stable/Latest 仍为 v4.1.0。4.2.0 标签及资产尚未发布。 已发布下载

+

构建与集成 · 使用指南 · Full 文档

+

目标文档为 Full v4.2.0 Stable。授权集成前 main 仍为 4.2.0-rc.1;已发布 Stable/Latest 仍为 v4.1.0。4.2.0 标签及资产尚未发布。审查期间,Full 文档入口选择本 Repo 准备分支;集成后须将两种语言的入口链接切换到 main。 已发布下载

LksOrder相对插入、移动、删除与先后查询
LksManagedOrder稳定比较器顺序与边界查询
lks_sort一次性稳定指针数组排序
LksGroup / LksGroupBatch不可变排序分片与稳定归并
LksSnapshot独立关联、LS1、线格式与恢复

版本演进

Full 版本工程变化
4.0稳定 Handle、有界块/AVL、快照及批处理
4.1共享块 owner、紧凑快照元数据
4.2受影响槽位更新、有界标签/AVL 回退、固定宽度线格式

实测时间与内存

相对 4.1 总体耗时降低 Windows 37.1%/Linux 36.0%;比较密集降低 80.2%/78.1%。每平台 45 条件、初始 1k/10k/100k、每轨迹 20k 操作、每条件/实现七个正式样本。

-
配对耗时比中位数;越小越快
配对耗时比中位数;越小越快
-
Windows 比较密集:耗时与峰值请求内存,含线性放大图
Windows 比较密集:耗时与峰值请求内存,含线性放大图
-

散点固定初始 100,000 项、种子 17。耗时中位数以 ms 展示,主图对数轴;独立诊断峰值请求内存以 MiB 展示,不是进程 RAM。线性放大保留实测坐标。原生 OM 可在更新密集条件胜出;端点平面历史更快;Treap 批量恢复尚未测量。 全部图表与证据

+
配对耗时比中位数;越小越快
配对耗时比中位数;越小越快. 可在图内横向滚动查看;原尺寸链接保留完整图例和细节。 打开原尺寸图形
+
Windows 比较密集:耗时与峰值请求内存,含线性放大图
Windows 比较密集:耗时与峰值请求内存,含线性放大图. 可在图内横向滚动查看;原尺寸链接保留完整图例和细节。 打开原尺寸图形
+

散点固定初始 100,000 项、种子 17。耗时中位数以 ms 展示,主图对数轴;独立诊断峰值请求内存以 MiB 展示,不是进程 RAM。线性放大保留实测坐标。原生 OM 可在更新密集条件胜出;端点平面历史更快;Treap 批量恢复尚未测量。 全部图表与证据

应用拥有载荷、身份、事务与同步;Handle 不是持久 ID。快照/导出 O(N+A),历史保留及恢复需要内存。Full 不提供数据库、事务管理器或 CRDT。

-

选型 · 64 API 与契约 · 示例

+

选型 · 64 API 与契约 · 示例

Mini 独立提供 18 函数的轻量双向链表顺序组件,Workbench 为其消费者与验证应用;两者均不依赖 Full。 Mini

历史可视化:V3 · V1. 它们展示旧版本,不执行 Full v4.2.0。

From 4dec48e146777ac993b51a3ab688d5e8cd68e3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=98=95=E5=AE=87?= <118583582+RXY712200@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:38:44 +0800 Subject: [PATCH 3/3] docs: reflect integrated Full 4.2.0 preparation --- README.md | 2 +- README.zh-CN.md | 2 +- docs/FULL.md | 4 ++-- docs/FULL.zh-CN.md | 4 ++-- docs/PRODUCT_LINES.md | 2 +- docs/PRODUCT_LINES.zh-CN.md | 2 +- docs/index.html | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dd9d66d..97b4d0b 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_packa | 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.md) | | **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.md) | -**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. +**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main now includes the accepted Full v4.2.0 implementation and Stable metadata; v4.2.0 is not yet tagged or published. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. ## Full and Mini are independent diff --git a/README.zh-CN.md b/README.zh-CN.md index 447cd77..f3a6483 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -52,7 +52,7 @@ CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find | 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.zh-CN.md) | | **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.zh-CN.md) | -**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 +**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。main 现已包含已接受的 Full v4.2.0 实现及 Stable 元数据;v4.2.0 尚未打标签或发布。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 ## Full 与 Mini 相互独立 diff --git a/docs/FULL.md b/docs/FULL.md index 1c060d4..b922589 100644 --- a/docs/FULL.md +++ b/docs/FULL.md @@ -62,7 +62,7 @@ CMake ≥3.21: `add_subdirectory`, offline FetchContent or installed `find_packa | 4.1 | Shared Block owner and compact Snapshot metadata | Source-compatible storage reduction; historical 100k–10m results and regressions in [4.1 record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.md) | | **4.2** | Affected-slot updates, bounded labels with AVL fallback, fixed-width wire conversion | Same public/wire contracts; cumulative Windows/Linux evidence and [Stable preparation record](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.md) | -**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main remains the integrated 4.2.0-rc.1 source until authorized integration. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. +**Download/source status:** This documentation presents the prepared Full v4.2.0 Stable edition at an immutable preparation revision. Main now includes the accepted Full v4.2.0 implementation and Stable metadata; v4.2.0 is not yet tagged or published. Published Stable and repository Latest remain [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0); use that working release for published assets. The planned v4.2.0 tag and assets have not been published. [Stable 4.1 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md) remains accessible. ## Full and Mini are independent @@ -94,4 +94,4 @@ Local block/index work is bounded by private block policy plus balanced-index ma [Full roadmap #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini roadmap #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [Product-line policy](PRODUCT_LINES.md) · [Contributing](../CONTRIBUTING.md) · [MIT license](../LICENSE) · [Author’s independent project directory](https://quiveld.com/projects/independent/) -Integration navigation handoff: the two Repo-owned Full entries in `docs/index.html` select this preparation branch for review. After separately authorized integration, change them to `blob/main/docs/FULL.md` and `blob/main/docs/FULL.zh-CN.md`. Current Full technical documents and figures remain pinned to the immutable Full preparation revision; retain v4.1.0 download access until publication. +Integration navigation: the two Repo-owned Full entries in `docs/index.html` now select `blob/main/docs/FULL.md` and `blob/main/docs/FULL.zh-CN.md`, taking effect with this navigation integration. Current Full technical documents and figures remain pinned to the immutable Full preparation revision; retain v4.1.0 download access until publication. diff --git a/docs/FULL.zh-CN.md b/docs/FULL.zh-CN.md index 932421c..d49318f 100644 --- a/docs/FULL.zh-CN.md +++ b/docs/FULL.zh-CN.md @@ -62,7 +62,7 @@ CMake ≥3.21 支持 `add_subdirectory`、离线 FetchContent 或安装后 `find | 4.1 | 块共享 owner、紧凑快照元数据 | 源码兼容的存储缩减;十万至千万级历史结果及退化见[4.1 记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_1_0.zh-CN.md) | | **4.2** | 受影响槽位更新、有界标签及 AVL 回退、固定宽度线格式转换 | 公开/线格式契约不变;累计 Windows/Linux 证据及[Stable 准备记录](https://github.com/RXY712200/LayerKeySort/blob/c119c930b36becbc24392f6bb29bef761e72ea09/docs/V4_2_0.zh-CN.md) | -**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。另行授权集成前,main 仍为已集成的 4.2.0-rc.1。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 +**下载/源码状态:** 本文直接介绍固定准备版本中的 Full v4.2.0 Stable 版。main 现已包含已接受的 Full v4.2.0 实现及 Stable 元数据;v4.2.0 尚未打标签或发布。已发布 Stable 及仓库 Latest 仍为 [v4.1.0](https://github.com/RXY712200/LayerKeySort/releases/tag/v4.1.0),已发布资产从该有效发行页取得。计划中的 v4.2.0 标签及资产尚未发布。[Stable 4.1 权威 API](https://github.com/RXY712200/LayerKeySort/blob/70d7f0ef5857b54381b863d292a213909d87459f/docs/API.md)继续可用。 ## Full 与 Mini 相互独立 @@ -94,4 +94,4 @@ Handle 表示存活实例,删除自身或销毁来源即失效,不是持久 [Full 路线 #3](https://github.com/RXY712200/LayerKeySort/issues/3) · [Mini 路线 #7](https://github.com/RXY712200/LayerKeySort/issues/7) · [产品线规则](PRODUCT_LINES.zh-CN.md) · [贡献说明](../CONTRIBUTING.md) · [MIT 许可](../LICENSE) · [作者独立项目目录](https://quiveld.com/projects/independent/) -集成导航交接:`docs/index.html` 的两个 Repo 所有 Full 入口目前选择本准备分支,便于审核;另行授权集成后将其切换为 `blob/main/docs/FULL.md` 与 `blob/main/docs/FULL.zh-CN.md`。当前 Full 技术文档及图形继续固定于不可变 Full 准备提交;实际发布前保留 v4.1.0 下载入口。 +集成导航:`docs/index.html` 的两个 Repo 所有 Full 入口现已选择 `blob/main/docs/FULL.md` 与 `blob/main/docs/FULL.zh-CN.md`,随本导航变更集成生效。当前 Full 技术文档及图形继续固定于不可变 Full 准备提交;实际发布前保留 v4.1.0 下载入口。 diff --git a/docs/PRODUCT_LINES.md b/docs/PRODUCT_LINES.md index 5038e84..beedb97 100644 --- a/docs/PRODUCT_LINES.md +++ b/docs/PRODUCT_LINES.md @@ -6,7 +6,7 @@ LayerKeySort is **one repository with independently versioned products**, not on product with interchangeable build modes. This policy describes repository-wide naming and delivery; each product's own README and API contract remain authoritative. -The prepared Full edition is v4.2.0; its implementation and evidence are described in the [Full entry](FULL.md). Published Stable/Latest remains v4.1.0 until separate publication. Mini and Workbench are unchanged. +Main includes Full v4.2.0 implementation and Stable metadata; its implementation and evidence are described in the [Full entry](FULL.md). Published Stable/Latest remains v4.1.0 until separate publication. Mini and Workbench are unchanged. ## Products and locations diff --git a/docs/PRODUCT_LINES.zh-CN.md b/docs/PRODUCT_LINES.zh-CN.md index 66b692a..b6d4d47 100644 --- a/docs/PRODUCT_LINES.zh-CN.md +++ b/docs/PRODUCT_LINES.zh-CN.md @@ -5,7 +5,7 @@ LayerKeySort 采用**单仓库、多独立产品、独立版本号**。这不是将同一套源码用开关裁剪成 “完整版”和“精简版”。各产品的公开 API、兼容性和生命周期,以各自文档为准。 -准备中的 Full 版本为 v4.2.0,实现及证据见 [Full 入口](FULL.zh-CN.md)。另行发布前,已发布 Stable/Latest 仍为 v4.1.0;Mini 与 Workbench 不变。 +main 已包含 Full v4.2.0 实现及 Stable 元数据,实现及证据见 [Full 入口](FULL.zh-CN.md)。另行发布前,已发布 Stable/Latest 仍为 v4.1.0;Mini 与 Workbench 不变。 ## 产品划分 diff --git a/docs/index.html b/docs/index.html index 8869201..ecc48d8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,8 +10,8 @@

LayerKeySort Full · C17 · v4.2.0

Dynamic order, stable sorting and independent history.

High-performance C17 ordering components. Choose explicit editing, comparator-maintained order, one-shot stable sorting, immutable batches or historical snapshots; use the families independently.

-

Build and integrate · Usage · Full documentation

-

Target edition: Full v4.2.0 Stable. Main remains 4.2.0-rc.1 until authorized integration; published Stable/Latest remains v4.1.0. The 4.2.0 tag and assets have not been published. During review, the Full documentation entry selects this Repo preparation branch; after integration its two language-specific entry links must select main. Published downloads

+

Build and integrate · Usage · Full documentation

+

Full v4.2.0 implementation and Stable metadata are integrated into main; published Stable/Latest remains v4.1.0. The 4.2.0 tag and assets have not been published. Published downloads

LksOrderRelative insert/move/remove and precedence
LksManagedOrderStable comparator order and bound lookup
lks_sortStable one-shot pointer-array sorting
LksGroup / LksGroupBatchImmutable sorted chunks and stable merge
LksSnapshotIndependent associations, LS1, wire and restoration

Version evolution

Full editionEngineering change
4.0Stable Handles, bounded blocks/AVL, snapshots and batches
4.1Shared block owner and compact Snapshot metadata
4.2Affected-slot updates, bounded labels/AVL fallback and fixed-width wire
@@ -25,8 +25,8 @@

Measured time and memory

Mini independently provides an 18-function lightweight linked-sequence component; Workbench is its consumer and validation application. Neither depends on Full. Mini

Historical visualizers: V3 · V1. They depict older versions and do not execute Full v4.2.0.

LayerKeySort Full · C17 · v4.2.0

动态顺序、稳定排序与独立历史。

高性能 C17 顺序组件。按任务选择显式编辑、比较器维护、一次性稳定排序、不可变批处理或历史快照;各家族可独立使用。

-

构建与集成 · 使用指南 · Full 文档

-

目标文档为 Full v4.2.0 Stable。授权集成前 main 仍为 4.2.0-rc.1;已发布 Stable/Latest 仍为 v4.1.0。4.2.0 标签及资产尚未发布。审查期间,Full 文档入口选择本 Repo 准备分支;集成后须将两种语言的入口链接切换到 main。 已发布下载

+

构建与集成 · 使用指南 · Full 文档

+

Full v4.2.0 实现及 Stable 元数据已集成到 main;已发布 Stable/Latest 仍为 v4.1.0。4.2.0 标签及资产尚未发布。 已发布下载

LksOrder相对插入、移动、删除与先后查询
LksManagedOrder稳定比较器顺序与边界查询
lks_sort一次性稳定指针数组排序
LksGroup / LksGroupBatch不可变排序分片与稳定归并
LksSnapshot独立关联、LS1、线格式与恢复

版本演进

Full 版本工程变化
4.0稳定 Handle、有界块/AVL、快照及批处理
4.1共享块 owner、紧凑快照元数据
4.2受影响槽位更新、有界标签/AVL 回退、固定宽度线格式