Skip to content

D216: a contract states a polled tagged message; the program iterates it as an open sum (closes #2425) - #3631

Merged
ehartford merged 13 commits into
mainfrom
d216-message
Nov 26, 2026
Merged

ehartford merged 13 commits into
mainfrom
d216-message

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #2425. D216 (Eric, 2026-11-18); the words (§16.2b.9a, spec v7.93) blessed by him on 2026-11-25 with five edits, the guard for the no-resource case and its sentence approved the same day.

The item. message Name wraps Record with from f(out param N), tag F, case K when CONST [..CONST] [field f | : T], and for the pointer form payload P size N and release f. Verified against the import; 22 wrong contracts each get one error naming the line.

What it presents. An ephemeral open sum Name with the stated cases and Other(tag), and Name.poll(…), iterated with for. A match on it keeps a _ arm. A typed pointer case is entered only when the pointer is non-null, large enough and aligned. release runs after each body, an early break included.

Safety of release messages.

Three compiler changes this needed.

Tests. behav_d216_message_{union,pointer,nested_poll_panics,poll_from_two_threads_panics,poll_borrows_its_resource}, 24 err_d216_*.

Stated gaps (in the subsection itself). The poll is presented without thread affinity. Steam itself was not tried: its SDK is not a with get package; the pointer form is tested against a header of the same shape, and the union form against SDL 3.4.16.

Evidence. Battery GREEN on f749736; :release-checks, the full census and :spec-inventory-check green on the same commit.

Eric Hartford added 13 commits November 26, 2026 05:17
…fuses it by name until it is verified and presented
…mport; refused by name until it is presented
… parameters, and release after each body
… wildcard arm), and an Other arm that compares with a named constant is warned
…ource refuses a nested poll with a panic
…ed contract text reaches the standard library without giving the program a name
…producer receives mut; a static method's mut first parameter is not a receiver. The borrow is not yet held across the loop (#3624): err_d216_poll_holds_its_resource does not pass
@ehartford
ehartford enabled auto-merge (squash) November 26, 2026 11:28
@ehartford
ehartford merged commit 598bb23 into main Nov 26, 2026
1 check passed
@ehartford
ehartford deleted the d216-message branch November 26, 2026 11:29
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.

Modeled C: no facade form for a polled tagged message (Steam ManualDispatch, SDL_PollEvent): the payload read stays unsafe

1 participant