Skip to content

lean: Prove KV model deadlock freedom - #8798

Merged
Heidi Howard (heidihoward) merged 4 commits into
microsoft:mainfrom
heidihoward:agents/add-deadlock-free-kv-model
Nov 18, 2026
Merged

Heidi Howard (heidihoward) merged 4 commits into
microsoft:mainfrom
heidihoward:agents/add-deadlock-free-kv-model

Conversation

@heidihoward

@heidihoward Heidi Howard (heidihoward) commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Builds on #8762, now merged.

  • Add Kv.Properties.deadlock_free using the shared CCF.TransitionSystem.DeadlockFree definition, with an adjacent reachable-state witness.
  • Machine-check the proof independently of trace validation and include it in the package import root.
  • Add Lean agent guidance requiring infinite-state models to place deadlock freedom and its witness at the end of Properties.lean.
  • Document that enabled stutters are permitted; this is not a fairness or eventual-commit guarantee for individual transactions.

The proof creates store 0 when absent, or compacts it when present. No model transitions or runtime behavior change.

Validation

Passed locally from lean/kv:

  • lake build --wfail --fail-fast (including replay self-tests)
  • lake check --inadvisably-no-sandbox (kernel accepted; only propext, Quot.sound, and Classical.choice)
  • lake exe check-imports
  • lake build CCF
  • lake lint
  • lake exe runLinter --no-build CCF Kv replayer.Main
  • ./replayer/check-fixtures.sh (72/72 fixtures)

Lean and Markdown formatting, ASCII policy, documentation prose, copyright, disallowed-comment, and whitespace checks passed.
Full scripts/ci-checks.sh was not run because uv/uvx and CMake are unavailable.

The follow-up agent-guidance change is documentation-only; Markdown formatting, prose, ASCII, and whitespace checks passed.

@heidihoward
Heidi Howard (heidihoward) requested a review from a team as a code owner November 18, 2026 14:30
Copilot AI balanced review requested due to automatic review settings November 18, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the standalone KV deadlock-freedom proof.

No open issues 🎉

What changed in this PR

Adds a machine-checked deadlock-freedom proof for the standalone KV model established in #8762, without changing model transitions or runtime behavior.

Changes:

  • Proves an enabled action exists by creating store 0 when absent or compacting it when present.
  • Exposes the theorem and reachable-state witness through the properties catalogue and package imports.
  • Clarifies that enabled stutters are permitted; fairness and eventual transaction commits are not guaranteed.

Custom instructions used

Applied the CCF repository guidance supplied in the review context; no additional instruction files were loaded.

File Description
lean/​kv/​README.md Documents deadlock freedom and its limitations.
lean/​kv/​Kv/​Properties.lean Exposes the theorem and reachable-state witness.
lean/​kv/​Kv/​Proofs/​Deadlock.lean Implements the proof independently of trace validation.
lean/​kv/​Kv.lean Includes the proof module in the package import root.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The deadlock-freedom theorem and witness precede the safety catalogue in Properties.lean, contrary to the documented requirement that they appear at the end.

1 open issue

Review effort: Balanced

Comment thread lean/kv/Kv/Properties.lean Resolved
Copilot AI balanced review requested due to automatic review settings November 18, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The deadlock-freedom section and its witness precede the safety catalogue instead of appearing at the end of Properties.lean as required by the guidance added in this PR.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the standalone KV deadlock-freedom proof and its public exports.

No open issues 🎉

Review effort: Balanced

@heidihoward
Heidi Howard (heidihoward) added this pull request to the merge queue Nov 18, 2026
Merged via the queue into microsoft:main with commit 5a9e79d Nov 18, 2026
26 checks passed
@heidihoward
Heidi Howard (heidihoward) deleted the agents/add-deadlock-free-kv-model branch November 18, 2026 16:12
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