Skip to content

WIP: Weak memory support#487

Draft
hiroki-chen wants to merge 25 commits into
asterinas:mainfrom
hiroki-chen:weak-memory
Draft

WIP: Weak memory support#487
hiroki-chen wants to merge 25 commits into
asterinas:mainfrom
hiroki-chen:weak-memory

Conversation

@hiroki-chen

@hiroki-chen hiroki-chen commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Ok so the weak memory has been started, and this serves as the triage PR for this feature. The core idea behind this implementation to encode message histories (parameterized by the timerstamp token) for each memory location as ghost states in the concurrent separation logic which allows the caller to open the invariant and obtain the handle to the underlying data.

Basically, the roadmap includes:

  • Modelling the "weak" part (i.e., memory ordering) of the atomic operations. This includes adding new atomic wrapper types from the Rust std library and stopping using the vstd's atomic types at all (since they assume SC).
  • Introduce idomatic macros, types, and interfaces for proving around our customized atomic types.
  • Use the atomic types to prove the RCU reclamation as well as the traversal security properties.
  • Add several examples.

@hiroki-chen hiroki-chen self-assigned this Jun 1, 2026
@hiroki-chen hiroki-chen added enhancement New general lemmas in vstd_extra, or new tooling features model design Model or specification of system design exec code Proofs about execution code labels Jun 1, 2026
@hiroki-chen

Copy link
Copy Markdown
Collaborator Author

Reference https://dl.acm.org/doi/pdf/10.1145/3729246 and https://dl.acm.org/doi/pdf/10.1145/3591297

There is no need to model the full C11 semantics (they are even flawed) so we just do an in-order spec.

@hiroki-chen

Copy link
Copy Markdown
Collaborator Author

Just done the low-level primitives so that we can model the atomic operations for the weak memory model.

@rikosellic

Copy link
Copy Markdown
Collaborator

This will be a huge win if it is correct. I've not read the paper in detail yet, so I'm afraid I will not have enough knowledge to review this PR until next week.

@hiroki-chen

Copy link
Copy Markdown
Collaborator Author

This will be a huge win if it is correct. I've not read the paper in detail yet, so I'm afraid I will not have enough knowledge to review this PR until next week.

No worries; the core idea is rather simple. I'll keep you updated.

This comment was marked as low quality.

@hiroki-chen

Copy link
Copy Markdown
Collaborator Author

/ci-upstream-verus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New general lemmas in vstd_extra, or new tooling features exec code Proofs about execution code model design Model or specification of system design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants