Skip to content

Fold out-parameters via the catalog's shape.outParams flag#35

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/outparam-fold-by-flag
Jul 9, 2026
Merged

Fold out-parameters via the catalog's shape.outParams flag#35
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/outparam-fold-by-flag

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The MEOS-API catalog now carries each function's Doxygen @param[out] tags as shape.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() reads shape.outParams instead of a trailing-pointer type heuristic. 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.
  • The vendored JMEOS jar (libs/JMEOS.jar) is re-vendored with the folded surface. The tools/meos-source-commit.txt pin is unchanged — the public MEOS headers are byte-identical across the intervening commits, so the jar surface matches the pinned libmeos.
  • The vendored catalog (tools/meos-idl.json) gains shape.outParams (380 functions, 438 out-params).

Effect

The generated surface grows by 12 UDFs (2788 → 2800), nothing dropped:

  • the value_at_timestamptz family (tint/tbigint/tbool/tfloat) + valueAtTimestamp, whose value out-param the old JMEOS whitelist left unfolded;
  • npoint_*_set_stbox / pose_set_stbox, whose out-param is named box, not result;
  • contains_set_cbuffer/geo/jsonb/pose, whose trailing GSERIALIZED*/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

GeneratedSurfaceTest passes 11/11 against a real all-families libmeos, including a new assertion that the folded tint_value_at_timestamptz binds and dereferences the value (= 2 at the middle instant; NULL on a strict miss).

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.
@estebanzimanyi estebanzimanyi merged commit 2c833bb into MobilityDB:main Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant