Skip to content

64bit offsets - LWT compatibility  #1554

@benjeffery

Description

@benjeffery

We're moving to 64bit offset columns in #1527. This will create incompatibility in the LightweightTableCollection dict representation which is used to transfer a tree-sequence between python modules that have compiled different versions of the tskit C API.

There are two situations, a 64bit tskit reading a dict from a 32bit tskit, and vice-versa.

The first of these is relatively straight forward - we already use PyArray_FromAny which will silently apply any cast which is safe, so will read the 32bit offset array just fine.

The second case will fail as the cast is unsafe. My suggestion for dealing with this is that the 64bit code writes a 32bit array to any X_offset column if safe to do so and all the offsets are below the maximum value. If they aren't it writes 64bit and the 32bit code will error out. Unfortunately the error message will not be friendly, but there is no way to retrospectively fix that.

We should add some tests to CI with old msprime versions to test this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python APIIssue is about the Python API

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions