Skip to content

fix[vortex-array]: fix panic caused by take on listview during compression#6785

Closed
asubiotto wants to merge 1 commit intodevelopfrom
asubiotto/fillnull
Closed

fix[vortex-array]: fix panic caused by take on listview during compression#6785
asubiotto wants to merge 1 commit intodevelopfrom
asubiotto/fillnull

Conversation

@asubiotto
Copy link
Contributor

If a ListView is a child of a Dictionary which is canonicalized during compression, Take is executed on the ListView and subsequently its validity slice. This could result in a lazy FillNull array wrapping the validity which was never executed, causing a panic on serialization "Array vortex.fill_null does not support serialization". This PR executes the validity on rebuild, similar to how offsets/sizes are already executed implicitly via to_primitive.

Summary

Fixes a panic writing complex nested types -> dict<struct>

Testing

A high-level regression test was added

@asubiotto asubiotto requested a review from joseph-isaacs March 4, 2026 17:16
@asubiotto asubiotto added the changelog/fix A bug fix label Mar 4, 2026
@asubiotto asubiotto force-pushed the asubiotto/fillnull branch from 657f5ca to b4ddd9f Compare March 4, 2026 17:17
@asubiotto asubiotto marked this pull request as draft March 4, 2026 17:17
@asubiotto
Copy link
Contributor Author

I still need to clean this PR up a little, but wanted to see if the direction was appropriate. Is there a more ergonomic way to execute the validity? I see validity.execute() but I think that requires LEGACY_SESSION.create_execution_ctx() or something. Is that preferable?

@asubiotto asubiotto force-pushed the asubiotto/fillnull branch 2 times, most recently from c4b9f7a to d975b8b Compare March 4, 2026 20:45
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 4, 2026

Merging this PR will degrade performance by 10.2%

❌ 1 regressed benchmark
✅ 979 untouched benchmarks
⏩ 1466 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation map_each[BufferMut<i32>, 128] 770.6 ns 858.1 ns -10.2%

Comparing asubiotto/fillnull (6f59c9a) with develop (a332796)

Open in CodSpeed

Footnotes

  1. 1466 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@asubiotto asubiotto force-pushed the asubiotto/fillnull branch from d975b8b to fae0685 Compare March 4, 2026 20:49
@asubiotto asubiotto marked this pull request as ready for review March 4, 2026 20:50
@joseph-isaacs
Copy link
Contributor

Ideally we would fix this at the problematic call sight in the compressor. Since we don't want to force evaluation of the mask in the scan path

@asubiotto
Copy link
Contributor Author

Ideally we would fix this at the problematic call sight in the compressor. Since we don't want to force evaluation of the mask in the scan path

I think I might need a pointer. This fill null is a result of a take caused by canonicalization of an outer dict in the compressor. I believe we want this fill null to not be eagerly evaluated in a take to not affect the general path. AFAIU, we already evaluate offsets/sizes in rebuild and were just not doing so for validity, so in my mind rebuild is the place to evaluate this. Do we rebuild on scans even if the type matches? That seems expensive for other reasons if so.

…ssion

If a ListView is a child of a Dictionary which is canonicalized during
compression, Take is executed on the ListView and subsequently its validity
slice. This could result in a lazy FillNull array wrapping the validity which
was never executed, causing a panic on serialization
"Array vortex.fill_null does not support serialization". This PR executes the
validity on rebuild, similar to how offsets/sizes are already executed
implicitly via to_primitive.

Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>
@asubiotto asubiotto force-pushed the asubiotto/fillnull branch from fae0685 to 6f59c9a Compare March 5, 2026 10:29
@joseph-isaacs
Copy link
Contributor

@asubiotto
Copy link
Contributor Author

This is the fix: https://github.com/vortex-data/vortex/pull/6797/changes

Ok, thanks! Much cleaner

@asubiotto
Copy link
Contributor Author

Superseded by #6797

@asubiotto asubiotto closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants