Skip to content

refactor: simplify compute, remove dead code, fix ComputeKernelBenchmark - #597

Merged
dfa1 merged 3 commits into
mainfrom
refactor/compute-simplify
Oct 24, 2026
Merged

dfa1 merged 3 commits into
mainfrom
refactor/compute-simplify

Conversation

@dfa1

@dfa1 dfa1 commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Three commits:

  • refactor(compute): drop Compute.filteredSum (no caller outside a benchmark; filteredAggregate already folds a filtered SUM) with its 393-line FusedFilterSum kernel, the dict lane's sum-only loops, and its separate COUNT(*) scan (now the long fold with no aggregate column). The package goes from 3,380 to 2,687 lines; DictFilterTest now also checks COUNT(*), which had no test.
  • fix(performance): ComputeKernelBenchmark failed in every fork's setup (it asserted 100 chunks; the writer repartitions into 763 since Writer: repartition columns before compressing, as Rust's write strategy does #470), and JMH skips teardown after a failed setup, so each fork left a 1.2 GB temp file. Setup now checks the total row count and cleans up on failure.
  • refactor: dead code from a reference scan plus Sonar: the no-op WriteOptions.compressionRatioThreshold, the TUI's unused progress parameter and overloads, test-only LeBitReader.byteOffset / ChunkSpec.sliceOffsetFor, an unused DictColumnState accessor, 13 copies of an unused test helper.

./mvnw verify green locally (3043 integration tests). No CHANGELOG entry: dead-API removal.

🤖 Generated with Claude Code

dfa1 and others added 3 commits October 23, 2026 22:07
…t path

Compute.filteredSum had no caller outside a benchmark: Calcite and the CLI
use filteredAggregate, matcher and groupedAggregate, and filteredAggregate
already folds a filtered SUM (with MIN/MAX and counts) in one pass. Its
393-line FusedFilterSum kernel goes, with the dict lane's sum-only loops
(DictFilter.tryFilteredSum, sumLong, sumDouble) and the helpers only they
used (NumericColumns.requireNumeric, isFloating).

The dict lane also counted COUNT(*) with its own three-shape scan
(tryFilteredCount, count): it is now the long fold with no aggregate column,
so one scan serves both. DictFilterTest's oracle runs through
filteredAggregate and also checks the COUNT(*) count, which had no test.
ComputeKernelBenchmark's fusedFilteredSumAlp becomes fusedFilteredAggregateAlp
on the same workload; the dict sum-only method goes, as
fusedFilteredAggregateDict measures that lane.

The compute package drops from 3,380 to 2,687 lines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…up cleans up

Setup asserted 100 chunks, one per writeChunk batch, but the writer has
repartitioned into Rust-sized chunks since #470 (763 here), and it asserted
measure decodes to a LazyForLongArray, which it no longer does. Every fork
failed in setup. It now checks the total row count and asserts only the two
filter columns' encodings (ALP price, dict category), the ones that pick a
kernel lane.

JMH skips the teardown of a failed setup, so each failed fork left its
1.2 GB file in the temp directory: 62 had piled up (74 GB). A failed setup
now runs the teardown itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Nothing in the project read these:
- WriteOptions.compressionRatioThreshold: always 0.90, copied through every
  withXxx and never consulted by the writer, a knob that did nothing
- the TUI's progress parameter ("unused; kept for API stability") and its
  two show overloads nothing called, with TuiCommand's progress bar built
  only to be passed in; the shallow tree build has no peeks to report
- LeBitReader.byteOffset, ScanIterator.ChunkSpec.sliceOffsetFor and
  DictColumnState.chunkValidity(int), reached only from tests or not at all
- DictEncodingEncoder.encodeUtf8Cascade's unused ctx, a swap assignment in
  PcoHistogram.medianOfThree that is never read, two pattern variables
  named "ignored" (now _)
- in tests, thirteen copies of an unused private scalar(byte[]) helper and
  an unused expected-top-value local in ArrayStatsTest

The tests that observed byteOffset and sliceOffsetFor now check the same
invariants through the next read and the record's own components.
docs/reference.md drops the threshold and no longer calls WriteOptions a
record.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 31fb1b6 into main Oct 24, 2026
11 of 12 checks passed
@dfa1
dfa1 deleted the refactor/compute-simplify branch October 24, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant