Repository navigation
migrate --facade: D121 step 2, the facade proof engine over a package's C source - #2420
Merged
Merged
Conversation
…own C source and drafts the facade (D121 step 2, §16.2b.15). The migrator's body walkers record where every returned pointer comes from and what becomes of each parameter and local (CImport.w ci_body_ownership_evidence, beside D107's); CiFacadeDraft.w draws the corpus fixed point: retention (field, global, or a callee that retains; an outside callee retains unless it is a libc observer), destruction (free, a global the package initializes to free, or a package destroyer at its destroyed position), then returns (owned when every path returns a fresh allocation never retained, directly, through a local or a package producer; a borrow when every path returns a part of one parameter, directly or through a package borrow). No name enters a verdict. The draft pairs each pointer-to-record representation's producers with its one unary destroyer, states every proven borrow and lend with its proof, and the report names every function's presentation or the reason it stays raw; several unary destroyers, or a borrowed type with several origin types (§16.2b.6), are reported for the registry, never guessed. A C-style cast to a named type has a type-reference child, which the ownership walker peels; a local assigned only a parameter stands for it (gzclose's state). Selfhost test migrate-facade-by-evidence: a two-unit library, every proof shape, the draft compiled against its header. D133 records the spellings (delegated).
Contributor
Author
|
Battery on 48002b2 under the pinned seed Engine measured on zlib 1.3.2's library units: 108 declared functions, 15 presented safely, 93 raw with reasons; |
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.
D121 step 2 (§16.2b.15):
with migrate --facade NAME <dir|file.c>proves a package's ownership facts from its own bodies and drafts the facade; no name enters any verdict.CImport.wci_body_ownership_evidence(beside D107's walkers) records where every returned pointer comes from and what becomes of each parameter and local.src/CiFacadeDraft.w: the corpus fixed point, in dependency order: retention, destruction, returns (owned / borrow from param). The draft pairs each pointer-to-record representation's producers with its one unary destroyer, states every proven borrow and lend with its proof; the report names every declared function's presentation or why it stays raw. Several unary destroyers, or a borrowed type with several origin types (§16.2b.6), are reported for the registry, never picked.gzclose); retention is a pointer-parameter fact; a facade names only prototyped functions.migrate-facade-by-evidence(build/selfhost.w): a two-unit library with every proof shape; the draft is compiled against its header.with-migrate-spec.md"Usage"; D121's status; D133 (delegated) for the spellings.Measured on zlib 1.3.2's library units: 108 declared functions, 15 safe;
gzopenowned,gzclosea destroyer; the three unary destroyers ofgzFile_sgo to the registry.Battery: pending.