Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jleibs opened this issue Sep 22, 2023 · 1 comment
Closed
Labels
codegen/idl 🧑‍💻 dev experience developer experience (excluding CI)
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented Sep 22, 2023

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])}]
@jleibs jleibs added 🧑‍💻 dev experience developer experience (excluding CI) codegen/idl labels Sep 22, 2023
@emilk emilk added this to the 0.10 Polish milestone Sep 24, 2023
@emilk
Copy link
Member

emilk commented Feb 24, 2025

Let's do this instead:

@emilk emilk closed this as completed Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl 🧑‍💻 dev experience developer experience (excluding CI)
Projects
None yet
Development

No branches or pull requests

2 participants