Commit 541c583
test: trace reductions and executions of scan ops over complex and compressed arrays (#8828)
## 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.com/claude-code)
https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR
---
_Generated by [Claude
Code](https://claude.ai/code/session_01RMBcCiwpC3dbGLXRbK7UuR)_
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 7d3ca20 commit 541c583
9 files changed
Lines changed: 1391 additions & 510 deletions
File tree
- encodings/runend
- src
- vortex-array/src/test_harness/trace
- vortex-btrblocks
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
0 commit comments