Add PforEncoding (Patched FOR) — claiming EncodingType::Pfor = 15#728
Open
han-yan01 wants to merge 1 commit into
Open
Add PforEncoding (Patched FOR) — claiming EncodingType::Pfor = 15#728han-yan01 wants to merge 1 commit into
han-yan01 wants to merge 1 commit into
Conversation
|
@han-yan01 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105270894. |
9395ab1 to
f52adf5
Compare
f52adf5 to
e913f96
Compare
Summary: PFOR is a sparse-outlier patched Frame-of-Reference encoder ported from MRS's AusList SOTA encoder portfolio (D97646777). Bitpacks the bottom 90th-percentile of residuals at base bitwidth, stores the top 10% as (position, full value) exception patches. Wins on columns with rare large outliers where a pure FOR would inflate bitwidth to cover the worst case. Wire format: [encType:1B][dataType:1B][rowCount:4B][min:GV32][baseBitWidth:1B][numExceptions:varint][exceptionPositions:varint[]][exceptionValues:varint[]][bitpacked baseResiduals][7B zero-pad tail] Decode follows the post-D98819389-style optimization: pass 1 bitunpacks all residuals via byte-aligned loadU64; pass 2 patches the exceptions in. Slot allocation: claiming EncodingType::Pfor = 15. Per WS8 audit (T271476729), slots 12/13/14 are contested by 4+ in-flight diffs (D103045783 ChunkedBitPacking=12, D103975634 FOR=13/SubIntSplit=14, D105064770/D105134978 Fsst=12/14, plus implied ChunkedALP=13). 15 is the next free slot at time of commit. If a contending diff lands first claiming 15, this diff will need rebase to next free. Initial readFactor: 1.5 (conservative). Prevents auto-selection by ManualEncodingSelectionPolicy until baked in. Mirrors ChunkedBitPacking pattern. Stale-binary risk: xldb/disco/user_experiments/util/WriteConfigurationUtil.cpp persists EncodingType through Configerator. Older readers will throw NIMBLE_UNREACHABLE on EncodingType::Pfor=15 until they pick up this build — fail-loud, not silent. Differential Revision: D105270894
e913f96 to
0d2047e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
PFOR is a sparse-outlier patched Frame-of-Reference encoder ported from MRS's AusList SOTA encoder portfolio (D97646777). Bitpacks the bottom 90th-percentile of residuals at base bitwidth, stores the top 10% as (position, full value) exception patches. Wins on columns with rare large outliers where a pure FOR would inflate bitwidth to cover the worst case.
Wire format: [encType:1B][dataType:1B][rowCount:4B][min:GV32][baseBitWidth:1B][numExceptions:varint][exceptionPositions:varint[]][exceptionValues:varint[]][bitpacked baseResiduals][7B zero-pad tail]
Decode follows the post-D98819389-style optimization: pass 1 bitunpacks all residuals via byte-aligned loadU64; pass 2 patches the exceptions in.
Slot allocation: claiming EncodingType::Pfor = 15. Per WS8 audit (T271476729), slots 12/13/14 are contested by 4+ in-flight diffs (D103045783 ChunkedBitPacking=12, D103975634 FOR=13/SubIntSplit=14, D105064770/D105134978 Fsst=12/14, plus implied ChunkedALP=13). 15 is the next free slot at time of commit. If a contending diff lands first claiming 15, this diff will need rebase to next free.
Initial readFactor: 1.5 (conservative). Prevents auto-selection by ManualEncodingSelectionPolicy until baked in. Mirrors ChunkedBitPacking pattern.
Stale-binary risk: xldb/disco/user_experiments/util/WriteConfigurationUtil.cpp persists EncodingType through Configerator. Older readers will throw NIMBLE_UNREACHABLE on EncodingType::Pfor=15 until they pick up this build — fail-loud, not silent.
Differential Revision: D105270894