Skip to content

cpp2w: exclude NORETURN from tecotsb target endpoint#9

Closed
lukeg101 wants to merge 1 commit into
gonzalobg:mainfrom
lukeg101:store-add-tecotsb-noreturn
Closed

cpp2w: exclude NORETURN from tecotsb target endpoint#9
lukeg101 wants to merge 1 commit into
gonzalobg:mainfrom
lukeg101:store-add-tecotsb-noreturn

Conversation

@lukeg101

Copy link
Copy Markdown

Models the non-returning atomic reduction atomic_store_add_explicit from P3111R0 (Atomic Reduction Operations):
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3111r0.html

A non-returning RMW (tagged NORETURN) should not anchor the tecotsb ordering edge the way a value-returning RMW does. Excluding NORETURN from the target [A] endpoint lets a release store_add not establish message-passing synchronization, so the stale-read outcome {r0=0, y=2} becomes observable.

Adds tests/mp/mp-store-add.litmus and mp-fetch-add.litmus: under the patched cpp2w, store_add -> 4 states (incl. {r0=0,y=2}); fetch_add -> 3 states (forbids it).

The other models (cpp11, cpp17, rc11, rc17) already support store_add (same 4-state weak behaviour); they have no tecotsb relation, so a non-returning RMW never over-synchronizes there. cpp2w was the sole outlier.

herd7 does not support store_add (its CSem is a stub), so no .litmus.expected can be generated; reproduced/validated with dartagnan (Dat3M exploration_mode branch, commit b360545), see
hernanponcedeleon/Dat3M#984.

Models the non-returning atomic reduction atomic_store_add_explicit from
P3111R0 (Atomic Reduction Operations):
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3111r0.html

A non-returning RMW (tagged NORETURN) should not anchor the tecotsb
ordering edge the way a value-returning RMW does. Excluding NORETURN from the
target [A] endpoint lets a release store_add not establish message-passing
synchronization, so the stale-read outcome {r0=0, y=2} becomes observable.

Adds tests/mp/mp-store-add.litmus and mp-fetch-add.litmus: under the
patched cpp2w, store_add -> 4 states (incl. {r0=0,y=2}); fetch_add -> 3 states
(forbids it).

The other models (cpp11, cpp17, rc11, rc17) already support store_add
(same 4-state weak behaviour); they have no tecotsb relation, so a non-returning
RMW never over-synchronizes there. cpp2w was the sole outlier.

herd7 does not support store_add (its CSem is a stub), so no
.litmus.expected can be generated; reproduced/validated with dartagnan (Dat3M
exploration_mode branch, commit b360545), see
hernanponcedeleon/Dat3M#984.

Co-authored-by: Hernan Ponce de Leon <hernanl.leon@huawei.com>
@lukeg101

Copy link
Copy Markdown
Author

Discussed with Simon and Gonzalo, cpp2w is already too strong, cpp17 correctly models store_add using Dartagnan already. so I will close this PR, add the tests from this PR to PR #8, and use cpp17 for testing

@lukeg101 lukeg101 closed this Jun 12, 2026
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