Skip to content

feat: PyMEOS consumer for RFC #94 oo.dispatch — path to codegen 6/6 - #95

Open
estebanzimanyi wants to merge 2 commits into
docs/rfc-dispatch-metadatafrom
feat/oo-dispatch-consumer
Open

feat: PyMEOS consumer for RFC #94 oo.dispatch — path to codegen 6/6#95
estebanzimanyi wants to merge 2 commits into
docs/rfc-dispatch-metadatafrom
feat/oo-dispatch-consumer

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Implements the PyMEOS-side follow-up of RFC #94 §5: a consumer that emits faithful geo/temporal mixins from the canonical oo.<family>.<member>.dispatch blocks the parallel MEOS-API session is adding to meta/meos-meta.json. This is the non-wasted parallel prep — when the keystone enrichment lands, PyMEOS converges to codegen 6/6 immediately.

Proven correct without waiting on the metadata

_serialize_family_dispatch() expresses each of the 4 A/B-proven families (cbuffer/pose/npoint/rgeo) in the RFC #94 §3 schema; feeding those back through emit_from_oo_dispatch() reproduces their committed mixins byte-identically for all 4 — the new --verify-oo-roundtrip gate + OoDispatchConsumer test (permanently enforced). So the consumer is proven against the proven path, not circularly.

cbuffer oo.dispatch round-trip BYTE-IDENTICAL ✓
npoint oo.dispatch round-trip BYTE-IDENTICAL ✓
pose oo.dispatch round-trip BYTE-IDENTICAL ✓
rgeo oo.dispatch round-trip BYTE-IDENTICAL ✓
VERIFY: PASS

Safety

Additive onlyemit_faithful_mixin (the 4 shipped families' path) is untouched; #90#93 mixins regenerate byte-identical (regression-guarded); #89 coverage gate stays green; Black-clean; no AI attribution.

How 6/6 closes

The instant MEOS-API emits oo.geo/oo.temporal dispatch (RFC #94 §3, parallel session in progress): codegen.py --mixin-from-dispatch geo|temporal runs them through this same proven consumer → faithful mixins → wire + A/B exactly as the 4 shipped slices. No PyMEOS-local transcription; equivalence by construction at the catalog level.

Stack

Stacked on #94 (the RFC). The geo/temporal A/B-green is gated solely on the parallel MEOS-API enrichment landing — this PR removes all PyMEOS-side risk from that convergence.

@estebanzimanyi
estebanzimanyiforce-pushed the feat/oo-dispatch-consumer branch 2 times, most recently from 748003c to 2aa1e05CompareMay 19, 2026 12:56
@estebanzimanyi
estebanzimanyiforce-pushed the docs/rfc-dispatch-metadata branch from 8d57587 to b0fe78eCompareMay 19, 2026 13:16
@estebanzimanyi
estebanzimanyiforce-pushed the feat/oo-dispatch-consumer branch from 2aa1e05 to f403dccCompareMay 19, 2026 13:34
Implements the PyMEOS side of RFC #94 §5/§7: a consumer that emits
faithful geo/temporal mixins from the canonical objectModel.dispatch
metadata (MEOS-API #10 feat/object-model, merged into meos-idl.json),
closing the OO codegen to all 6 temporal type families with
equivalence by construction at the catalog level.
Additive only — the 4 derivable families' FAMILY_MODEL path
(emit_faithful_mixin) is untouched; #90/#91/#92/#93 mixins regenerate
byte-identical (--verify-oo-roundtrip + OoDispatchConsumer
.test_roundtrip_byte_identical, permanently enforced) and the #89
coverage gate stays green.
geo + the 4 temporal concretes (TFloat/TInt/TBool/TText) are not
derivable from the signature catalog (RFC #94 §1), so they are driven
by the verbatim objectModel.dispatch metadata and proven equivalent to
the hand-written oracle by dispatch-skeleton equality:
* tools/oo_codegen/_d1-dispatch-extended-fixture.json — the verbatim
§7 dispatch metadata (== MEOS-API #10 objectModel.dispatch).
* tools/oo_codegen/_oracle_extended_methods.py — the byte-for-byte
hand-written editorial methods (AST-extracted) the proof checks
against; never executed, never imported.
* --verify-oo-dispatch-extended + OoDispatchConsumer
.test_extended_dispatch_matches_oracle: each of the 32 editorial
methods (geo at/minus/distance/nearest_approach_distance + each
concrete's always/ever/temporal eq·ne, at, minus) reduces to an
identical ordered dispatch skeleton — isinstance type-set, backing
symbol, arg transform, super-coerce, fallback, result wrap. 0
divergence: same native calls, same transforms, never reimplemented.
The closed argTransform vocabulary maps to PyMEOS idioms
(scalarValue, scalarCast-per-base, geoToGserialized with
geodeticFromSelf, stboxToGeo, innerPtr, textsetMake, list[str],
coerce + via:super).
Stacked on #94 (the RFC, including the verbatim §7 SoT).
@estebanzimanyi
estebanzimanyiforce-pushed the feat/oo-dispatch-consumer branch from f403dcc to c850df1CompareMay 19, 2026 13:36
estebanzimanyi added a commit to estebanzimanyi/PyMEOS that referenced this pull request Jun 25, 2026
master predates the meos-idl.json OO codegen, which lives in the open stack.
Add tools/pin/compose-order.txt (the canonical fold manifest with the
disposition of every open PR; MobilityDB#95 is the verified OO-codegen frontier
containing MobilityDB#88/MobilityDB#89 and the family-switch stack) and GENERATION.md (the
per-binding generator policy: PyMEOS is two layers — PyMEOS-CFFI low-level +
the PyMEOS OO layer generated by tools/oo_codegen/codegen.py; the regular
families switch to generated mixins generate-then-retire).
Switches TPoint and TFloat/TInt/TBool/TText to the objectModel.dispatch consumer for their editorial (non-token-derivable) members, mirroring the tcbuffer/npoint/pose/rgeometry switch: each class inherits its generated <Fam>DispatchMixin and the corresponding hand-written methods (at/distance/minus/nearest_approach_distance for TPoint; the equal-family + at/minus for the temporal concretes) are removed. Token-derivable methods stay hand-written.
The vendored tools/oo_codegen/meos-idl.json gains the objectModel facet (the function set is unchanged) so the dispatch consumer runs against the catalog in-tree. codegen.py imports each mixin's own temporal type only under TYPE_CHECKING and lazily in-method, matching the FAMILY_MODEL template, so wiring the mixin into the class module does not create an import cycle.
codegen.py --check, --verify-oo-dispatch-extended and --verify-oo-roundtrip all pass; the generated members dispatch to the exact pymeos_cffi backings the hand methods used, so behaviour is identical by construction.
Sign up for freeto 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

@estebanzimanyi