Repository navigation
Conversation
lock and unlock accepted an operand of any type, and nothing checked an op against the call it stands for: a wrong fallback_impl surfaced only when the lowered call failed to verify or link, if it did at all. Now lock and unlock take a !wtc.mutex. Push checks that the value it passes refers to the queue's element type; pop does the same for a pointer result, and delivers its value exactly one way, as its result or through result_slot. Each op checks that fallback_impl names a cir.func implementing the same operation -- the shim's annotation, or a substitute's wtc_impl_<name>_<operation> -- that takes the arguments lowering will pass. Each op declares that it reads and writes memory. That is the mechanical part. What the ops promise about ordering and progress is a design question, so decisions/0003 proposes an answer for discussion rather than implementing one. Verified: 17 of 17 pass, no warnings. The seven invalid cases are all accepted silently by the parent commit. The prototype's example, lifted for AArch64 and for x86-64, verifies under the new rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
99d62be to
ad2187d
Compare
b98246d to
9d20b82
Compare
|
Closing because the substance of this PR is in #10, under your authorship: |
Stacked on #4 (
feat/queue-kind-in-ir).What this changes
The mechanical part of "the dialect carries no semantics":
lock/unlocktake a!wtc.mutexinstead of any type.result_slot).fallback_implnames acir.funcimplementing the same operation (the shim's annotation, or a substitute'swtc_impl_<name>_<operation>) with the arity lowering will pass.What the ops promise about ordering and progress is a design question, so
decisions/0003-concurrency-semantics-of-the-wtc-ops.mdproposes an answer for discussion; nothing in it is implemented. Your view on it is the main thing I'd like from this PR.How it was checked
27 of 27 pass, no warnings. The seven cases in
test/Dialect/invalid.mlirare all accepted silently by the parent. The prototype's example, lifted for both targets, verifies under the new rules.Checklist
🤖 Generated with Claude Code