From 8be3e27511abb3757cc15f2e660f618aaeb1ac40 Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Mon, 6 Apr 2026 15:52:42 +0300 Subject: [PATCH 1/3] fix(ci): publish benchmark delta reports - make run-benchmarks tolerate missing REPORT_DICT_TRAIN rows\n- keep benchmark report sections explicit with n/a placeholders\n- publish benchmark-report and benchmark-delta artifacts to gh-pages/dev/bench\n- add direct README links to published delta/full reports --- .github/scripts/run-benchmarks.sh | 7 +++++-- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ README.md | 2 ++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/scripts/run-benchmarks.sh b/.github/scripts/run-benchmarks.sh index cfd00e5a..798b0c1d 100755 --- a/.github/scripts/run-benchmarks.sh +++ b/.github/scripts/run-benchmarks.sh @@ -296,10 +296,9 @@ if not dictionary_rows: if not dictionary_training_rows: print( - "ERROR: No REPORT_DICT_TRAIN lines parsed; dictionary training section would be empty.", + "WARN: No REPORT_DICT_TRAIN lines parsed; dictionary training section will be empty.", file=sys.stderr, ) - sys.exit(1) with open("benchmark-results.json", "w") as f: json.dump(benchmark_results, f, indent=2) @@ -482,6 +481,8 @@ for row in sorted(dictionary_rows, key=lambda item: (item["scenario"], item["lev lines.append( f'| {row["scenario"]} | {label} | {row["level"]} | {row["dict_bytes"]} | {row["train_ms"]:.3f} | {row["ffi_no_dict_bytes"]} | {row["ffi_with_dict_bytes"]} | {row["ffi_no_dict_ratio"]:.4f} | {row["ffi_with_dict_ratio"]:.4f} |' ) +if not dictionary_rows: + lines.append("| _n/a_ | _no dictionary rows emitted in this run_ | - | - | - | - | - | - | - |") lines.extend([ "", @@ -498,6 +499,8 @@ for row in sorted(dictionary_training_rows, key=lambda item: item["scenario"]): lines.append( f'| {row["scenario"]} | {label} | {row["dict_bytes_requested"]} | {row["rust_train_ms"]:.3f} | {row["ffi_train_ms"]:.3f} | {row["rust_dict_bytes"]} | {row["ffi_dict_bytes"]} | {row["rust_fastcover_score"]} | {delta_cell} | {row["status"]} |' ) +if not dictionary_training_rows: + lines.append("| _n/a_ | _no dictionary training rows emitted in this run_ | - | - | - | - | - | - | - | - |") lines.extend([ "", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db351195..8fd1206c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,3 +158,25 @@ jobs: fail-on-alert: ${{ github.event_name == 'pull_request' }} save-data-file: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} benchmark-data-dir-path: dev/bench + + - name: Checkout gh-pages + if: steps.bot-token.outputs.token != '' && github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/checkout@v6 + with: + ref: gh-pages + token: ${{ steps.bot-token.outputs.token }} + path: gh-pages + + - name: Publish benchmark reports to gh-pages + if: steps.bot-token.outputs.token != '' && github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + mkdir -p gh-pages/dev/bench + cp benchmark-report.md gh-pages/dev/bench/benchmark-report.md + cp benchmark-delta.json gh-pages/dev/bench/benchmark-delta.json + cp benchmark-delta.md gh-pages/dev/bench/benchmark-delta.md + cd gh-pages + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add dev/bench/benchmark-report.md dev/bench/benchmark-delta.json dev/bench/benchmark-delta.md + git diff --cached --quiet || git commit -m "chore(bench): publish delta reports" + git push origin gh-pages diff --git a/README.md b/README.md index e47d6fa4..9fd14c8f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Pure Rust zstd implementation — managed fork of [ruzstd](https://github.com/Ki Historical benchmark charts are published to GitHub Pages: - [Performance dashboard](https://structured-world.github.io/structured-zstd/dev/bench/) +- [Latest benchmark delta report](https://structured-world.github.io/structured-zstd/dev/bench/benchmark-delta.md) +- [Latest full benchmark report](https://structured-world.github.io/structured-zstd/dev/bench/benchmark-report.md) Note: the root Pages URL can be empty; benchmark charts live under `/dev/bench/`. From 0f011dd964a5815b155923eaf551e5266a2c1cba Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Mon, 6 Apr 2026 17:46:44 +0300 Subject: [PATCH 2/3] fix(review): align benchmark warning and publish label - update REPORT_DICT_TRAIN warning to mention _n/a_ placeholder output - rename gh-pages publish commit message to benchmark reports --- .github/scripts/run-benchmarks.sh | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/run-benchmarks.sh b/.github/scripts/run-benchmarks.sh index 798b0c1d..5ec81f32 100755 --- a/.github/scripts/run-benchmarks.sh +++ b/.github/scripts/run-benchmarks.sh @@ -296,7 +296,7 @@ if not dictionary_rows: if not dictionary_training_rows: print( - "WARN: No REPORT_DICT_TRAIN lines parsed; dictionary training section will be empty.", + "WARN: No REPORT_DICT_TRAIN lines parsed; dictionary training section has no data rows; writing _n/a_ placeholder.", file=sys.stderr, ) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fd1206c..98c95df4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,5 +178,5 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add dev/bench/benchmark-report.md dev/bench/benchmark-delta.json dev/bench/benchmark-delta.md - git diff --cached --quiet || git commit -m "chore(bench): publish delta reports" + git diff --cached --quiet || git commit -m "chore(bench): publish benchmark reports" git push origin gh-pages From ce3624a2c27f77a29f935446ed84b90b10f20a1f Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Mon, 6 Apr 2026 17:53:47 +0300 Subject: [PATCH 3/3] fix(review): align report-dict warning with placeholder - update REPORT_DICT warning to mention _n/a_ placeholder rows when section has no data --- .github/scripts/run-benchmarks.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/run-benchmarks.sh b/.github/scripts/run-benchmarks.sh index 5ec81f32..af4634f2 100755 --- a/.github/scripts/run-benchmarks.sh +++ b/.github/scripts/run-benchmarks.sh @@ -292,7 +292,10 @@ if not memory_rows: sys.exit(1) if not dictionary_rows: - print("WARN: No REPORT_DICT lines parsed; dictionary section will be empty.", file=sys.stderr) + print( + "WARN: No REPORT_DICT lines parsed; dictionary section has no data rows; writing _n/a_ placeholder.", + file=sys.stderr, + ) if not dictionary_training_rows: print(