You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Facade proof: retention 'passed to a callee no unit defines' (996 functions, 15 libraries): a static inline, macro-generated or other-unit callee ends the trail as unproven #3174
Part of #3115; cluster from the #3116 survey: 'retains a parameter, passed to a callee no unit defines; not proven', 996 functions in 15 libraries (glfw's platform dispatch setWindowTitle, zlib inflateBack's callbacks, …). Also 'a chain of calls too deep to follow' (47 functions, 6 libraries). The proof should say which callee and why it is undefined (a function pointer field, a platform file not configured, a depth limit) so the registry fact can be written; and dispatch through a struct of function pointers to a configured backend is a resolvable case.
The dispatch shape is said honestly since #3202 (main 61b5199): a parameter passed through a function-pointer field reads 'passed through the function pointer field X, which no unit decides' (glfw's platform dispatch), and a field named free/malloc is no longer taken for the libc call (Law 4). What remains: a registry convention for dispatch tables, and the 47 'chain of calls too deep to follow' functions.
#3418 merged: a retained parameter's chain of calls is followed to the store that ends it, so the 47 "too deep to follow" functions now name where the value ends up. With #3202 (dispatch through a function-pointer field is said as such), what is left here is the registry convention for dispatch tables: how a registry states which functions a table's field may hold. That is contract-language design, so it waits on Eric.
Brief: a call through a function-pointer field the package fills itself (#3174, #3206 shape 1)
The question._glfw.platform.setWindowTitle(window, title) calls through a field. Today the proof stops: "passed through the function pointer field X, which no unit decides", and the function is raw. That is 1648 functions in 14 libraries, the largest raw cluster. Shape 2 of #3206 (allocator hooks the user may replace) is already ruled: field F of R is allocator | reallocator | deallocator | context, stated, never drawn. This brief is the other shape: a table only the library fills.
1. What the others do. None of them models it. Their C importers hand a function-pointer field over as a raw nullable pointer and stop (Rust's bindgen, Zig's translate-c, Swift's importer). This is from knowledge, not checked in .reference: bindgen is not in the Rust tree there.
2. What the spec says. It already has the rule, for another proof. §31.8.5 rule 4 (adopted 2026-11-11, not built): "Every indirect call resolves. A call through a pointer reaches a function whose address something took. An address taken inside the library is a reference … Any other source fails the proof." §31.8.6 does the same for one global (xmlFree): the library assigns it only in functions that stay raw. Nothing says a retention proof may use it.
3. The proposal. A call through field F of record R reaches one of the functions the package stores into F. The verdict is the join over that set: a parameter is retained if any of them retains it; a return is owned only if all of them return owned. It holds only when all of these hold, and otherwise the function stays raw, naming the first that failed:
Every unit of the build was read (the rule of §31.8.5).
Every store to F is an assignment or an initializer whose value is a function the package defines.
A whole R is written only by an initializer or by copying another R. A memcpy into one, or a cast of another pointer to R *, fails.
The address of F is never taken.
No presented operation lets the program supply an R or write F (R is not a fills or updates value record, and F has no stated role).
The library is built from the source that was read. A prebuilt binary proves nothing here, as for every other proof.
Where the proof fails and a person knows the answer, the registry states it: field F of R holds f, g, a counted claim with its citation.
4. Mission fit. The compiler proves what the library's own source already determines; the programmer writes nothing. The conditions are enumerable (D198), and a wrong answer needs a store the six conditions do not allow.
Prediction. Yes to the proof with those six conditions: 75%. Yes to holds as the stated fallback: 65% (you may prefer no fallback until a library needs it).
First step, if yes. A measuring build that reports, per library, how many of the 1648 the proof would decide and which condition stops each of the rest. It changes no verdict.
Correction to the brief above, from reading the code and the survey after writing it.
The proof already exists for one writer (D198, fd_draw_fnptr_verdicts): a field the package writes in exactly one place, with a named function, in a record that is never passed to a function the proofs cannot read, never cast, and never initialized by an unmapped initializer, is that function. Its conditions are the six I listed. So the proposal is not a new proof; it is two extensions of that one:
Several writers. A field written in several places, each with a named package function, is the join over them (retained if any retains; owned only if all return owned). Today: 'written in several places', 84 functions in the 2026-11-10 survey.
A record passed to a call through such a field. Today that fails the record ('a pointer to the record is passed to a function pointer, which the proofs cannot read'). With the callee set of that field closed and every member read, the record has not left what the drafter sees. This is the large one: 'the record is passed to a function the proofs cannot read' is 1452 of the cluster's functions, and in xz_utils (pinned 5.8.4) 10 of its 16 undecided callees fail for exactly this reason, at common.c:129. It needs a fixed point, since tables call through tables.
The measurement I offered is therefore mostly in the survey already; what a measuring build adds is how many of the 1452 are a call through a field (decidable by extension 2) and how many are a real outside function.
Survey over the library list with the split (main + the survey fix, darwin-aarch64, 2026-11-18; 22 libraries fetched, read from each library's source evidence):
why the field is undecided
functions
libraries
the record is passed to a call through a function pointer
1091 retained + 47 returned
6
the record is passed to an outside function the proofs cannot read
368 + 3
5
an initializer or field address the proofs cannot map
83 + 1
3
written in several places
74 + 10
9
its one write is not a named function
54
4
a unit could not be read
40
2
the record is converted to another pointer type
20
4
the package never writes it
3
1
So extension 2 of the brief (a record passed to a call through a field whose callee set is closed) is the reason for 1138 of the cluster's functions, and extension 1 (several writers) for 84 directly; extension 2 depends on extension 1 wherever the inner field has several writers.
Labelled human attn needed. What is left here waits on one ruling, already written up as a brief on this issue: whether the proofs may follow a record passed to a call through a function-pointer field when the set of functions that field can hold is closed (1,138 of the cluster's functions), and the several-writers extension it depends on (84). #3176's remaining misread (yyjson) and #3206's shape 1 go with the same ruling.
A: both extensions, under the six conditions, gated on the measuring build. Three conditions on the yes:
Fixed point. The words say which one. 'Retained' is the least fixed point (a retention needs a real store as witness). 'Returns owned' must be grounded: a cycle through the tables cannot prove ownership by assuming it.
Per-target verdicts. The survey was darwin-aarch64 only and GLFW's platform table is filled by different units per platform. 'Every unit of the build was read' holds per build configuration.
holds is deferred until the measuring build shows what A leaves undecided. If it comes later it is checked against every store the drafter can see.
Order: the measuring build (changes no verdict), then the proof. #3206 shape 1 and #3176's yyjson misread go with it. Label removed; this is mine.
Measured on 673ca2631 across the 23 buildable libraries on the #3115 list (after D211 / #3470 landed both extensions):
written in several places: 84 → 0
record passed to a call through a field the proofs do not close: 1,138 → 51 (95% eliminated; remaining 39 in glfw macOS Objective-C _glfwConnectCocoa, 10 in xz_utilslzma_filter_info_s.init)
chain of calls too deep to follow: 53 → 0
Verified retains is least fixed point and owns_return is grounded, with explicit cycle tests added in test/internals/conan_facade_fnptr_field_proof_test.with.
Activity
#3174: a parameter passed through a function-pointer field is said so…
#3174: a parameter passed through a function-pointer field is said so…
ehartford commentedon Nov 9, 2026
The dispatch shape is said honestly since #3202 (main 61b5199): a parameter passed through a function-pointer field reads 'passed through the function pointer field X, which no unit decides' (glfw's platform dispatch), and a field named free/malloc is no longer taken for the libc call (Law 4). What remains: a registry convention for dispatch tables, and the 47 'chain of calls too deep to follow' functions.
Facade coverage table regenerated on main 4cf358b; the survey names t…
#3174: a call through an explicitly dereferenced function-pointer fie…
#3174: a call through an explicitly dereferenced function-pointer fie…
Contract report: a retained parameter's chain of calls is followed to…
ehartford commentedon Nov 18, 2026
#3418 merged: a retained parameter's chain of calls is followed to the store that ends it, so the 47 "too deep to follow" functions now name where the value ends up. With #3202 (dispatch through a function-pointer field is said as such), what is left here is the registry convention for dispatch tables: how a registry states which functions a table's field may hold. That is contract-language design, so it waits on Eric.
ehartford commentedon Nov 18, 2026
Brief: a call through a function-pointer field the package fills itself (#3174, #3206 shape 1)
The question.
_glfw.platform.setWindowTitle(window, title)calls through a field. Today the proof stops: "passed through the function pointer field X, which no unit decides", and the function is raw. That is 1648 functions in 14 libraries, the largest raw cluster. Shape 2 of #3206 (allocator hooks the user may replace) is already ruled:field F of R is allocator | reallocator | deallocator | context, stated, never drawn. This brief is the other shape: a table only the library fills.1. What the others do. None of them models it. Their C importers hand a function-pointer field over as a raw nullable pointer and stop (Rust's bindgen, Zig's translate-c, Swift's importer). This is from knowledge, not checked in
.reference: bindgen is not in the Rust tree there.2. What the spec says. It already has the rule, for another proof. §31.8.5 rule 4 (adopted 2026-11-11, not built): "Every indirect call resolves. A call through a pointer reaches a function whose address something took. An address taken inside the library is a reference … Any other source fails the proof." §31.8.6 does the same for one global (
xmlFree): the library assigns it only in functions that stay raw. Nothing says a retention proof may use it.3. The proposal. A call through field
Fof recordRreaches one of the functions the package stores intoF. The verdict is the join over that set: a parameter is retained if any of them retains it; a return is owned only if all of them return owned. It holds only when all of these hold, and otherwise the function stays raw, naming the first that failed:Fis an assignment or an initializer whose value is a function the package defines.Ris written only by an initializer or by copying anotherR. Amemcpyinto one, or a cast of another pointer toR *, fails.Fis never taken.Ror writeF(Ris not afillsorupdatesvalue record, andFhas no stated role).Where the proof fails and a person knows the answer, the registry states it:
field F of R holds f, g, a counted claim with its citation.4. Mission fit. The compiler proves what the library's own source already determines; the programmer writes nothing. The conditions are enumerable (D198), and a wrong answer needs a store the six conditions do not allow.
Prediction. Yes to the proof with those six conditions: 75%. Yes to
holdsas the stated fallback: 65% (you may prefer no fallback until a library needs it).First step, if yes. A measuring build that reports, per library, how many of the 1648 the proof would decide and which condition stops each of the rest. It changes no verdict.
ehartford commentedon Nov 18, 2026
Correction to the brief above, from reading the code and the survey after writing it.
The proof already exists for one writer (D198,
fd_draw_fnptr_verdicts): a field the package writes in exactly one place, with a named function, in a record that is never passed to a function the proofs cannot read, never cast, and never initialized by an unmapped initializer, is that function. Its conditions are the six I listed. So the proposal is not a new proof; it is two extensions of that one:common.c:129. It needs a fixed point, since tables call through tables.The measurement I offered is therefore mostly in the survey already; what a measuring build adds is how many of the 1452 are a call through a field (decidable by extension 2) and how many are a real outside function.
ehartford commentedon Nov 18, 2026
Survey over the library list with the split (main + the survey fix, darwin-aarch64, 2026-11-18; 22 libraries fetched, read from each library's source evidence):
So extension 2 of the brief (a record passed to a call through a field whose callee set is closed) is the reason for 1138 of the cluster's functions, and extension 1 (several writers) for 84 directly; extension 2 depends on extension 1 wherever the inner field has several writers.
Contract report names destroyers for unproduced records; survey reads…
va_start names its last parameter, it does not use it: a printf-style…
ehartford commentedon Nov 24, 2026
Labelled
human attn needed. What is left here waits on one ruling, already written up as a brief on this issue: whether the proofs may follow a record passed to a call through a function-pointer field when the set of functions that field can hold is closed (1,138 of the cluster's functions), and the several-writers extension it depends on (84). #3176's remaining misread (yyjson) and #3206's shape 1 go with the same ruling.ehartford commentedon Nov 25, 2026
Ruled by Eric, 2026-11-25 (answers to briefs.md).
A: both extensions, under the six conditions, gated on the measuring build. Three conditions on the yes:
holdsis deferred until the measuring build shows what A leaves undecided. If it comes later it is checked against every store the drafter can see.Order: the measuring build (changes no verdict), then the proof. #3206 shape 1 and #3176's yyjson misread go with it. Label removed; this is mine.
ehartford commentedon Nov 27, 2026
Measured on
673ca2631across the 23 buildable libraries on the #3115 list (after D211 / #3470 landed both extensions):written in several places: 84 → 0record passed to a call through a field the proofs do not close: 1,138 → 51 (95% eliminated; remaining 39 inglfwmacOS Objective-C_glfwConnectCocoa, 10 inxz_utilslzma_filter_info_s.init)chain of calls too deep to follow: 53 → 0retainsis least fixed point andowns_returnis grounded, with explicit cycle tests added intest/internals/conan_facade_fnptr_field_proof_test.with.test: cover fnptr-field cycle grounding and least fixed point (#3174) (…