Skip to content

Call each writer with its out-parameters and derive the validated OpenAPI catalog through provision-meos.sh - #226

Merged
estebanzimanyi merged 2 commits into
MobilityDB:masterfrom
estebanzimanyi:fix/engine-writer-outparams
Oct 31, 2026
Merged

estebanzimanyi merged 2 commits into
MobilityDB:masterfrom
estebanzimanyi:fix/engine-writer-outparams

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Call a writer with the out-parameters its catalog entry states

CtypesEngine.encode calls a writer with its own signature: every out-parameter the
catalog lists in the writer's shape.outParams gets a slot of its own at its position,
the trailing inputs fill the other positions in order, and a writer handing back its
size in a size_t * is read for that many bytes, less the terminating NUL MEOS counts in
the size of a string. The server reads each writer's out-parameters from the catalog
(writer_outparams) and states them in the route as encode_outparams, beside
encode_aux, for a result, an out-parameter result and the elements of an array result.
set_as_hexwkb, span_as_hexwkb, spanset_as_hexwkb and raster_as_hexwkb, the writers of
459 results on the wire over the catalog of MobilityDB master 1ff2270f7f, are called
with their size_t *size_out; no reader on the wire has an out-parameter.

Witness: tests/test_engine_integration.py, an intset, an intspan and a tint written by
set_as_hexwkb, span_as_hexwkb and temporal_as_hexwkb through CtypesEngine.encode and
read back to their value, and tests/test_server.py, the route of a result whose writer
states size_out and the call the engine receives; both fail on master's server.

Why: the encode a route names for a Set, a Span, a SpanSet or a Raster called the hex
writer with its value and its variant and no size_out, leaving MEOS to write the size
through whatever the third argument register held.

Measured: the 632 tests pass, master's 630 and the 2 above, with libmeos built from
MobilityDB master 1ff2270f7f.

Derive the validated OpenAPI catalog through provision-meos.sh

openapi-validate.yml regenerates the catalog with tools/provision-meos.sh over the
MobilityDB checkout, which runs run.py with MDB_SRC_ROOT naming it, so the @InGroup groups
that make a function public are attached and the exposable functions are projected. The
workflow refuses a document with no path, and a change to provision-meos.sh runs it.

Why: IO-B1 of IO-PLAN.md in MobilityDB #2861. run.py reads the groups from MDB_SRC_ROOT,
else from ./_mobilitydb; the workflow set neither, so every function read internal and
run 41207016338 published a valid document of 0 paths ("Done: 6073 functions (0
stateless-exposable)", "0 paths, 0 schemas").

Measured: over MobilityDB master 1ff2270f7f, run.py over the source headers without
MDB_SRC_ROOT states all 6077 functions internal, 0 exposable, and generate_openapi.py
projects 0 paths; through provision-meos.sh the catalog states 3614 exposable functions
and the document, valid OpenAPI 3.1, 3614 paths and 35 schemas. The check refuses the
document of 0 paths.

CtypesEngine.encode calls a writer with its own signature: every out-parameter the
catalog lists in the writer's shape.outParams gets a slot of its own at its position,
the trailing inputs fill the other positions in order, and a writer handing back its
size in a size_t * is read for that many bytes, less the terminating NUL MEOS counts in
the size of a string. The server reads each writer's out-parameters from the catalog
(writer_outparams) and states them in the route as encode_outparams, beside
encode_aux, for a result, an out-parameter result and the elements of an array result.
set_as_hexwkb, span_as_hexwkb, spanset_as_hexwkb and raster_as_hexwkb, the writers of
459 results on the wire over the catalog of MobilityDB master 1ff2270f7f, are called
with their size_t *size_out; no reader on the wire has an out-parameter.

Witness: tests/test_engine_integration.py, an intset, an intspan and a tint written by
set_as_hexwkb, span_as_hexwkb and temporal_as_hexwkb through CtypesEngine.encode and
read back to their value, and tests/test_server.py, the route of a result whose writer
states size_out and the call the engine receives; both fail on master's server.

Why: the encode a route names for a Set, a Span, a SpanSet or a Raster called the hex
writer with its value and its variant and no size_out, leaving MEOS to write the size
through whatever the third argument register held.

Measured: the 632 tests pass, master's 630 and the 2 above, with libmeos built from
MobilityDB master 1ff2270f7f.
@estebanzimanyi
estebanzimanyi force-pushed the fix/engine-writer-outparams branch from bb69c9d to 229d253 Compare October 31, 2026 18:58
openapi-validate.yml regenerates the catalog with tools/provision-meos.sh over the
MobilityDB checkout, which runs run.py with MDB_SRC_ROOT naming it, so the @InGroup groups
that make a function public are attached and the exposable functions are projected. The
workflow refuses a document with no path, and a change to provision-meos.sh runs it.

Why: IO-B1 of IO-PLAN.md in MobilityDB #2861. run.py reads the groups from MDB_SRC_ROOT,
else from ./_mobilitydb; the workflow set neither, so every function read internal and
run 41207016338 published a valid document of 0 paths ("Done: 6073 functions (0
stateless-exposable)", "0 paths, 0 schemas").

Measured: over MobilityDB master 1ff2270f7f, run.py over the source headers without
MDB_SRC_ROOT states all 6077 functions internal, 0 exposable, and generate_openapi.py
projects 0 paths; through provision-meos.sh the catalog states 3614 exposable functions
and the document, valid OpenAPI 3.1, 3614 paths and 35 schemas. The check refuses the
document of 0 paths.
@estebanzimanyi estebanzimanyi changed the title Call a writer with the out-parameters its catalog entry states Call each writer with its out-parameters and derive the validated OpenAPI catalog through provision-meos.sh Oct 31, 2026
@estebanzimanyi
estebanzimanyi merged commit 43a07ab into MobilityDB:master Oct 31, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/engine-writer-outparams branch October 31, 2026 19:06
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