Repository navigation
D198 (§16.2b.5): value records in a written facade — reads, fills, updates param N - #3215
Merged
Merged
Conversation
added 3 commits
November 9, 2026 21:20
…acade
Spec v7.43 'Value records': a pointer parameter to one complete record
that is not a resource's representation is described by what the callee
does with the record. The facade grammar reads `reads`, `fills` and
`updates param N`; the checker requires a pointer to one complete
record, refuses a resource's representation, a const pointer under
`fills`/`updates`, a record that is not zero-valid under `fills`, and a
parameter described twice; a described parameter is reached through the
presented rendering alone, as a buffer is. The renderer presents a
`reads` parameter as a `&T` argument and an `updates` parameter as a
`mut` parameter (D172) whose place the callee writes. `fills` is parsed
and checked; its rendering is the next layer.
Fixtures: behav_d198_value_record_reads_updates;
err_d198_value_record_{not_a_record,updates_const,twice}.
…ords are one clause kind `fills param N`: the parameter leaves the list, With passes `T.zeroed()`, and the record joins what the operation presents under §16.2b.4's status rule: the record alone when C returns nothing, `(status, T)` when the status is uninterpreted (no `ok`), `Result[T, E]` under one `ok` constant, `Result[(status, T), E]` under several. The three words are one clause kind (FACADE_CLAUSE_VALUE_RECORD) whose second operand is the word, so the clause table grows by one member, granted in build/ceremony-allowances.tsv: the table is an existing numbered-constant run with four readers. Fixture: behav_d198_value_record_fills (all three result shapes).
…ffer or a resource's representation is no value record `nullable param N` beside `reads param N` presents `Option[&T]`, None crossing as NULL. A parameter a buffer clause pairs with a count is refused under a value-record clause, in either order, and so is a pointer to a resource's representation (the operation borrows that resource). Fixtures: behav_d198_value_record_nullable_reads; err_d198_value_record_is_a_buffer, err_d198_value_record_is_a_resource.
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.
Implements the written-facade half of spec v7.43's 'Value records' (D198, #3173). Three commits.
reads param Npresents a&Targument; besidenullable param N,Option[&T].updates param Npresents amutparameter (D172) whose place the callee writes.fills param N: the parameter leaves the list,T.zeroed()is passed, and the record joins the result under §16.2b.4's status rule (T;(status, T)withoutok;Result[T, E]with oneok;Result[(status, T), E]with several).fills/updates; described twice; a buffer-paired parameter, in either order.Not in this PR: the drafter writing these clauses from proofs (so
with getdoes not use them yet), and the contract view's rows for the clause.Fixtures: behav_d198_value_record_{reads_updates,fills,nullable_reads}; err_d198_value_record_{not_a_record,updates_const,twice,is_a_buffer,is_a_resource}.
Battery GREEN on 8324183 (
with run tools/battery.win ~/.local/with-staging/vrec, wall 532 s after a green gate; GREEN BATTERY_DONE). An earlier gate on this branch was red on the typed census (one explicit&at a&Tparameter), fixed in the last commit.