Skip to content

Add PIVCO compute pushdown kernels and fused ZigZag execution - #12356

Open
lwwmanning wants to merge 1 commit into
wm/pivco-simd-decodefrom
wm/pivco-compute
Open

lwwmanning wants to merge 1 commit into
wm/pivco-simd-decodefrom
wm/pivco-compute

Conversation

@lwwmanning

Copy link
Copy Markdown
Contributor

Stacked on #12355

Adds direct compute pushdown kernels for PivcoArray: spine-walking CompareKernel on order-preserving trees (resolving range predicates without decoding values), block-skipping SliceReduce, FilterKernel, TakeExecute, and fused ZigZag(Pivco) parent execution. Verified with hegeltest property tests covering check_encoding_roundtrip_and_ops and fused ZigZag(Pivco) compute parity against canonical arrays.

Authored with AI assistance.

Adds direct spine-walking CompareKernel predicate pushdown, block-skipping
SliceReduce, FilterKernel, TakeExecute, and fused ZigZag(Pivco) parent
execution, verified via Hegel check_encoding_roundtrip_and_ops and
ZigZag(Pivco) property tests.

Co-Authored-By: Antigravity <noreply@google.com>
Signed-off-by: Will Manning <will@willmanning.io>
@lwwmanning lwwmanning added the changelog/feature A new feature label Nov 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T01:01:34.488421Z cc26810 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc26810de2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +111 to +115
impl SliceReduce for Pivco {
fn slice(array: ArrayView<'_, Self>, range: Range<usize>) -> VortexResult<Option<ArrayRef>> {
let validity = Self::validity(array)?.slice(range.clone())?;
let data = array.data().slice(array.len(), range.clone())?;
Ok(Some(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep slice reduction free of buffer reads

When the Pivco buffers are host-resident, this SliceReduce implementation calls PivcoData::slice, which reads entries from block_headers to trim the payloads. SliceReduce is explicitly the metadata-only path and is invoked during optimizer reduction through the rule registered in lib.rs; buffer-reading implementations belong in SliceKernel. Preserve the existing payloads and base offsets as the device path already does, or register this as an execute kernel, so logical reduction cannot synchronously inspect array data.

Useful? React with 👍 / 👎.

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

I read the compare pushdown against decode-then-compare and found no wrong result. I checked Eq and NotEq on absent symbols and on values of 32 or more. I also checked the four ordering operators at 0 and u64::MAX, negative signed constants, null lhs rows, and slices with a non-zero offset. I read take and filter for null indices, sliced offsets and empty input, and found no mismatch.

The Codex comment on SliceReduce is right. The trait contract says the reduce must not read buffers, but the host branch of PivcoData::slice reads two block headers. The device branch already keeps the payloads and base offsets and slices only the header handle. The host branch can do the same.

That change costs nothing. slice_with_alignment is zero-copy, so trimming on host frees no memory. Serialize already trims, and test_untrimmed_windowed_slice_trims_on_serialize covers that. The change removes about 45 lines.

take_ordered_blocks repeats take_scattered_blocks. The grouped path gives the same result for sorted indices, at the cost of two small index vectors. Please remove the ordered path, or keep it only if a bench shows a gain.

SCALAR_BLOCK_HIT_THRESHOLD = 4 and FULL_ARRAY_DECODE_RATIO = 8 have no measurement. The benches in #12358 run take and filter only at 1%. One line with the crossover numbers would justify both values.

The x86 gap from #12355 also applies here. pack_64_bytes01_avx2 has not run in CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant