Fold out-parameters via the catalog's shape.outParams flag#35
Merged
estebanzimanyi merged 1 commit intoJul 9, 2026
Merged
Conversation
The MEOS-API catalog carries each function's Doxygen @param[out] tags as shape.outParams, cross-checked against the C signature. classify() folds out-parameters from that flag — the same signal the JMEOS jar folds from — instead of a trailing-pointer type heuristic that cannot tell a value out-param from a trailing struct-pointer input. A size_t* out-param is the byte-count buffer JMEOS swallows; a single non-size pointer out-param on a bool/void function folds to a returned Pointer, dereferenced (OUTPRIM) or serialized (SERIAL). Functions with two or more value out-params do not fold. Re-vendor the JMEOS jar with the folded surface (same MobilityDB pin, whose public headers are unchanged) and enrich the catalog with shape.outParams. This emits the value_at_timestamptz family and the *_set_stbox / contains_set_* functions the heuristic mishandled, with a surface test for the folded value_at_timestamptz.
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.
The MEOS-API catalog now carries each function's Doxygen
@param[out]tags asshape.outParams, cross-checked against the C signature (MobilityDB/MEOS-API#37, folded in JMEOS via MobilityDB/JMEOS#32). This wires the Spark generator to fold out-parameters from that flag — the same signal the JMEOS jar folds from — so the two sides agree by construction.What changes
classify()readsshape.outParamsinstead of a trailing-pointer type heuristic. Asize_t*out-param is the byte-count buffer JMEOS swallows; a single non-size pointer out-param on a bool/void function folds to a returnedPointer, dereferenced (OUTPRIM) or serialized (SERIAL). Functions with two or more value out-params do not fold.libs/JMEOS.jar) is re-vendored with the folded surface. Thetools/meos-source-commit.txtpin is unchanged — the public MEOS headers are byte-identical across the intervening commits, so the jar surface matches the pinned libmeos.tools/meos-idl.json) gainsshape.outParams(380 functions, 438 out-params).Effect
The generated surface grows by 12 UDFs (2788 → 2800), nothing dropped:
value_at_timestamptzfamily (tint/tbigint/tbool/tfloat) +valueAtTimestamp, whosevalueout-param the old JMEOS whitelist left unfolded;npoint_*_set_stbox/pose_set_stbox, whose out-param is namedbox, notresult;contains_set_cbuffer/geo/jsonb/pose, whose trailingGSERIALIZED*/Jsonb*/… input the type heuristic wrongly folded as a struct out-param (arity mismatch → excluded); the flag correctly leaves them as inputs.The flag-based classification is a strict superset of the heuristic (every prior fold preserved).
Verification
GeneratedSurfaceTestpasses 11/11 against a real all-families libmeos, including a new assertion that the foldedtint_value_at_timestamptzbinds and dereferences the value (= 2at the middle instant;NULLon a strict miss).