Skip to content

Roundtrip tests should give better error message on union-type mismatch #3410

@jleibs

Description

@jleibs

Barcharts has a roundtrip test failure with:

Python:

rr2.log("bar_chart", rr2.BarChart([8, 4, 0, 9, 1, 4, 1, 6, 9, 0]))

Rust

rec.log(
     "bar_chart",
    &BarChart::new(vec![8, 4, 0, 9, 1, 4, 1, 6, 9, 0]),
)?;

Turns out the cause for this that python defaulted to i64 union arm of the TensorBuffer, while rust chose a different integer type.

We check for this when the mismatch is at the top-level of the table, but we don't do so recursively.

In this case we detected the error instead via size mismatch:

Sizes don't match! 4113 (rerun.components.TensorData) vs. 4073 (rerun.components.TensorData) bytes. Perhaps the validity differs?
IPC size is 6672 vs 6608 bytes

Related, it would be nice if the printed tables showed the union-arms:

Right now we have:

[{shape: [{size: 10, name: -}], buffer: [8, 4, 0, 9, 1, 4, 1, 6, 9, 0]}]

But this check would be much more clear if this displayed as:

[{shape: [{size: 10, name: -}], buffer: Int64([8, 4, 0, 9, 1, 4, 1, 6, 9, 0])}]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions