Repository navigation
docs: ratify Atomic<T> domain-qualified resident bounds - #8605
Merged
Merged
Conversation
Record the owner ruling that standing bounds on an atomic cell's resident value belong on a domain-qualified value type `Atomic<T>` (such as `Atomic<u32 in AtMost<100>>`) rather than on a `data requires` scalar predicate over an atomic field. This closes Question #1 in `OWNER_QUESTIONS.md`, renumbers the remaining three questions to #1–#3, updates `concurrency.md` and `data_and_literals.md`, and adds `ATOMIC-DOMAIN-RESIDENT` in `TASKS.md`. [Atomic operations](wiki/spec/language/concurrency.md#atomic-operations) now specifies `Atomic<T>` over admitted hardware atomic scalar carriers (`bool`, `i8`–`i64`, `u8`–`u64`, optionally domain-qualified `T in D`), keeping `AtomicBool`, `AtomicI8`–`AtomicI64`, and `AtomicU8`–`AtomicU64` as unqualified shorthands and rejecting non-hardware widths (`u23`, `u69`) and non-atomic types. Zero-initialization, `store`, `swap`, `compare_exchange`, and RMW `fetch_*` enforce `T`'s domain (with `fetch_*` proving the post-state remains in `T`'s domain for every prior `old: T`), `load` and prior-value returns preserve `T`'s domain, and borrowing an atomic field yields `@Atomic<T>` so callees cannot bypass the bound through an unconstrained `@AtomicU32`. [Data and literals](wiki/spec/language/data_and_literals.md) records that scalar `data requires` predicates written directly against atomic cell fields reject as ill-typed. `TASKS.md` tracks the implementation and rewriting the 38 `atomic_bounded_fetch` / `atomic_bounded_resident` samples under `ATOMIC-DOMAIN-RESIDENT`. Validation: `mbx xtask check-rules --base origin/main --title "docs: ratify Atomic<T> domain-qualified resident bounds" --body-file ...` (clean); docs-only change, no Rust source modified. Agent: Antigravity | Model: Gemini 4 Neon | Effort: high | Tokens: 1.05M in (1.04M cached), 7.3k out | Steps: 3 | Time: 1m25s | Steers: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Record the owner ruling that standing bounds on an atomic cell's resident value belong on a domain-qualified value type
Atomic<T>(such asAtomic<u32 in AtMost<100>>) rather than on adata requiresscalar predicate over an atomic field. This closes Question #1 inOWNER_QUESTIONS.md, renumbers the remaining three questions to #1–#3, updatesconcurrency.mdanddata_and_literals.md, and addsATOMIC-DOMAIN-RESIDENTinTASKS.md.Atomic operations now specifies
Atomic<T>over admitted hardware atomic scalar carriers (bool,i8–i64,u8–u64, optionally domain-qualifiedT in D), keepingAtomicBool,AtomicI8–AtomicI64, andAtomicU8–AtomicU64as unqualified shorthands and rejecting non-hardware widths (u23,u69) and non-atomic types. Zero-initialization,store,swap,compare_exchange, and RMWfetch_*enforceT's domain (withfetch_*proving the post-state remains inT's domain for every priorold: T),loadand prior-value returns preserveT's domain, and borrowing an atomic field yields@Atomic<T>so callees cannot bypass the bound through an unconstrained@AtomicU32. Data and literals records that scalardata requirespredicates written directly against atomic cell fields reject as ill-typed.TASKS.mdtracks the implementation and rewriting the 38atomic_bounded_fetch/atomic_bounded_residentsamples underATOMIC-DOMAIN-RESIDENT.Validation:
mbx xtask check-rules --base origin/main --title "docs: ratify Atomic<T> domain-qualified resident bounds" --body-file ...(clean); docs-only change, no Rust source modified.Agent: Antigravity | Model: Gemini 4 Neon | Effort: high | Tokens: 1.05M in (1.04M cached), 7.3k out | Steps: 3 | Time: 1m25s | Steers: 0