Skip to content

Prepare KFlate 1.1.0 for release - #45

Merged
rafambn merged 62 commits into
masterfrom
dev-1.1.0
Sep 12, 2026
Merged

rafambn merged 62 commits into
masterfrom
dev-1.1.0

Conversation

@rafambn

@rafambn rafambn commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Prepare master for KFlate 1.1.0 with the completed compression, correctness, and browser demo changes.

  • Separate compression and decompression option packages, remove unsupported GZIP dictionaries and the memory-level option, and size compression memory automatically.
  • Improve DEFLATE level policies, match search, stored-block selection, and decompression copies. Reduce scratch allocation for small inputs.
  • Fix fragmented streaming input, validate malformed DEFLATE/GZIP/ZLIB data, and enforce decompression output limits.
  • Refresh the browser demo, handle worker failures, cap demo decompression at 128 MiB, and use normal page scrolling.
  • Remove all benchmarks and retained performance data. Keep unit tests and enforce 100% instruction and branch coverage.
  • Update release documentation, toolchain dependencies, and license packaging.

Validation on the development branch:

  • 186 JVM tests passed without failures or skips.
  • 100% instruction and branch coverage verification passed.
  • Library and web demo builds passed.
  • Linux, Apple, and Windows CI passed for PR Remove benchmarks and simplify demo scrolling #44.
  • Desktop and mobile demo scrolling verified.

This PR does not add Maven Central release automation or publish version 1.1.0.

rafambn and others added 30 commits May 5, 2026 09:02
This commit replaces the custom performance testing logic with a formal benchmarking suite and updates the project's visual branding.

-   **Benchmarks & Performance**:
    -   Integrates `kotlinx-benchmark` for JVM, Linux x64, and Wasm/JS targets.
    -   Introduces `BenchmarkCorpus` to provide deterministic, generated test data, removing the dependency on local resource files.
    -   Adds `BENCHMARKING.md` to document suite execution, comparable metrics, and result interpretation.
    -   Removes legacy `performance/` result files and custom `PerformanceComparisonTest` implementations.
    -   Configures specific benchmark compilations and associated source sets in `kflate/build.gradle.kts`.
-   **Visuals & Documentation**:
    -   Redesigns `KFlate-Logo.svg` with a modern "input flow" visual style.
    -   Updates `README.md` for version `1.1.0` and points to the new benchmarking documentation.
-   **Build & Dependencies**:
    -   Upgrades Gradle to `9.5.0`, Kotlin to `2.3.21`, and AGP to `9.2.0`.
    -   Updates `kotlinx-io` to `0.9.0`.
    -   Removes `kmp-file` and `kotlinx-datetime` dependencies.
    -   Refines the multiplatform target list, removing several X64 native variants.
This commit simplifies the benchmarking infrastructure by removing multi-format abstractions and focusing on raw compression/decompression performance.

- **`BenchmarkState.kt`**:
    - Renames `CorpusBenchmarkState` to `RawBenchmarkState`.
    - Removes `PreparedBenchmarkData` and replaces the complex metrics reporting logic with a streamlined `setupRawBenchmark` helper and `rawBenchmarkReportLine` function.
- **Benchmarks**:
    - Updates `CompressionBenchmarks` and `KompressBaselineBenchmarks` to inherit from `RawBenchmarkState` and call compression APIs directly instead of through a codec interface.
- **Infrastructure Removal**:
    - Deletes `BenchmarkCodecs.kt`, `BenchmarkFormat.kt`, and `BenchmarkMetrics.kt` as the abstraction layers are no longer needed.
- **Dependencies**:
    - Updates `kompress` to version `1.4.2` in `gradle/libs.versions.toml`.
- **Docs**:
    - **`BENCHMARKING.md`**: Updates instructions to reflect the class rename to `RawBenchmarkState`.
    - **`README.md`**: Removes unnecessary imports from the GZIP code snippet.
- **README.md**: Removes redundant import statements from the Raw DEFLATE and ZLIB code examples to improve readability.
- **BENCHMARKING.md**: Removes detailed sections regarding running local benchmarks, publishing results, and updating baselines.
- **.gitignore**: Updates the ignore list to replace `CLAUDE.md` with `AGENTS.md`.
This commit introduces automated generation of benchmark comparison tables (Markdown and JSON) to compare KFlate performance against baselines across JVM, Native, and Wasm targets.

- **`scripts/benchmark_comparison.py`**:
    - New script to parse `kotlinx-benchmark` JSON results and custom metadata.
    - Generates formatted Markdown tables and a summary JSON file.
    - Handles stale report detection and multi-platform data merging.
- **Gradle Configuration**:
    - Updates `benchmarkAll` to automatically trigger the comparison script.
    - Adds `prepareBenchmarkAll` to clean up previous results and metadata.
    - Adds `benchmarkComparison` task to run the reporting script.
- **Benchmark Infrastructure**:
    - **`BenchmarkState.kt`**: Now captures compressed size metadata and platform information.
    - Implements `expect`/`actual` `appendBenchmarkMetadata` for JVM, Linux x64, and Wasm/JS to support platform-specific file I/O during benchmarks.
    - Standardizes decompression benchmarks to use a canonical input for more accurate cross-library comparison.
- **Documentation**:
    - Updates `BENCHMARKING.md` with instructions for running the automated reports and interpreting the new output files.
…recision

This commit streamlines how benchmark metadata is collected and processed while increasing the number of iterations for more stable performance results.

- **`scripts/benchmark_comparison.py`**:
    - Simplifies metadata loading by requiring an explicit file path instead of searching through multiple candidate directories.
    - Removes internal globbing and discovery logic in favor of a single source of truth.
- **Gradle Configuration**:
    - **`kflate/build.gradle.kts`**:
        - Increases `warmups` to 8 and `iterations` to 15 to improve measurement stability.
        - Introduces `collectBenchmarkMetadata`, a new task that consolidates metadata from JVM, Native, and Wasm build directories into a single JSONL file using `awk` for deduplication.
        - Updates `benchmarkComparison` to depend on metadata consolidation and pass the explicit path to the reporting script.
- **Documentation**:
    - **`BENCHMARKING.md`**:
        - Updates instructions to include the new metadata consolidation step.
        - Reflects the updated iteration counts in the technical suite description.
        - Clarifies that the comparison script now requires explicit metadata instead of attempting to resolve multiple paths.
* Reject sizes that overflow internal buffers

* Clarify oversized input error
* Keep the web demo responsive on worker failures

* Release the web worker URL after startup
Remove the one-line error factory and throw FlateError at each call site.
rafambn and others added 29 commits September 6, 2026 23:01
Let compression levels manage hash-table memory
…-their-cost

Make DEFLATE levels trade speed for smaller output
Prepare 1.1.0 release and refresh the compression demo
Select benchmark libraries and retain collected measurements
Cut scratch allocation for short compression inputs
Expand inflate matches with bulk copies
Reuse fixed token prices in level 9 parsing
Choose stored blocks using their actual padding cost
remove unused benchmark and design artifacts
cut level-6 match search overhead with rolling hash
Remove benchmarks and simplify demo scrolling
@rafambn
rafambn merged commit 9d0c265 into master Sep 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant