Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loom model checking #1

Closed
loyd opened this issue Apr 21, 2024 · 6 comments
Closed

Loom model checking #1

loyd opened this issue Apr 21, 2024 · 6 comments
Assignees

Comments

@loyd
Copy link

loyd commented Apr 21, 2024

The original issue

@changgyoopark-db
Copy link
Collaborator

Added a real loom test - more to be added later.

@loyd
Copy link
Author

loyd commented Jul 17, 2024

It's very cool. I mocked AtomicShared: https://github.com/loyd/idr-ebr/blob/238098efb4e480f690e40822f76ab8a66377c304/src/loom.rs#L34-L44 to run under the loom.

Can you use the dedicated cfg(sdd_loom) instead (or in addition to) cfg(loom) to allow enabled/disabled in dependent optionally?

@loyd
Copy link
Author

loyd commented Jul 17, 2024

Oh, I see, AtomicShared doesn't use loom::AtomicPtr, so it's not completed yet, so I'm not sure the issue should be closed for now. Anyway, thanks for the initiative

@loyd
Copy link
Author

loyd commented Jul 17, 2024

Note also that it will most likely require loom as the dependency instead of dev-dependency, which can lead to preserving users' Cargo.lock files. It can be fixed in the same way as crossbeam-rs/crossbeam#666

@wvwwvwwv
Copy link
Owner

@loyd Thanks for the ideas. I’ll reopen this as the current set of tests is far from complete.

@wvwwvwwv wvwwvwwv reopened this Jul 17, 2024
wvwwvwwv added a commit that referenced this issue Jul 17, 2024
wvwwvwwv added a commit that referenced this issue Jul 18, 2024
wvwwvwwv added a commit that referenced this issue Jul 18, 2024
@wvwwvwwv
Copy link
Owner

I found the way crossbeam_epoch did to support loom testing a bit dirty, so I just added the loom feature (cfg(feature = "loom")) without relying on an extra cfg parameter. it will still be possible to conditionally activate loom types only during a test by using cfg(test), but I never tested this -> if it is not possible, please let me know, then I'll add an additional cfg gate.

-> SDD 1.7.0

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

No branches or pull requests

3 participants