Skip to content

refactor: switch TPose regular families to the generated mixin#91

Open
estebanzimanyi wants to merge 1 commit into
refactor/oo-codegen-tcbuffer-switchfrom
refactor/oo-codegen-tpose-switch
Open

refactor: switch TPose regular families to the generated mixin#91
estebanzimanyi wants to merge 1 commit into
refactor/oo-codegen-tcbuffer-switchfrom
refactor/oo-codegen-tpose-switch

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Second family in the codegen-switch fan-out (after TCbuffer #90), independent
of the upstream MEOS value-accessor gate.

What changed

  • codegen.py: add the pose FAMILY_MODEL entry (+ the point arg
    token — tpose distance spells its geometry overload tdistance_tpose_point,
    unlike tcbuffer's _geo). Draft _preview/ path and the feat: meos-idl.json-driven OO method-family codegen (Draft preview) #89 coverage gate
    are untouched.
  • pymeos/main/_generated/tpose_methods.py: generated TPoseRegularMixin
    12 regular methods (comparison, temporal comparison, restriction,
    distance; pose has no spatial-relationship API by design). Each dispatches
    to the exact pymeos_cffi backing the hand-written method used.
  • pymeos/main/tpose.py: inherits TPoseRegularMixin; the 12
    now-generated regular methods removed. never_*, the irregular core, and
    the already-real MEOS-backed value accessors
    (start_value/end_value/value_set/value_at_timestamp/value_n) are kept.
    Adds documented NotImplementedError stubs for from_base_time
    (MobilityDB#1084) and from_mfjson (MobilityDB#1085) so
    TPose/Inst/Seq/SeqSet are concrete (the 2 missing abstracts).

Proof

tests/main/tpose_test.py is byte-identical hand-written vs wired (A/B
with the 2 stubs held constant, isolating the switch): 31 passed, 4 failed
in both
. The 4 failures are pre-existing #88 defects outside the
codegen-switch domain
TestTPoseOutputs/TestPose test_str,
TestTPoseAccessors::test_value_at_timestamp, TestPose::test_from_as_hexwkb
(hand-written outputs/accessors / base Pose, not the regular families).
Every switch-domain test (comparison / distance / restriction) passes. Static
check: 12/12 generated methods backing-and-fallback identical to the
hand-written oracle. PoseSet is already concrete (no NpointSet-style
cascade). #89 coverage gate stays green.

Stack / scope

Stacked on #90 (TCbuffer switch) → #89#88. The 2 stubs are this slice's
concern (kept self-contained rather than re-amending #88, to keep the fan-out
PRs independent and reviewable). from_base_time/from_mfjson become real in
a trivial follow-up once #1084/#1085 land in MobilityDB master + PyMEOS-CFFI
regenerates — same closure path as TCbuffer.

Follow-up

Remaining fan-out: TNpoint (also needs its NpointSet abstract surface),
geo, temporal. The 4 pre-existing TPose failures are a separate #88 concern,
not this switch.

Fans the meos-idl.json faithful codegen out to TPose (second family
after TCbuffer #90).

- codegen.py: add the `pose` FAMILY_MODEL entry (+ the `point` arg
  token — tpose distance spells its geometry overload
  `tdistance_tpose_point`). The Draft _preview path and #89 coverage
  gate are unchanged.
- pymeos/main/_generated/tpose_methods.py: generated TPoseRegularMixin
  (12 regular methods — comparison, temporal comparison, restriction,
  distance; pose has no spatial-relationship API). Each dispatches to the
  exact pymeos_cffi backing the hand-written method used.
- pymeos/main/tpose.py: inherits TPoseRegularMixin; the 12 now-generated
  regular methods removed. never_*/the irregular core and the
  already-real MEOS-backed value accessors (start_value/end_value/
  value_set/value_at_timestamp/value_n) are kept. Adds documented
  NotImplementedError stubs for from_base_time (MobilityDB#1084) and
  from_mfjson (MobilityDB#1085) so TPose/Inst/Seq/SeqSet are concrete.

Proof: tests/main/tpose_test.py is byte-identical hand-written vs wired
(A/B with the 2 stubs held constant) — 31 passed, 4 failed in BOTH; the
4 failures are pre-existing #88 defects OUTSIDE the codegen-switch domain
(TestTPoseOutputs/Pose test_str, TestTPoseAccessors test_value_at_timestamp,
TestPose test_from_as_hexwkb — hand-written accessors / base Pose, not
the regular families). Static check: 12/12 generated methods are
backing-and-fallback identical to the hand-written oracle. All
switch-domain tests (comparison/distance/restriction) pass. Stacked on
#90.
estebanzimanyi added a commit that referenced this pull request May 19, 2026
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 (merged into meos-idl.json).

Additive only -- the 4 shipped families' FAMILY_MODEL path
(emit_faithful_mixin) is untouched; #90/#91/#92/#93 mixins regenerate
byte-identical (regression-guarded) and #89 coverage gate stays green.

Proven correct WITHOUT waiting on the not-yet-published 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). geo/temporal then plug
into this same proven consumer the instant MEOS-API emits their
oo.dispatch (via --mixin-from-dispatch), closing codegen 6/6 -- no
PyMEOS-local transcription, equivalence by construction at the catalog
level.

This is the non-wasted parallel prep: when the keystone enrichment
lands, PyMEOS converges immediately. Stacked on #94 (the RFC).
estebanzimanyi added a commit that referenced this pull request May 19, 2026
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 (merged into meos-idl.json).

Additive only -- the 4 shipped families' FAMILY_MODEL path
(emit_faithful_mixin) is untouched; #90/#91/#92/#93 mixins regenerate
byte-identical (regression-guarded) and #89 coverage gate stays green.

Proven correct WITHOUT waiting on the not-yet-published 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). geo/temporal then plug
into this same proven consumer the instant MEOS-API emits their
oo.dispatch (via --mixin-from-dispatch), closing codegen 6/6 -- no
PyMEOS-local transcription, equivalence by construction at the catalog
level.

This is the non-wasted parallel prep: when the keystone enrichment
lands, PyMEOS converges immediately. Stacked on #94 (the RFC).
estebanzimanyi added a commit that referenced this pull request May 19, 2026
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 added a commit that referenced this pull request May 19, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant