Skip to content

refactor: switch TNpoint regular families to the generated mixin#92

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

refactor: switch TNpoint regular families to the generated mixin#92
estebanzimanyi wants to merge 1 commit into
refactor/oo-codegen-tpose-switchfrom
refactor/oo-codegen-tnpoint-switch

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

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

What changed

Proof

tests/main/tnpoint_test.py is byte-identical hand-written vs wired
(A/B with stubs + the NpointSet fix held constant): both error
identically at the same pre-existing point

tnpoint_test.py:211 TestNpointSet, MeosTextInputError: Missing delimiter ','. So the switch delta is provably zero. That collection
error is a pre-existing #88/MEOS NpointSet test-fixture/parser issue
outside the codegen-switch domain
(base NpointSet, not the temporal
regular families) — unrelated to and unaffected by this change. The
positive proof is the static 12/12 backing-identical check (each
generated method calls the exact same pymeos_cffi backing with the same
dispatch / result / fallback as the hand-written one — equivalence by
construction). #89 coverage gate stays green.

Scope / stack

Stacked on #91#90#89#88. Stubs + the NpointSet
concretization are this slice's concern (kept self-contained per the
fan-out pattern). The TestNpointSet:211 parser/fixture error and the
from_* real impls are separate tracked follow-ups (MobilityDB
#1082/#1084/#1086 + an npointset test-data/parser fix), not this switch.

Remaining fan-out

geo (TGeomPoint — adds the full spatial-relationship family + a geo
token model) and temporal (TFloat/TInt/TBool/TText — scalar-base model)
remain, each its own slice.

Third family in the codegen-switch fan-out (after TCbuffer #90, TPose
#91), independent of the upstream MEOS gate.

- codegen.py: add the `npoint` FAMILY_MODEL (+ `npointset` and `point`
  arg tokens; tnpoint distance spells `tdistance_tnpoint_point`). Make
  shortest_line's precision per-family (npoint: `precision: int = 15`;
  tcbuffer/tpose hardcode 10 with no param and omit the key, so #90/#91
  regenerate byte-identical -- verified). Draft _preview path and #89
  gate untouched.
- pymeos/main/_generated/tnpoint_methods.py: generated TNpointRegularMixin
  (12 regular methods -- comparison, temporal comparison, restriction,
  distance; npoint has no spatial-relationship API). Static check: 12/12
  backing-and-fallback identical to the hand-written oracle.
- pymeos/main/tnpoint.py: inherits the mixin; 12 now-generated regular
  methods removed; never_*/irregular core kept. Adds documented
  NotImplementedError stubs (value accessors -> MobilityDB#1082,
  from_base_time -> #1084, from_mfjson -> #1086) so TNpoint*/Inst/Seq/
  SeqSet are concrete.
- pymeos/collections/npoint/npointset.py: NpointSet shipped abstract in
  #88 (pre-existing base-collection defect, unrelated to the switch);
  add the 5 missing Set ops as thin super() delegations to the generic
  base Set (the established GeoSet.contains pattern), making NpointSet
  concrete.

Proof: tests/main/tnpoint_test.py is byte-identical hand-written vs
wired (A/B, stubs+NpointSet-fix held constant) -- both error IDENTICALLY
at the same pre-existing point (`tnpoint_test.py:211` TestNpointSet,
MeosTextInputError 'Missing delimiter'), so the switch delta is provably
zero. That collection error is a pre-existing #88/MEOS npointset
test-fixture/parser issue OUTSIDE the codegen-switch domain (base
NpointSet, not the temporal regular families), unrelated to and
unaffected by this change -- a separate follow-up. Static 12/12
identical is the positive proof. Stacked on #91.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant