Skip to content

prepare KFlate 1.1.0 - #41

Closed
rafambn wants to merge 55 commits into
masterfrom
dev-1.1.0
Closed

rafambn wants to merge 55 commits into
masterfrom
dev-1.1.0

Conversation

@rafambn

@rafambn rafambn commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • bring the KFlate 1.1.0 API, validation, multiplatform build, and web demo changes into master
  • add reproducible benchmark comparison and demo snapshot support
  • remove stale design files and one-off benchmark archives while preserving the live demo snapshot and CI fixtures

Validation

  • python3 scripts/benchmark_comparison_test.py
  • python3 scripts/validate_benchmark_smoke_test.py
  • ./gradlew :kflate:jvmTest :web-demo:assembleWebDemo

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 25 commits September 6, 2026 22:43
Make benchmark results representative
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
@rafambn

rafambn commented Sep 11, 2026

Copy link
Copy Markdown
Owner Author

Closing this PR because the cleanup belongs on dev-1.1.0, not master. A replacement cleanup PR will target dev-1.1.0.

@rafambn rafambn closed this Sep 11, 2026
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