Skip to content

Add a basic loom test#845

Closed
ibraheemdev wants to merge 3 commits intosalsa-rs:masterfrom
ibraheemdev:ibraheem/loom-tests
Closed

Add a basic loom test#845
ibraheemdev wants to merge 3 commits intosalsa-rs:masterfrom
ibraheemdev:ibraheem/loom-tests

Conversation

@ibraheemdev
Copy link
Member

Fixes a couple issues when running under loom and adds a basic concurrency test. Unfortunately, this test is still very slow (it ran for >45 minutes and >20M iterations before I killed it on my machine), so I didn't add it to CI yet. It will probably only be practical for us to run very fine-grained unit tests under loom, or switch to something like shuttle for larger tests.

@netlify
Copy link

netlify bot commented May 6, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 0eadfaa
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/681bd1601df56400086776e1

@codspeed-hq
Copy link

codspeed-hq bot commented May 6, 2025

CodSpeed Performance Report

Merging #845 will not alter performance

Comparing ibraheemdev:ibraheem/loom-tests (0eadfaa) with master (cfa88e9)

Summary

✅ 12 untouched benchmarks

@MichaReiser MichaReiser closed this May 7, 2025
@MichaReiser MichaReiser reopened this May 7, 2025
@MichaReiser
Copy link
Contributor

It might be a flake but any idea why the benchmarks are regressing

@ibraheemdev ibraheemdev force-pushed the ibraheem/loom-tests branch from 25abf27 to 0eadfaa Compare May 7, 2025 21:32
@ibraheemdev
Copy link
Member Author

It seems like a flake. It's possible that the compiler isn't inlining the assume_init_ref calls but that seems unlikely.

Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

I don't understand much of loom but this looks reasonable.

The fact that not even the most simple tests complete in reasonable time makes me question the value of loom and whether it is worth the complexity (and indirection) it introduces.

What do you think?

@davidbarsky
Copy link
Contributor

I mean, if Loom takes too long to run, then we should be using Shuttle instead. It's not an exhaustive test, but it's a massive step up over the current state of affairs.

Comment on lines +372 to +376
let data: Box<PageData<T>> = (0..PAGE_LEN)
.map(|_| UnsafeCell::new(MaybeUninit::uninit()))
.collect::<Vec<PageDataEntry<T>>>()
.try_into()
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

This might even be desired for non-loom to avoid stack allocations in debug builds

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