From a3dbdcbd7f9b8d774af057b4851738dedba9aa6c Mon Sep 17 00:00:00 2001 From: recon Date: Fri, 28 Aug 2026 13:28:14 +0200 Subject: [PATCH] Name the S2 cell family the gate cannot otherwise see MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The family gate rejects a function by the family tokens of its NAME, and it can only reject a token it knows. The S2 cell index family is absent from that vocabulary, so tbigint_to_ts2cell reads as a tbigint function — its other token is a registered family — and passes. What passes is emitted: a call to a MEOS symbol no included header declares, which the extension fails to compile, and a registration of ts2cell(tbigint) returning tbigint, the operand type standing in for the one the generator has no accessor to name. ts2cell and s2cell join KNOWN_FAMILIES and not REGISTERED_FAMILIES, the pair that states a family MobilityDB publishes and the binding does not register yet, so supported() answers unregistered-family:ts2cell for both conversions while the registered tbigint_to_tquadbin sibling stays emittable. --- tools/codegen_duck_udfs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/codegen_duck_udfs.py b/tools/codegen_duck_udfs.py index f27c5980..27628a9d 100644 --- a/tools/codegen_duck_udfs.py +++ b/tools/codegen_duck_udfs.py @@ -232,7 +232,15 @@ def ret_type(f, out_canon): # name whose family token it knows, so an unlisted family rides in on a name # whose OTHER token happens to be unregistered, and emits the moment that one # registers. tposechain_to_tpose was rejected only for naming the then- - # unregistered tpose, and reached the compiler as soon as tpose registered. + # unregistered tpose, and reached the compiler once tpose registered. + # + # The S2 cell index family, whose DuckDB type the binding does not register. + # Naming it is what lets the gate reject its functions: `tbigint_to_ts2cell` + # carries a REGISTERED token too, so without the family here the gate reads it + # as a tbigint function, emits a call to a symbol no included MEOS header + # declares, and registers `ts2cell(tbigint)` as returning tbigint — the operand + # type standing in for the one the generator cannot name. + "ts2cell", "s2cell", } def unregistered_family_ref(name): """The first unregistered family token the name references, else None (in scope)."""