Skip to content

test(bench): expand zstd benchmark suite#38

Merged
polaz merged 30 commits intomainfrom
test/#24-comprehensive-benchmark-suite-against-c-zstd
Mar 28, 2026
Merged

test(bench): expand zstd benchmark suite#38
polaz merged 30 commits intomainfrom
test/#24-comprehensive-benchmark-suite-against-c-zstd

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Mar 26, 2026

Summary

  • expand the Criterion benchmark matrix beyond the old single-sample compare_ffi setup
  • add generated benchmark JSON/markdown reporting for CI and local runs
  • document benchmark workflows, benchmark dashboard link, and add a flamegraph helper script
  • align decompression benchmark paths and tighten report semantics (scenario ids, buffer-bytes estimates)
  • bound optional Silesia fixture loading for predictable benchmark startup

Validation

  • cargo fmt -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo build
  • cargo nextest run --workspace
  • cargo bench --bench compare_ffi -p structured-zstd --no-run
  • bash .github/scripts/run-benchmarks.sh

Notes

  • the benchmark matrix compares implemented Rust encoder levels only: Fastest and Default
  • dictionary compression timing is intentionally excluded because the crate currently exposes dictionary training but not dictionary-based compression
  • optional Silesia loading is bounded by defaults (STRUCTURED_ZSTD_SILESIA_MAX_FILES=12, STRUCTURED_ZSTD_SILESIA_MAX_FILE_BYTES=67108864) and can be overridden via env

Refs #24

Summary by CodeRabbit

  • Documentation

    • Added BENCHMARKS guide and README sections describing scenarios, metrics, outputs, and usage.
  • New Features

    • Expanded benchmark matrix with more scenarios, per-level and dictionary comparisons; emits structured JSON and a multi-table Markdown report plus flamegraph support.
    • Added a flamegraph generation utility.
  • Chores

    • CI/runner defaults large-stream size when unset, ignores generated benchmark outputs, tightens report validation (fail on missing ratio/memory data, warn on missing dictionary data), and updated a dev dependency.

Copilot AI review requested due to automatic review settings March 26, 2026 22:24
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

Warning

Rate limit exceeded

@polaz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 49 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 49 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: afe08a19-9b05-49fa-9b6b-5440c52acba3

📥 Commits

Reviewing files that changed from the base of the PR and between 94f1c6d and c2a2988.

📒 Files selected for processing (2)
  • .github/scripts/run-benchmarks.sh
  • zstd/benches/support/mod.rs
📝 Walkthrough

Walkthrough

Adds a scenario×level Criterion benchmark matrix with dictionary benches, a support module for benchmark scenarios, CI script parsing of enriched REPORT/REPORT_MEM/REPORT_DICT output to produce JSON and a multi-table Markdown report, a flamegraph helper script, documentation (BENCHMARKS.md, README), and .gitignore entries for generated artifacts.

Changes

Cohort / File(s) Summary
Benchmark harness & CI script
zstd/benches/compare_ffi.rs, .github/scripts/run-benchmarks.sh
Bench converted to a scenario×level matrix, emits REPORT, REPORT_MEM, REPORT_DICT and precomputes compressed buffers; CI script writes to a mktemp file, parses timings + REPORT rows (unescaping labels), hard-fails on missing timings/REPORT/REPORT_MEM (warns if no REPORT_DICT), and produces benchmark-results.json and benchmark-report.md.
Benchmark support library
zstd/benches/support/mod.rs
New support module: Scenario, ScenarioClass, LevelConfig, benchmark_scenarios(), supported_levels(), payload generators, decode-corpus fallback, and optional Silesia loading with env-controlled limits.
Dictionary benchmarks
zstd/benches/compare_ffi.rs (same file)
Adds bench_dictionary stage: trains zstd dicts for applicable scenarios, emits training REPORT_DICT lines, and benchmarks C-FFI compress with/without dict.
Flamegraph tooling
scripts/bench-flamegraph.sh
New strict-mode script to run cargo flamegraph for bench filters, optional root mode, preserves exit status, outputs SVG named from the filter.
Docs & ignore rules
BENCHMARKS.md, README.md, .gitignore
Adds BENCHMARKS.md documenting matrix, CI defaults and Silesia options; expands README benchmarking/dashboard text; ignores benchmark-results.json and benchmark-report.md.
Cargo dev-deps / packaging
zstd/Cargo.toml
Reordered package.exclude entries; enabled zdict_builder feature on the zstd dev-dependency (zstd = { version = "0.13.2", features = ["zdict_builder"] }).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant CI as CI
  participant Script as run-benchmarks.sh
  participant Bench as compare_ffi (cargo bench)
  participant Parser as parser (in script)
  participant Artifacts as Artifacts (JSON / MD)

  CI->>Script: start benchmark run
  Script->>Bench: invoke cargo bench (env: mktemp raw file)
  Bench-->>Script: stdout (Criterion timings + REPORT / REPORT_MEM / REPORT_DICT)
  Script->>Parser: parse raw output (unescape labels, extract sections)
  Parser->>Artifacts: write `benchmark-results.json` (timings)
  Parser->>Artifacts: write `benchmark-report.md` (ratios, memory, dict, timings tables)
  Script->>CI: exit status and artifact locations
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through rows of levels, code and charts,
I nibbled REPORT lines and counted parts,
JSON snug in a tmp-file bed,
Markdown tables plump and read,
Flamegraphs sing — a carrot for the arts!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: expanding the Criterion benchmark suite with new scenarios, levels, reporting, and documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/#24-comprehensive-benchmark-suite-against-c-zstd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the project’s performance benchmarking infrastructure to better track structured-zstd (pure Rust) vs the C zstd reference across a broader scenario/level matrix, with CI-friendly reporting and local profiling helpers.

Changes:

  • Reworks compare_ffi into a multi-scenario / multi-level Criterion matrix with REPORT ... metadata lines for post-processing.
  • Adds benchmark scenario/level scaffolding (including optional Silesia fixtures via env var).
  • Introduces reporting + documentation: CI/local benchmark runner output (JSON + markdown), a flamegraph helper script, and benchmark workflow docs.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
zstd/benches/support/mod.rs Adds reusable benchmark scenarios (random/entropy/large/log/corpus + optional Silesia) and level mapping.
zstd/benches/compare_ffi.rs Converts benchmark into a matrix for compress/decompress with per-scenario configuration and report-line emission.
.github/scripts/run-benchmarks.sh Runs the matrix and generates benchmark-results.json plus a human-readable markdown report.
scripts/bench-flamegraph.sh Adds a helper to generate flamegraphs for a selected Criterion benchmark filter.
BENCHMARKS.md Documents scenarios, level mapping, and common benchmark commands/outputs.
README.md Links to the benchmark documentation and summarizes what the suite measures.
.gitignore Ignores generated benchmark JSON/markdown outputs.

Comment thread zstd/benches/compare_ffi.rs Outdated
Comment thread zstd/benches/support/mod.rs
Comment thread .github/scripts/run-benchmarks.sh Outdated
Comment thread scripts/bench-flamegraph.sh Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

polaz added 2 commits March 27, 2026 09:47
- add scenario-based Criterion matrix against C zstd

- generate benchmark JSON and markdown reports for CI

- document benchmark workflows and add flamegraph helper

Refs #24
@polaz polaz force-pushed the test/#24-comprehensive-benchmark-suite-against-c-zstd branch from b5733d5 to 3a419fa Compare March 27, 2026 07:58
- guard ratio reporting for zero-length inputs
- skip empty Silesia fixtures with BENCH_WARN
- use mktemp + trap for raw bench output parsing
- make flamegraph --root opt-in via BENCH_FLAMEGRAPH_USE_ROOT
@polaz polaz requested a review from Copilot March 27, 2026 09:49
@polaz
Copy link
Copy Markdown
Member Author

polaz commented Mar 27, 2026

@coderabbitai re-review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 27, 2026

@polaz Sure! I'll re-review the changes now.


🧠 Learnings used
Learnt from: CR
Repo: structured-world/structured-zstd PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T15:15:32.300Z
Learning: Applies to **/*.rs : Code must pass `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings` (excluding `rustc-dep-of-std` and `fuzz_exports` features)

Learnt from: polaz
Repo: structured-world/structured-zstd PR: 33
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T00:05:11.394Z
Learning: In structured-world/structured-zstd, the Clippy requirement is: `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings`. The `rustc-dep-of-std` feature is excluded (internal feature for Rust stdlib builds only) and `fuzz_exports` is excluded (fuzzing-specific entry points validated separately from the regular lint gate). The `--all-features` flag should NOT be used.
✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Comment thread scripts/bench-flamegraph.sh Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/bench-flamegraph.sh`:
- Around line 13-21: The script expands EXTRA_FLAMEGRAPH_ARGS directly in the
cargo flamegraph command which can trigger "unbound variable" on older Bash with
set -u; change the expansion to a safe guarded form such as
"${EXTRA_FLAMEGRAPH_ARGS[@]:-}" (or use the conditional expansion
"${EXTRA_FLAMEGRAPH_ARGS:+${EXTRA_FLAMEGRAPH_ARGS[@]}}") in the cargo flamegraph
invocation so the empty array won't cause an error; update the line that calls
cargo flamegraph (the command using EXTRA_FLAMEGRAPH_ARGS, and ensure
BENCH_FLAMEGRAPH_USE_ROOT/EXTRA_FLAMEGRAPH_ARGS logic remains unchanged).

In `@zstd/benches/compare_ffi.rs`:
- Around line 62-69: The benchmark currently allocates the target buffer inside
the iteration (vec![0u8; expected_len]) which skews pure decompression timing;
move the target buffer allocation outside the closure and reuse it inside the
"pure_rust" bench closure (create a mutable target Vec<u8> of size expected_len
before calling group.bench_function and then reset or zero its contents each
iteration before calling FrameDecoder::decode_all), keeping the decoder creation
inside the iteration if you want to measure decoder setup as well or moving that
out if you only want decode throughput; update the "pure_rust" bench closure
(where FrameDecoder::new() and target are used) to reference the pre-allocated
target to eliminate per-iteration allocation overhead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: afb75d4e-c9e5-423b-9ea6-2d51baa2a266

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca2e4e and 15a51bd.

📒 Files selected for processing (7)
  • .github/scripts/run-benchmarks.sh
  • .gitignore
  • BENCHMARKS.md
  • README.md
  • scripts/bench-flamegraph.sh
  • zstd/benches/compare_ffi.rs
  • zstd/benches/support/mod.rs

Comment thread scripts/bench-flamegraph.sh Outdated
Comment thread zstd/benches/compare_ffi.rs
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@zstd/benches/compare_ffi.rs`:
- Around line 62-77: The c_ffi benchmark allocates a new Vec each iteration via
zstd::decode_all, creating allocation asymmetry versus the pre-allocated buffer
used by FrameDecoder in the pure_rust bench; replace the c_ffi bench body to
decode into a pre-allocated buffer (mirror the pure_rust pattern) by creating a
target Vec<u8> of expected_len before b.iter and using zstd's streaming API
(e.g., zstd::stream::Decoder) with a Cursor<&mut [u8]> or equivalent
write-into-slice approach to reuse the buffer, or alternatively add a comment
clarifying that decode_all intentionally measures allocation+decode if you
prefer realistic usage; change the closure around group.bench_function("c_ffi",
...) and reference zstd::decode_all, zstd::stream::Decoder, and Cursor to
implement the chosen fix.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7da886e3-4fb4-4721-b5b0-00f3061549a4

📥 Commits

Reviewing files that changed from the base of the PR and between 15a51bd and 480a307.

📒 Files selected for processing (2)
  • scripts/bench-flamegraph.sh
  • zstd/benches/compare_ffi.rs

Comment thread zstd/benches/compare_ffi.rs
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@zstd/benches/compare_ffi.rs`:
- Around line 63-68: The benchmark loop is zeroing the entire output buffer each
iteration (target.fill(0)) which contaminates the measured decode time; remove
the redundant target.fill(0) call inside the b.iter closure so the measured work
is just FrameDecoder::new() + decoder.decode_all(&ffi_compressed, &mut target).
Keep the pre-allocated let mut target = vec![0u8; expected_len]; and preserve
the assert_eq!(written, expected_len) after decoder.decode_all to ensure full
writes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 094a9595-6f3b-41ae-99c5-0f1311999c4a

📥 Commits

Reviewing files that changed from the base of the PR and between 480a307 and 11f779b.

📒 Files selected for processing (1)
  • zstd/benches/compare_ffi.rs

Comment thread zstd/benches/compare_ffi.rs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Comment thread .github/scripts/run-benchmarks.sh Outdated
Comment thread .github/scripts/run-benchmarks.sh
Comment thread BENCHMARKS.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/scripts/run-benchmarks.sh:
- Around line 91-98: The table header labels the first column "Scenario" but the
loop is inserting row["label"], causing a mismatch and hiding stable scenario
IDs; update the for-loop that iterates over ratios (the block building lines
with f'| {row["label"]} ...') to use row["scenario"] for the first column
instead of row["label"] so the printed table matches the "Scenario" header and
exposes the stable scenario identifier.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a26751e4-7093-4815-9b51-944f156b7c9e

📥 Commits

Reviewing files that changed from the base of the PR and between 65cda3a and aa774de.

📒 Files selected for processing (2)
  • .github/scripts/run-benchmarks.sh
  • BENCHMARKS.md

Comment thread .github/scripts/run-benchmarks.sh Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Comment thread zstd/benches/compare_ffi.rs
Comment thread zstd/benches/compare_ffi.rs Outdated
polaz added 2 commits March 27, 2026 17:48
- include scenario id in ratio report markdown table

- reuse decoders and buffers in decompression benchmark loops

- keep throughput comparison focused on decode work

Refs #24
- compare metadata.len() against max size in u64 space

- derive Silesia scenario ids from full file names

- append stable numeric suffix on id collisions
@polaz
Copy link
Copy Markdown
Member Author

polaz commented Mar 28, 2026

@coderabbitai re-review

@polaz polaz requested a review from Copilot March 28, 2026 12:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

@polaz Sure! I'll kick off another full re-review of the changes now.


🧠 Learnings used
Learnt from: CR
Repo: structured-world/structured-zstd PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T15:15:32.300Z
Learning: Applies to **/*.rs : Code must pass `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings` (excluding `rustc-dep-of-std` and `fuzz_exports` features)

Learnt from: polaz
Repo: structured-world/structured-zstd PR: 33
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T00:05:11.394Z
Learning: In structured-world/structured-zstd, the Clippy requirement is: `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings`. The `rustc-dep-of-std` feature is excluded (internal feature for Rust stdlib builds only) and `fuzz_exports` is excluded (fuzzing-specific entry points validated separately from the regular lint gate). The `--all-features` flag should NOT be used.

Learnt from: CR
Repo: structured-world/structured-zstd PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T15:15:32.301Z
Learning: Avoid suggesting architectural changes that diverge too far from upstream, as this is a fork of ruzstd (KillingSpark/zstd-rs)
✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

@polaz
Copy link
Copy Markdown
Member Author

polaz commented Mar 28, 2026

@coderabbitai re-review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

@polaz Sure! I'll kick off a full re-review of the changes right away.


🧠 Learnings used
Learnt from: CR
Repo: structured-world/structured-zstd PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T15:15:32.300Z
Learning: Applies to **/*.rs : Code must pass `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings` (excluding `rustc-dep-of-std` and `fuzz_exports` features)

Learnt from: CR
Repo: structured-world/structured-zstd PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T15:15:32.301Z
Learning: Avoid suggesting architectural changes that diverge too far from upstream, as this is a fork of ruzstd (KillingSpark/zstd-rs)

Learnt from: polaz
Repo: structured-world/structured-zstd PR: 33
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-03-26T00:05:11.394Z
Learning: In structured-world/structured-zstd, the Clippy requirement is: `cargo clippy -p structured-zstd --features hash,std,dict_builder -- -D warnings`. The `rustc-dep-of-std` feature is excluded (internal feature for Rust stdlib builds only) and `fuzz_exports` is excluded (fuzzing-specific entry points validated separately from the regular lint gate). The `--all-features` flag should NOT be used.
✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/scripts/run-benchmarks.sh:
- Around line 54-57: The markdown_table_escape function currently only handles
backslashes, pipes and newlines; update markdown_table_escape to trim
leading/trailing whitespace and additionally escape other Markdown-sensitive
characters (at minimum: backticks `, square brackets [, ], asterisks *,
underscores _, angle brackets < and > and percent signs %) before returning
(still convert newlines to <br>); locate and update the markdown_table_escape
function to apply these replacements so benchmark labels render safely in
tables.

In `@zstd/benches/support/mod.rs`:
- Around line 318-331: The dedupe_scenario_id function currently uses an
unbounded loop that could hang if seen_ids fails to accept new entries; change
it to a bounded retry loop (e.g., set a MAX_SUFFIX constant like 1_000_000) and
iterate suffix from 2 up to MAX_SUFFIX, returning the first candidate inserted
into seen_ids; if no candidate is accepted by MAX_SUFFIX, handle the failure
deterministically (for example panic with a clear message or return a fallback
ID) so the function never loops indefinitely. Ensure you update the logic in
dedupe_scenario_id and reference/use seen_ids.insert(...) inside the bounded
loop.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b74de2e7-1a6b-4c8b-aae4-3a522dac7cb4

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca2e4e and 94f1c6d.

📒 Files selected for processing (8)
  • .github/scripts/run-benchmarks.sh
  • .gitignore
  • BENCHMARKS.md
  • README.md
  • scripts/bench-flamegraph.sh
  • zstd/Cargo.toml
  • zstd/benches/compare_ffi.rs
  • zstd/benches/support/mod.rs

Comment thread .github/scripts/run-benchmarks.sh
Comment thread zstd/benches/support/mod.rs
- expand markdown table escaping for benchmark labels

- bound scenario id suffix search and panic deterministically on exhaustion
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

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.

2 participants