Skip to content

test: trace reductions and executions of scan ops over complex and compressed arrays#8828

Open
joseph-isaacs wants to merge 5 commits into
adamg/execution-testsfrom
claude/tracing-reductions-executions-96t2p6
Open

test: trace reductions and executions of scan ops over complex and compressed arrays#8828
joseph-isaacs wants to merge 5 commits into
adamg/execution-testsfrom
claude/tracing-reductions-executions-96t2p6

Conversation

@joseph-isaacs

Copy link
Copy Markdown
Contributor

Summary

Stacked on #7814 (the trace_op execution/optimization tracing harness).

Builds out trace-test coverage for how take/filter/compare/like reduce and execute over complex arrays, using the harness from the base PR:

vortex-array (promotes test_harness/trace.rs to a directory module trace/mod.rs + trace/tests.rs; harness source unchanged):

  • take (DictArray) over a chunked array — no reduce rule fires; execution canonicalizes the chunked values chunk-by-chunk before the dict take kernel runs.
  • filter over a struct with complex children (dict-of-strings + chunked fields) — FilterStructRule pushes the filter into each field, FilterReduceAdaptor(Dict) rewrites the dict field at optimize time.
  • compare (Binary Eq vs constant) over a dict — DictionaryScalarFnValuesPushDownRule reduces the compare into the dictionary values.
  • like over a dict-of-strings — LikeReduceAdaptor(Dict) reduces into the dictionary values.

vortex-runend (new trace_tests.rs, insta added as dev-dependency):

  • compare vs constant reduces via RunEndScalarFnRule at optimize time; filter and take execute via the FilterExecuteAdaptor/TakeExecuteAdaptor parent kernels.

vortex-btrblocks (new trace_tests.rs; insta, tpchgen, tpchgen-arrow, arrow-array added as dev-dependencies): generates TPC-H lineitem (SF 0.001, 4096 rows, deterministic — tpchgen and the compressor's sampling seed are both fixed), compresses it with BtrBlocksCompressor, and traces TPC-H-style scan predicates over the resulting encodings:

  • l_shipdate >= const over ext(date) → for → bitpacked — extension compare kernel at execution time, with CastReduceAdaptor(FoR)/(BitPacked) reductions inside the arrow fallback.
  • l_quantity < const over decimal_byte_parts → dict → bitpacked — the decimal_byte_parts compare kernel pushes into the byte-parts dictionary, where DictionaryScalarFnValuesPushDownRule reduces the compare to the 50 dictionary values before decode.
  • l_shipmode = const over dict-of-FSST — dict pushdown at optimize time, FSST compare kernel + dict decode at execution time.
  • l_comment LIKE over FSST — the FSST like kernel matches in compressed space.
  • filter over a struct of compressed columns — FilterStructRule plus per-encoding pushdown via DecimalBytePartsFilterPushDownRule, ExtensionFilterPushDownRule, FoRFilterPushDownRule, and FilterReduceAdaptor(Dict), leaving execution a no-op.
  • take over a struct of compressed columns — TakeReduceAdaptor(Struct) absorbs the take entirely at optimize time.

Each btrblocks test also asserts the canonical result matches running the same operation over the uncompressed column. A 1MiB TPC-H text pool replaces the spec-default 300MiB one, cutting per-test setup from ~9s to ~0.5s without changing the traces.

Testing

This PR is tests-only; no production code changes.

  • cargo nextest run -p vortex-array — 2961 passed (includes the 8 trace tests, run in parallel to confirm the thread-local recorder is deterministic).
  • cargo nextest run -p vortex-runend — 61 passed.
  • cargo nextest run -p vortex-btrblocks — 43 passed.
  • cargo clippy --all-targets on the three touched crates — clean.
  • cargo +nightly fmt --all and git diff --check — clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR


Generated by Claude Code

joseph-isaacs and others added 4 commits July 17, 2026 10:43
…mplex arrays

Promote the trace test harness module to a directory module
(test_harness/trace/mod.rs + trace/tests.rs) and add snapshot tests that
trace how the optimizer and executor handle common operations over
complex arrays:

- take (DictArray) over a chunked array: no reduce rule fires; execution
  canonicalizes the chunked values chunk-by-chunk before the dict take
  kernel runs.
- filter over a struct array with complex children (dict-of-strings and
  chunked fields): FilterStructRule pushes the filter into each field and
  FilterReduceAdaptor(Dict) rewrites the dict field at optimize time.
- compare (Binary Eq vs constant) over a dict array:
  DictionaryScalarFnValuesPushDownRule reduces the compare into the dict
  values; execution shows the values-side binary kernel and the dict
  decode kernel.
- like (vs constant pattern) over a dict-of-strings array:
  LikeReduceAdaptor(Dict) reduces the like into the dict values.

Also add equivalent trace tests for run-end arrays in vortex-runend
(with insta as a new dev-dependency): compare reduces via
RunEndScalarFnRule at optimize time, while filter and take execute via
the FilterExecuteAdaptor/TakeExecuteAdaptor parent kernels.

Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
Generate TPC-H lineitem with tpchgen (SF 0.001, 4096 rows, deterministic),
compress it with the BtrBlocks compressor, and snapshot-trace the reduce
rules and execute kernels that fire for the scan operations TPC-H queries
perform over the resulting encodings:

- l_shipdate >= const over ext(date) -> for -> bitpacked: no reduce rule;
  the extension compare kernel fires at execution time, with
  CastReduceAdaptor(FoR)/(BitPacked) reductions inside the arrow fallback.
- l_quantity < const over decimal_byte_parts -> dict -> bitpacked: the
  decimal_byte_parts compare kernel pushes into the byte-parts dictionary,
  where DictionaryScalarFnValuesPushDownRule reduces the compare to the 50
  dictionary values before decode.
- l_shipmode = const over dict -> {bitpacked codes, fsst values}:
  DictionaryScalarFnValuesPushDownRule reduces at optimize time; the FSST
  compare kernel and dict decode kernel run at execution time.
- l_comment LIKE over fsst: the FSST like kernel matches in compressed
  space with no reduction.
- filter over a struct of compressed columns: FilterStructRule plus
  per-encoding pushdown via DecimalBytePartsFilterPushDownRule,
  ExtensionFilterPushDownRule, FoRFilterPushDownRule, and
  FilterReduceAdaptor(Dict), leaving execution a no-op.
- take over a struct of compressed columns: TakeReduceAdaptor(Struct)
  absorbs the take entirely at optimize time.

Each test also asserts the canonical result matches running the same
operation over the uncompressed column. A 1MiB text pool replaces the
spec-default 300MiB one, cutting per-test setup from ~9s to ~0.5s without
changing the traces. Adds insta, tpchgen, tpchgen-arrow, and arrow-array
as vortex-btrblocks dev-dependencies.

Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
CodSpeed builds compile with --cfg codspeed, under which vortex-array's
test_harness::trace module is configured out, so the new trace_tests
modules in vortex-btrblocks and vortex-runend failed to resolve their
imports. Gate both modules with #[cfg(all(test, not(codspeed)))] to match
the harness's own gating.

Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
clippy's tests_outside_test_module lint only recognizes a bare
#[cfg(test)] attribute, not #[cfg(all(test, not(codspeed)))]. Stack the
two cfg attributes instead; the gating semantics are identical.

Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
@joseph-isaacs joseph-isaacs added the changelog/chore A trivial change label Jul 17, 2026 — with Claude
@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 15.28%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

#### 🎉 Hooray! `codspeed-rust` just leveled up to 5.0.1!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

⚡ 5 improved benchmarks
✅ 1503 untouched benchmarks
🗄️ 15 archived benchmarks run1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_canonical_into[(1000, 10)] 199.6 µs 163 µs +22.51%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 215.1 µs 178.7 µs +20.4%
Simulation chunked_varbinview_canonical_into[(100, 100)] 322.2 µs 287.8 µs +11.95%
Simulation bitwise_not_vortex_buffer_mut[128] 275.3 ns 246.1 ns +11.85%
Simulation chunked_varbinview_into_canonical[(100, 100)] 376 µs 341 µs +10.26%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/tracing-reductions-executions-96t2p6 (4835772) with adamg/execution-tests (7d3ca20)

Open in CodSpeed

Footnotes

  1. 15 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

DCO Remediation Commit for Joe Isaacs <joe.isaacs@live.co.uk>

I, Joe Isaacs <joe.isaacs@live.co.uk>, hereby add my Signed-off-by to this commit: 3111cda
I, Joe Isaacs <joe.isaacs@live.co.uk>, hereby add my Signed-off-by to this commit: be141ea
I, Joe Isaacs <joe.isaacs@live.co.uk>, hereby add my Signed-off-by to this commit: a9c088a
I, Joe Isaacs <joe.isaacs@live.co.uk>, hereby add my Signed-off-by to this commit: bc55dd7

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant