Skip to content

feat: Strengthen rt-ring testing with overwrite, concurrency, and loom checks - #2

Merged
hasanzakeri merged 1 commit into
mainfrom
feat/additional-tests
Mar 12, 2026
Merged

hasanzakeri merged 1 commit into
mainfrom
feat/additional-tests

Conversation

@hasanzakeri

Copy link
Copy Markdown
Owner

Summary

  • Add stronger cross-thread tests in tests/concurrent.rs:
    • steady_state_no_overwrite_when_consumer_keeps_up proves no drops and zero overwrites when producer/consumer are in lockstep.
    • available_never_exceeds_capacity_under_pressure stress-tests a fast producer/slow consumer and asserts monotonic pops, available() <= capacity, and overwrites + popped == pushed.
  • Tighten overwrite semantics and accounting in tests/overwrite.rs:
    • long_run_overwrite_accounting_and_tail_integrity pushes far beyond capacity and checks that only the last capacity items remain and overwrite_count is exact.
    • mixed_push_slice_pop_slice_matches_reference_and_overwrite_count interleaves push_slice/pop_slice with a VecDeque reference model and validates both ordering and overwrite counts.
  • Extend property testing in tests/proptest.rs:
    tracks_available_and_overwrites_correctly keeps a reference queue in sync and asserts after every operation that available() and overwrite_count() match the model.
  • Introduce optional loom model checks in tests/loom_spsc.rs:
    • Gated behind the loom-tests feature.
    • loom_small_interleavings_accounting_and_order and loom_capacity_one_keeps_latest_value explore small-state interleavings and assert monotonic order plus popped + overwrites == pushed.
  • Wire loom into the build tooling:
    • Add a loom-tests feature in Cargo.toml.
      Add a test-loom target to Makefile that runs cargo test --features loom-tests --test loom_spsc via Docker.

Test plan

  • make test
  • make test-loom
  • (CI) cargo miri test still exercises the existing tests, including the new property and concurrency cases.

@hasanzakeri
hasanzakeri merged commit 18a860b into main Mar 12, 2026
4 checks passed
@hasanzakeri
hasanzakeri deleted the feat/additional-tests branch March 12, 2026 03:55
hasanzakeri added a commit that referenced this pull request Oct 8, 2026
…m checks (#2)

## Summary

- **Add stronger cross-thread tests** in tests/concurrent.rs:
- `steady_state_no_overwrite_when_consumer_keeps_up` proves no drops and
zero overwrites when producer/consumer are in lockstep.
- `available_never_exceeds_capacity_under_pressure` stress-tests a fast
producer/slow consumer and asserts monotonic pops, `available() <=
capacity`, and `overwrites + popped == pushed`.
- **Tighten overwrite semantics and accounting** in
`tests/overwrite.rs`:
- `long_run_overwrite_accounting_and_tail_integrity` pushes far beyond
capacity and checks that only the last capacity items remain and
`overwrite_count` is exact.
- `mixed_push_slice_pop_slice_matches_reference_and_overwrite_count`
interleaves `push_slice/pop_slice` with a `VecDeque` reference model and
validates both ordering and overwrite counts.
- **Extend property testing** in tests/proptest.rs:
tracks_available_and_overwrites_correctly keeps a reference queue in
sync and asserts after every operation that available() and
overwrite_count() match the model.
- Introduce optional loom model checks in `tests/loom_spsc.rs`:
  - Gated behind the `loom-tests` feature.
- `loom_small_interleavings_accounting_and_order` and
`loom_capacity_one_keeps_latest_value` explore small-state interleavings
and assert monotonic order plus `popped + overwrites == pushed`.
- Wire loom into the build tooling:
  - Add a `loom-tests` feature in `Cargo.toml`.
Add a `test-loom` target to `Makefile` that runs `cargo test --features
loom-tests --test loom_spsc` via Docker.

## Test plan

- make test
- make test-loom
- (CI) `cargo miri test` still exercises the existing tests, including
the new property and concurrency cases.
hasanzakeri added a commit that referenced this pull request Oct 8, 2026
…m checks (#2)

## Summary

- **Add stronger cross-thread tests** in tests/concurrent.rs:
- `steady_state_no_overwrite_when_consumer_keeps_up` proves no drops and
zero overwrites when producer/consumer are in lockstep.
- `available_never_exceeds_capacity_under_pressure` stress-tests a fast
producer/slow consumer and asserts monotonic pops, `available() <=
capacity`, and `overwrites + popped == pushed`.
- **Tighten overwrite semantics and accounting** in
`tests/overwrite.rs`:
- `long_run_overwrite_accounting_and_tail_integrity` pushes far beyond
capacity and checks that only the last capacity items remain and
`overwrite_count` is exact.
- `mixed_push_slice_pop_slice_matches_reference_and_overwrite_count`
interleaves `push_slice/pop_slice` with a `VecDeque` reference model and
validates both ordering and overwrite counts.
- **Extend property testing** in tests/proptest.rs:
tracks_available_and_overwrites_correctly keeps a reference queue in
sync and asserts after every operation that available() and
overwrite_count() match the model.
- Introduce optional loom model checks in `tests/loom_spsc.rs`:
  - Gated behind the `loom-tests` feature.
- `loom_small_interleavings_accounting_and_order` and
`loom_capacity_one_keeps_latest_value` explore small-state interleavings
and assert monotonic order plus `popped + overwrites == pushed`.
- Wire loom into the build tooling:
  - Add a `loom-tests` feature in `Cargo.toml`.
Add a `test-loom` target to `Makefile` that runs `cargo test --features
loom-tests --test loom_spsc` via Docker.

## Test plan

- make test
- make test-loom
- (CI) `cargo miri test` still exercises the existing tests, including
the new property and concurrency cases.
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