Skip to content

test: add API conformance tests#346

Merged
maksymar merged 22 commits intomainfrom
maksym/api
Jun 17, 2025
Merged

test: add API conformance tests#346
maksymar merged 22 commits intomainfrom
maksym/api

Conversation

@maksymar
Copy link
Copy Markdown
Contributor

@maksymar maksymar commented Jun 16, 2025

This PR enhances test coverage by adding API conformance tests for key data structures such as Vec, MinHeap, BTreeSet, and BTreeMap while renaming the misleading iter_upper_bound method to iter_from_prev_key.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 16, 2025

canbench 🏋 (dir: ./benchmarks/vec) 39f3b77 2025-06-17 12:50:04 UTC

./benchmarks/vec/canbench_results.yml is up to date
📦 canbench_results_vec.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 16, 2025

canbench 🏋 (dir: ./benchmarks/compare) 39f3b77 2025-06-17 12:51:01 UTC

./benchmarks/compare/canbench_results.yml is up to date
📦 canbench_results_compare.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 16, 2025

canbench 🏋 (dir: ./benchmarks/btreeset) 39f3b77 2025-06-17 12:50:21 UTC

./benchmarks/btreeset/canbench_results.yml is up to date
📦 canbench_results_btreeset.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 16, 2025

canbench 🏋 (dir: ./benchmarks/btreemap) 39f3b77 2025-06-17 12:51:49 UTC

./benchmarks/btreemap/canbench_results.yml is up to date
📦 canbench_results_btreemap.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 16, 2025

canbench 🏋 (dir: ./benchmarks/memory_manager) 39f3b77 2025-06-17 12:50:02 UTC

./benchmarks/memory_manager/canbench_results.yml is up to date
📦 canbench_results_memory-manager.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@maksymar maksymar requested a review from Copilot June 17, 2025 08:02

This comment was marked as outdated.

@maksymar maksymar requested a review from Copilot June 17, 2025 08:18
Copy link
Copy Markdown
Contributor

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

This PR enhances test coverage by adding API conformance tests for key data structures such as Vec, MinHeap, BTreeSet, and BTreeMap while renaming the misleading iter_upper_bound method to iter_from_prev_key.

  • Adds a new module (api_conformance) with tests verifying the consistency of behavior between stable implementations and the standard library.
  • Renames and deprecates iter_upper_bound in favor of the more descriptive iter_from_prev_key, with corresponding test updates.

Reviewed Changes

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

Show a summary per file
File Description
src/lib.rs Reorders module exports and adds the api_conformance module for tests.
src/btreeset/proptests.rs Removes outdated iter_upper_bound tests in favor of the new method.
src/btreemap/proptests.rs Renames and updates tests to use iter_from_prev_key instead of iter_upper_bound.
src/btreemap.rs Introduces iter_from_prev_key and deprecates iter_upper_bound with updated docs.
src/api_conformance/* Adds new tests for Vec, MinHeap, BTreeSet, and BTreeMap for API conformance.
Comments suppressed due to low confidence (3)

src/lib.rs:29

  • [nitpick] Consider adding an inline comment to explain the rationale for reordering the module exports, which can help future maintainers understand the changes.
pub use log::{Log as StableLog, Log};

src/btreeset/proptests.rs:69

  • The removal of the iter_upper_bound test is noted; please ensure that the new iter_from_prev_key tests fully cover all necessary edge cases previously handled by this test.
-fn set_upper_bound_iter(#[strategy(pvec(0u64..u64::MAX - 1, 10..100))] keys: Vec<u64>) {

src/btreemap.rs:1213

  • The deprecation note is clear; consider updating the module-level documentation to explicitly mention the renaming and migration path from iter_upper_bound to iter_from_prev_key for improved clarity.
#[deprecated(note = "use `iter_from_prev_key` instead")]

Comment thread src/api_conformance/min_heap.rs Outdated
Comment thread src/btreeset.rs
@maksymar maksymar marked this pull request as ready for review June 17, 2025 08:46
@maksymar maksymar requested a review from a team as a code owner June 17, 2025 08:46
Copy link
Copy Markdown
Contributor

@adambratschikaye adambratschikaye left a comment

Choose a reason for hiding this comment

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

Would we also want to consider adding some property tests using quickcheck? We could generate a random sequence of operations and assert that they behave the same on both structures.

Comment thread src/lib.rs Outdated
@maksymar
Copy link
Copy Markdown
Contributor Author

Would we also want to consider adding some property tests using quickcheck? We could generate a random sequence of operations and assert that they behave the same on both structures.

I made a note to myself, thank you!

@maksymar maksymar enabled auto-merge (squash) June 17, 2025 12:44
@maksymar maksymar merged commit 08b8fbc into main Jun 17, 2025
15 checks passed
@maksymar maksymar deleted the maksym/api branch June 17, 2025 12:53
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.

3 participants