Skip to content

[WIP][POC] Pgaur on pair evaluation - #50791

Draft
prtkgaur wants to merge 21 commits into
apache:mainfrom
prtkgaur:pgaurOnPairEvaluation
Draft

[WIP][POC] Pgaur on pair evaluation#50791
prtkgaur wants to merge 21 commits into
apache:mainfrom
prtkgaur:pgaurOnPairEvaluation

Conversation

@prtkgaur

@prtkgaur prtkgaur commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for opening a pull request!

If this is your first pull request you can find detailed information on how to contribute here:

Please remove this line and the above text before creating your pull request.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

This PR includes breaking changes to public APIs. (If there are any breaking changes to public APIs, please explain which changes are breaking. If not, you can remove this.)

This PR contains a "Critical Fix". (If the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld), please provide explanation. If not, you can remove this.)

ArnavBalyan and others added 21 commits November 23, 2025 14:05
A C++ implementation of the OnPair short-string codec (arXiv:2508.02280):
a trained dictionary of up to 16-byte tokens, greedy longest-prefix
tokenization, and a branch-free gather-copy decode that keeps per-row
random access. The dictionary budget is configurable from 9 to 16 bits;
codes are bit-packed at the dictionary's true width.
Splits each value into a shared prefix and a suffix before the symbol
table sees it, following the FSST+ thesis (Alexandre, CWI 2025). Used to
measure whether prefix extraction adds anything on top of either codec.
Measures FSST, OnPair, the prefix-extraction variants and zstd/lz4 pages
on one corpus set, on three axes: compression ratio, whole-column decode
with per-row random access, and encode. Every codec is charged a
bit-packed per-row length array so column reconstruction costs the same
across all of them. bench_common.h holds the timing and bit-packing
helpers shared with the cascade benchmark.

The Rust helper generates the corpora: TPC-H string columns, the OnPair
paper's real-world datasets, ClickBench columns, and synthetic
identifier and JSON sets.
Measures the native Parquet pages as libparquet writes them, each on its
own and followed by zstd(1) or lz4, against FSST and OnPair with and
without a generic codec on top. Also measures the dictionary-then-OnPair
cascade, which dictionary-encodes the column and OnPairs only the
distinct values.

Native pages are charged only what the writer emits, since they carry
their own lengths; the candidate codecs are charged a separate length
array. Auto-budget selection runs in per-corpus setup, outside the timed
region, as every codec's parameter choice does.
The roundtrip checker now runs every dictionary budget from 9 to 16
rather than only 16, for both the plain and the dedup layout, and exits
non-zero on any mismatch so it can gate a benchmark run. The packed
decode loop is templated on the code width and the auto budget picks a
width per column, so checking only 16 left the width the benchmarks
report unverified.

The width sweep answers whether a wider code decodes faster without the
confound a budget sweep carries. It holds one trained dictionary and its
code stream fixed and re-packs the same codes at every width up to 16,
so tokens, token count and copy width are identical and only the
unpacking differs.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for opening a pull request!

This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format.

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

After updating the title, you can mark the pull request as ready for review.

See also:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants