Record the Go signature each generated wrapper is emitted with - #23
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Merged
Conversation
A caller of a generated wrapper needs the shape the generator CHOSE, and that shape is not the C parameter list. `tbool_value_at_timestamptz` declares four C parameters while the emitted wrapper takes three, folding the `bool *value` out-parameter into a second result; an array and its length collapse into one slice; a `char *` becomes a `string`. Anything reading the catalog C signature to call these wrappers reconstructs a shape they do not have. `SIGNATURES` states what the generator emits: each MEOS C name mapped to the Go name, the parameters and the result types, recorded at the two sites that assemble a signature. A function absent from it has no wrapper to call, which is the honest answer rather than a guess. It is the piece the object layer consumes, so the two generators cannot disagree about a folded out-parameter -- the same split MEOS.NET keeps between `tools/codegen.py` and `tools/objectgen.py`. MEASURED: 3562 wrappers emitted, 3562 recorded, so the map is total over the emitted surface rather than a subset. Regenerating from one catalog with and without this commit yields 15 files on each side and a diff of 0 lines over 41653 lines of generated Go, so the emitted package does not move. The baseline run carries no `SIGNATURES` attribute, which is what makes it a control rather than a second run of the same code. The change is confined to the Python generator and its Go output is byte-identical, so it carries no compilable change.
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.
A caller of a generated wrapper needs the shape the generator CHOSE, and that
shape is not the C parameter list.
tbool_value_at_timestamptzdeclares four Cparameters while the emitted wrapper takes three, folding the
bool *valueout-parameter into a second result; an array and its length collapse into one
slice; a
char *becomes astring. Anything reading the catalog C signatureto call these wrappers reconstructs a shape they do not have.
SIGNATURESstates what the generator emits: each MEOS C name mapped to the Goname, the parameters and the result types, recorded at the two sites that
assemble a signature. A function absent from it has no wrapper to call, which is
the honest answer rather than a guess.
It is the piece the object layer consumes, so the two generators cannot disagree
about a folded out-parameter -- the same split MEOS.NET keeps between
tools/codegen.pyandtools/objectgen.py.MEASURED: 3562 wrappers emitted, 3562 recorded, so the map is total over the
emitted surface rather than a subset. Regenerating from one catalog with and
without this commit yields 15 files on each side and a diff of 0 lines over
41653 lines of generated Go, so the emitted package does not move. The baseline
run carries no
SIGNATURESattribute, which is what makes it a control ratherthan a second run of the same code.
The change is confined to the Python generator and its Go output is
byte-identical, so it carries no compilable change.