Skip to content

fix(nimble): Estimate Dictionary alphabet cost and PFOR exception streams as min of bit-packed and raw Trivial (#957)#957

Open
duxiao1212 wants to merge 1 commit into
facebookincubator:mainfrom
duxiao1212:export-D111057748
Open

fix(nimble): Estimate Dictionary alphabet cost and PFOR exception streams as min of bit-packed and raw Trivial (#957)#957
duxiao1212 wants to merge 1 commit into
facebookincubator:mainfrom
duxiao1212:export-D111057748

Conversation

@duxiao1212

@duxiao1212 duxiao1212 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary:

DictionaryEncoding<T>::encode() serializes the alphabet via recursive encoding selection (encodeNested), so the alphabet is stored with the best encoding for it -- usually bit-packed FixedBitWidth, not raw Trivial. Same case for PFOR exception streams

Measured on a real MRS DataFM cluster index (exact-bit width on, all-1.0 read factors, 2000 input rows -> 11,839 KVs): 665,424,571 -> 658,483,444 bytes = -1.04%. Dictionary correctly wins more Int32/Int64 streams away from FixedBitWidth (FBW Int32 92MB->49MB, Dictionary Int32 72MB->119MB), all at smaller total size.

Differential Revision: D111057748

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 13, 2026
@meta-codesync

meta-codesync Bot commented Jul 13, 2026

Copy link
Copy Markdown

@duxiao1212 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111057748.

@meta-codesync meta-codesync Bot changed the title Estimate Dictionary alphabet cost as bit-packed, not raw Trivial fix[nimble]: Estimate Dictionary alphabet cost and PFOR exception streams as min of bit-packed and raw Trivial (#957) Jul 13, 2026
duxiao1212 added a commit to duxiao1212/nimble that referenced this pull request Jul 13, 2026
…eams as min of bit-packed and raw Trivial (facebookincubator#957)

Summary:

`DictionaryEncoding<T>::encode()` serializes the alphabet via recursive encoding selection (`encodeNested`), so the alphabet is stored with the best encoding for it -- usually bit-packed `FixedBitWidth`, not raw `Trivial`.  Same case for PFOR exception streams

Measured on a real MRS DataFM cluster index (exact-bit width on, all-1.0 read factors, 2000 input rows -> 11,839 KVs): 665,424,571 -> 658,483,444 bytes = -1.04%. Dictionary correctly wins more Int32/Int64 streams away from FixedBitWidth (FBW Int32 92MB->49MB, Dictionary Int32 72MB->119MB), all at smaller total size.

Differential Revision: D111057748
@meta-codesync meta-codesync Bot changed the title fix[nimble]: Estimate Dictionary alphabet cost and PFOR exception streams as min of bit-packed and raw Trivial (#957) fix(nimble): Estimate Dictionary alphabet cost and PFOR exception streams as min of bit-packed and raw Trivial (#957) Jul 13, 2026
duxiao1212 added a commit to duxiao1212/nimble that referenced this pull request Jul 13, 2026
…eams as min of bit-packed and raw Trivial (facebookincubator#957)

Summary:

`DictionaryEncoding<T>::encode()` serializes the alphabet via recursive encoding selection (`encodeNested`), so the alphabet is stored with the best encoding for it -- usually bit-packed `FixedBitWidth`, not raw `Trivial`.  Same case for PFOR exception streams

Measured on a real MRS DataFM cluster index (exact-bit width on, all-1.0 read factors, 2000 input rows -> 11,839 KVs): 665,424,571 -> 658,483,444 bytes = -1.04%. Dictionary correctly wins more Int32/Int64 streams away from FixedBitWidth (FBW Int32 92MB->49MB, Dictionary Int32 72MB->119MB), all at smaller total size.

Differential Revision: D111057748
…eams as min of bit-packed and raw Trivial (facebookincubator#957)

Summary:

`DictionaryEncoding<T>::encode()` serializes the alphabet via recursive encoding selection (`encodeNested`), so the alphabet is stored with the best encoding for it -- usually bit-packed `FixedBitWidth`, not raw `Trivial`.  Same case for PFOR exception streams

Measured on a real MRS DataFM cluster index (exact-bit width on, all-1.0 read factors, 2000 input rows -> 11,839 KVs): 665,424,571 -> 658,483,444 bytes = -1.04%. Dictionary correctly wins more Int32/Int64 streams away from FixedBitWidth (FBW Int32 92MB->49MB, Dictionary Int32 72MB->119MB), all at smaller total size.

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant