Repository navigation
State an array return as long as an array the function reads - #186
Merged
estebanzimanyi merged 1 commit intoOct 10, 2026
Merged
estebanzimanyi merged 1 commit into
estebanzimanyi merged 1 commit into
Conversation
A function returning the element of an input array with one more pointer level returns an array of that input array's length: temparr_round(Temporal **temp, int count, int maxdd) returns count values as Temporal **, cbufferarr_round and posearr_round count Cbuffer ** and Pose ** the same way, and stboxarr_round(const STBox *boxarr, int count, int maxdd) returns count boxes as STBox *. attach_counted_array_returns of parser/shapeinfer.py states shape.arrayReturn for such a function, with the lengthFrom of that input array and the element read from the return as infer_shapes reads it, when the function has no int *count out-parameter and exactly one length among the input arrays of that element; it runs after attach_struct_input_arrays, which states the boxarr of stboxarr_round. A return of the element type itself is one value and states no array: temporal_merge_array(Temporal **temparr, int count) returns one Temporal *, and geo_cluster_intersecting keeps the length of its int *count. The wire follows the shape. _counted_array_return of parser/enrich.py serves such a return as a result of kind array whose count_param names the length of the request's array, and the server reads back that many element pointers through invoke_counted_array of server/engine.py. A return counted by an argument the request carries as one value is refused naming it: stboxarr_round reads boxarr as one serialized box, so it is array-or-out-param:boxarr rather than a single STBox * encoded with stbox_out. Witness: on MEOS-API master d259ddb over MobilityDB master bdc4e41234 the catalog states no arrayReturn for the four, refuses temparr_round, cbufferarr_round and posearr_round as unsupported-return, and maps stboxarr_round to one STBox * result, so a binding returns its first box only. Measured over MobilityDB master bdc4e41234 with an all-families libmeos: run.py states 4 such array returns, those of temparr_round, cbufferarr_round, posearr_round and stboxarr_round, and every other key of every function equals that of master's parser; the exposable count moves from 3378 to 3380. They are the only public functions whose documentation returns an array the catalog states no arrayReturn for. The suite passes 534 tests with none skipped, among them the five of tests/test_shapeinfer.py CountedArrayReturnTests and the round trip of temparr_round against libmeos in tests/test_engine_integration.py; the floor of .github/workflows/pytest.yml reads 534. Why: the length of an array a function returns is the catalog's to state, and a binding that reads it from the catalog returns every element.
estebanzimanyi
force-pushed
the
catalog/arr-round-array-return
branch
from
October 10, 2026 07:25
690752c to
7b707af
Compare
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 function returning the element of an input array with one more pointer level returns an array
of that input array's length: temparr_round(Temporal **temp, int count, int maxdd) returns
count values as Temporal **, cbufferarr_round and posearr_round count Cbuffer ** and Pose ** the
same way, and stboxarr_round(const STBox *boxarr, int count, int maxdd) returns count boxes as
STBox *. attach_counted_array_returns of parser/shapeinfer.py states shape.arrayReturn for such a
function, with the lengthFrom of that input array and the element read from the return as
infer_shapes reads it, when the function has no int *count out-parameter and exactly one length
among the input arrays of that element; it runs after attach_struct_input_arrays, which states
the boxarr of stboxarr_round. A return of the element type itself is one value and states no
array: temporal_merge_array(Temporal **temparr, int count) returns one Temporal *, and
geo_cluster_intersecting keeps the length of its int *count.
The wire follows the shape. _counted_array_return of parser/enrich.py serves such a return as a
result of kind array whose count_param names the length of the request's array, and the server
reads back that many element pointers through invoke_counted_array of server/engine.py. A return
counted by an argument the request carries as one value is refused naming it: stboxarr_round
reads boxarr as one serialized box, so it is array-or-out-param:boxarr rather than a single
STBox * encoded with stbox_out.
Witness: on MEOS-API master d259ddb over MobilityDB master bdc4e41234 the catalog states no
arrayReturn for the four, refuses temparr_round, cbufferarr_round and posearr_round as
unsupported-return, and maps stboxarr_round to one STBox * result, so a binding returns its first
box only.
Measured over MobilityDB master bdc4e41234 with an all-families libmeos: run.py states 4 such
array returns, those of temparr_round, cbufferarr_round, posearr_round and stboxarr_round, and
every other key of every function equals that of master's parser; the exposable count moves from
3378 to 3380. They are the only public functions whose documentation returns an array the catalog
states no arrayReturn for. The suite passes 534 tests with none skipped, among them the five of
tests/test_shapeinfer.py CountedArrayReturnTests and the round trip of temparr_round against
libmeos in tests/test_engine_integration.py; the floor of .github/workflows/pytest.yml reads 534.
Why: the length of an array a function returns is the catalog's to state, and a binding that reads
it from the catalog returns every element.