Skip to content

Add Affine integer encoding and default-ready AffineScheme - #11907

Closed
lwwmanning wants to merge 10 commits into
wm/for-v2-completefrom
wm/affine-default
Closed

lwwmanning wants to merge 10 commits into
wm/for-v2-completefrom
wm/affine-default

Conversation

@lwwmanning

@lwwmanning lwwmanning commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

This lands Affine (fastlanes.affine), building on #11489. Affine is a per-chunk FastLanes integer encoding with a scale and an optional slope. It is in the unstable edition, and AffineScheme now runs in the default BtrBlocksCompressor next to FoR.v2. CUDA mode, dictionary codes, and RunEnd ends do not use it.

Affine has chunk-pruned filter, take, and constant compare kernels, so selective scans and predicates do not decode the whole array. Before, AffineScheme::choose_mode ran a trial compression cascade for each mode. After, it estimates each mode's residual bit width and outlier patches directly, so a column that Affine does not suit costs almost nothing to encode.

On all 110 integer and temporal columns with Delta off, FoR.v2 and Affine together cut the compressed size by 19.22%. It goes from 859.97 MB to 694.65 MB, 17.93% less than with #11906 alone. With Delta on, the cut is 24.23% (651.55 MB). Total corpus encode is 4% faster, and every column round-trips bit-exactly through the wire format. On taxi.pickup_datetime, the size drops 53.4% (65.97 MB to 30.77 MB) and full decode is 7.1× faster. A 1% filter is 1.9–6.2× faster, and a constant < compare is 16.1× faster.

Stacked on #11906

Authored with AI assistance.


Devin Review

@lwwmanning lwwmanning added the changelog/feature A new feature label Nov 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T12:23:11.767268Z ab32591 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lwwmanning

Copy link
Copy Markdown
Contributor Author

Local 110-Column Combined FoR.v2 + Affine Ablation (Apple M4 Max, --release, MiMalloc)

All 110 integer and temporal columns across the cached benchmark corpus (97 native int + 13 timestamp/date: PBI Arade, Bimbo, CMSprovider, Euro2016, Food, HashTags, AirQuality, Taxi, TPC-H SF1) were compressed with real BtrBlocksCompressorBuilder::from_session configurations and verified 100% bit-exact on full round-trip, with wire-serde round-trip plus filter(1%) / take(1%) / compare(<) parity verified on all 28 Affine-selected column runs.

Corpus Totals (110 Columns)

Arm Edition / Config All 110 Cols (B) vs CORE Native Int 97 Cols (B) vs CORE TS/Date 13 Cols (B) vs CORE Total Enc (ms)
v1_noD CORE (FoR.v1) 859,967,213 +0.00% 539,793,608 +0.00% 320,173,605 +0.00% 3,935.2
v1_D PREVIEW (FoR.v1 + Delta) 792,343,521 -7.86% 490,066,759 -9.21% 302,276,762 -5.59% 3,938.8
for_v2_noD CORE + UNSTABLE (FoR.v2 only, #11906) 846,423,838 -1.57% 529,651,355 -1.88% 316,772,483 -1.06% 3,832.9
for_v2_D PREVIEW + UNSTABLE (FoR.v2 + Delta, #11906) 793,413,497 -7.74% 489,339,503 -9.35% 304,073,994 -5.03% 3,917.3
v2_aff_noD CORE + UNSTABLE (FoR.v2 + Affine) 694,652,889 -19.22% 524,931,643 -2.75% 169,721,246 -46.99% 3,773.7
v2_aff_D PREVIEW + UNSTABLE (FoR.v2 + Affine + Delta) 651,554,270 -24.23% 487,708,085 -9.65% 163,846,185 -48.83% 3,796.6

Per-Column Size Changes (All 29 Changed Columns; Remaining 81 Columns Byte-Identical)

Column Kind Rows v1_noD for_v2_noD v2_aff_noD v1_D for_v2_D v2_aff_D v2_aff_noD Encoding
taxi.pickup_datetime ts 19,144,903 65,967,104 65,967,104 30,766,890 65,967,104 65,967,104 30,766,890 affine[SCALE](bp(bw=12,p=318272);refs=vortex.dict)
taxi.dropoff_datetime ts 19,144,903 65,972,480 65,972,480 31,541,096 65,972,480 65,972,480 31,486,248 affine[SCALE](bp(bw=13,p=37415);refs=for.v2(...))
taxi.request_datetime ts 19,144,903 65,950,976 65,950,976 32,525,458 65,950,976 65,950,976 32,525,458 affine[SCALE](bp(bw=13,p=155786);refs=for.v2(...))
taxi.on_scene_datetime ts 19,144,903 68,053,785 68,053,785 33,924,249 68,053,785 68,053,785 33,924,249 affine[SCALE](bp(bw=13,p=36170);refs=for.v2(...))
euro2016.tweeted_at ts 2,052,497 10,778,892 9,465,614 4,288,180 2,497,926 2,482,040 1,179,358 affine[SCALE](bp(bw=16,p=20895);refs=for.v1(bp(bw=42)))
tpch_orders.o_orderkey int 1,500,000 4,312,960 2,250,240 562,566 82,456 67,736 17,697 affine[ALL](bp(bw=3);refs=vortex.sequence)
tpch_lineitem.l_orderkey int 6,001,215 8,625,920 6,563,200 5,081,004 1,582,251 1,567,715 1,536,668 affine[SLOPE](bp(bw=6,p=106030);refs=for.v2(...))
airquality.KafkaTimestamp ts 823,743 5,255,040 4,334,120 2,273,326 1,016,152 1,011,264 1,008,814 affine[SCALE](bp(bw=22);refs=vortex.primitive)
airquality.timestamp ts 823,743 5,255,040 4,334,120 3,301,417 2,161,989 2,157,101 2,088,010 affine[SCALE](vortex.primitive;refs=vortex.primitive)
food.activity_sec int 5,216,593 11,344,420 11,344,420 9,962,128 11,344,420 11,344,420 9,962,128 affine[SCALE](bp(bw=13,p=182638);refs=bp(bw=4))
hashtags.Calculation_6610227171140491 ts 511,511 2,688,000 2,512,148 1,267,014 1,230,743 2,512,148 1,267,014 affine[SCALE](bp(bw=19,p=5751);refs=vortex.primitive)
arade.F3 ts 9,888,775 994,560 924,408 575,888 167,879 709,368 342,416 affine[SCALE](vortex.runend;refs=for.v1(bp(bw=46)))
airquality.p_0_3 int 823,743 1,190,478 1,020,810 849,260 891,659 1,020,810 849,260 affine[SCALE](bp(bw=8,p=3652);refs=bp(bw=11,p=1))
bimbo.Dev_uni_proxima int 74,180,464 10,442,948 6,953,650 6,953,650 8,065,664 8,065,664 8,065,664 vortex.sparse (for.v2 child)
euro2016.id int 2,052,497 6,416,000 5,195,978 5,195,978 2,782,234 2,750,353 2,750,353 for.v2(bp(bw=20,p=6596);refs=bp(bw=25))
hashtags.twitter#in_reply_to_user_id int 511,511 701,203 487,082 487,082 701,203 487,082 487,082 for.v2(bp(bw=0,p=52367);refs=bp(bw=25,p=1))
airquality.p_0_5 int 823,743 1,034,848 840,282 840,282 702,925 840,282 840,282 for.v2(bp(bw=8,p=2199);refs=bp(bw=9,p=1))
airquality.pm_{1,2_5,10} (×2 w/ atm) int 823,743 2,703,792 1,985,286 1,985,286 2,703,792 1,985,286 1,985,286 for.v2(bp(bw=3);...)
hashtags.Contains:* (4 cols) int 511,511 111,888 101,256 100,770 57,469 57,469 57,469 vortex.sparse
hashtags.twitter#user#utc_offset int 511,511 63,367 63,367 67,321 40,739 40,739 43,717 affine[SCALE](vortex.runend;refs=vortex.dict)
tpch_partsupp.ps_partkey int 800,000 0 0 532 0 0 532 affine[SLOPE](vortex.sparse;refs=vortex.sequence)

Release Kernel & Encode Timings (Medians in ms; sca in ns/probe over 4,096 probes; _cl = clustered 1% chunks)

Column Arm Bytes Enc Dec sca (ns) f1% f1%_cl f10% f50% t1% t1%_cl t10% t50% cmp50 cmp1
taxi.pickup_datetime v1_noD / for_v2_noD (dict) 65,967,104 332.16 25.01 160.4 4.63 2.16 8.72 16.83 3.42 1.63 6.92 18.78 12.38 12.28
v2_aff_noD (affine[SCALE]) 30,766,890 232.13 3.52 426.1 2.43 0.35 5.09 10.00 1.88 0.95 5.86 7.23 0.77 0.71
euro2016.tweeted_at v1_noD (for.v1) 10,778,892 12.20 0.57 111.4 0.10 0.02 0.75 0.96 0.05 0.03 0.70 1.01 0.57 0.60
for_v2_noD (for.v2) 9,465,614 15.71 0.70 272.8 0.19 0.03 0.59 1.01 0.16 0.11 1.06 1.46 0.04 0.03
v2_aff_noD (affine[SCALE]) 4,288,180 33.15 0.36 409.4 0.14 0.03 0.51 1.01 0.12 0.10 0.56 0.65 0.05 0.05
v2_aff_D (affine[SCALE](delta)) 1,179,358 40.30 0.73 569.5 0.59 0.17 0.91 0.96 0.57 0.23 1.42 1.11 0.72 0.60
airquality.KafkaTimestamp v1_noD (for.v1) 5,255,040 8.86 0.19 62.5 0.03 0.01 0.22 0.42 0.02 0.01 0.26 0.34 0.24 0.24
v2_aff_noD (affine[SCALE]) 2,273,326 21.31 0.14 88.8 0.04 0.01 0.18 0.37 0.03 0.01 0.15 0.25 0.01 0.00
food.activity_sec v1_noD / for_v2_noD (dict) 11,344,420 35.65 2.39 297.2 0.53 0.05 1.49 1.82 0.21 0.07 0.92 2.48 2.74 1.12
v2_aff_noD (affine[SCALE]) 9,962,128 54.68 0.96 327.6 0.69 0.14 1.83 2.46 0.80 0.40 1.22 1.81 0.93 1.02
tpch_lineitem.l_orderkey v1_noD (runend) 8,625,920 40.67 3.41 1219.3 1.19 0.93 3.34 5.47 1.36 0.98 4.92 11.76 3.44 3.29
for_v2_noD (runend) 6,563,200 41.54 3.13 1204.3 1.20 0.96 3.42 5.47 1.20 0.99 4.70 12.40 3.09 2.98
v2_aff_noD (affine[SLOPE]) 5,081,004 70.95 1.58 363.9 0.75 0.30 1.42 3.69 0.69 0.30 2.17 2.52 0.32 0.25
tpch_orders.o_orderkey v1_noD (bp) 4,312,960 11.21 0.35 29.2 0.06 0.01 0.59 0.57 0.06 0.01 0.47 0.60 0.35 0.33
for_v2_noD (for.v2) 2,250,240 11.46 0.21 65.7 0.07 0.01 0.36 0.66 0.05 0.02 0.22 0.55 0.01 0.01
v2_aff_noD (affine[ALL]) 562,566 29.56 0.28 93.8 0.07 0.01 0.27 0.72 0.04 0.02 0.22 0.50 0.01 0.01
bimbo.Venta_uni_hoy (rejected) v1_noD (bp) 60,482,884 209.61 5.28 211.4 8.19 1.25 16.81 12.62 11.67 9.29 62.28 15.80 5.52 5.31
v2_aff_noD (bp) 60,482,884 210.33 5.16 250.9 8.27 1.21 16.90 12.51 11.92 9.33 63.28 16.02 5.19 5.20
bimbo.Cliente_ID (RunEnd.ends guard) v1_noD (runend) 72,178,568 573.07 63.21 2103.1 13.08 8.11 31.60 46.80 12.74 6.10 56.85 125.94 37.87 31.99
v2_aff_noD (runend) 72,178,568 573.73 58.84 2108.6 12.47 7.82 32.12 47.01 12.90 6.28 57.10 126.96 38.21 32.01
euro2016.id (two-tier for.v2) v2_aff_noD (for.v2) 5,195,978 30.63 0.19 241.1 0.14 0.02 0.47 0.39 0.27 0.19 1.88 0.89 0.03 0.02
airquality.pm_10 (two-tier for.v2) v2_aff_noD (for.v2) 342,078 3.43 0.04 287.3 0.04 0.01 0.11 0.09 0.05 0.05 0.35 0.28 0.05 0.03
taxi.trip_time (rejected) v2_aff_noD (bp) 31,086,700 46.29 8.68 274.2 1.88 0.36 5.24 9.59 2.70 2.23 16.47 11.65 3.97 3.97
tpch_lineitem.l_shipdate (rejected) v2_aff_noD (for.v1) 9,002,496 7.86 0.67 66.9 0.55 0.04 1.28 1.24 0.29 0.05 0.82 1.86 0.77 0.79

@codspeed

codspeed Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 12.34%

Warning

vortex-data has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 1 regressed benchmark
✅ 2042 untouched benchmarks
🆕 18 new benchmarks
⏩ 165 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime decode_chunked_neon[i64, 524288] 11.4 µs 13 µs -12.34%
🆕 Walltime affine_all_trend_neon N/A 23.6 µs N/A
🆕 Walltime affine_for_grid_neon N/A 24.3 µs N/A
🆕 Walltime affine_scale_grid_neon N/A 23.1 µs N/A
🆕 Walltime affine_slope_trend_neon N/A 23.6 µs N/A
🆕 Walltime for_chunked_grid_neon N/A 25 µs N/A
🆕 Walltime for_chunked_trend_neon N/A 41.6 µs N/A
🆕 Walltime affine_all_trend_avx512 N/A 16.7 µs N/A
🆕 Walltime affine_for_grid_avx512 N/A 18.3 µs N/A
🆕 Walltime affine_scale_grid_avx512 N/A 16.6 µs N/A
🆕 Walltime affine_slope_trend_avx512 N/A 16.7 µs N/A
🆕 Walltime for_chunked_grid_avx512 N/A 20.3 µs N/A
🆕 Walltime for_chunked_trend_avx512 N/A 21.5 µs N/A
🆕 Walltime affine_all_trend_avx2 N/A 20 µs N/A
🆕 Walltime affine_for_grid_avx2 N/A 22.6 µs N/A
🆕 Walltime affine_scale_grid_avx2 N/A 19 µs N/A
🆕 Walltime affine_slope_trend_avx2 N/A 19.9 µs N/A
🆕 Walltime for_chunked_grid_avx2 N/A 20.1 µs N/A
🆕 Walltime for_chunked_trend_avx2 N/A 23.6 µs N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing wm/affine-default (326d641) with wm/for-v2-complete (2527984)

Open in CodSpeed

Footnotes

  1. 165 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

The decode, slice, filter, take and compare math looks right. The encoder and every decoder apply the same wrapping model, the compare rewrites hold for all six operators and both scale signs, and the edition gating and CUDA exclusion work as described.

One bug needs a fix: validation accepts an unsigned residual child as wide as a signed dtype, and decode then panics (inline).

The rest repeats what came up on #11906, at about twice the size:

  1. The per-chunk decoders and the galloping patch fixup copy FoR v2's kernels. Affine with scale 1 and slope 0 is FoR v2, so the two encodings should share one set of kernels.
  2. About 2,200 lines of filter, take and compare kernels are optimizations. The encoding decodes correctly through the generic paths without them. Landing them later, with benches, would leave this PR as the encoding, the scheme and the edition wiring, which is where the risk is.
  3. The tuned thresholds in take, filter and the scheme have no bench behind them, and the 16x compare claim has no bench in the tree.
  4. compress reruns the estimate's sample cascades through a second copy of the mode decision.

///
/// Flat chunks (`scale == 1 && slope == 0`) unpack straight into `dst` with FastLanes' fused
/// `FoR::unchecked_unfor_pack`.
pub(super) struct AffineSameWidthBitPackedChunks<'a, T: PhysicalPType> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two chunk decoders are close copies of FoR v2's same-width and narrow decoders from #11906, and visit_surviving_patches in filter.rs re-implements FoR's galloping patch fixup. Could FoR's decoders take a per-chunk decode function, so both encodings call one copy?


/// Apply surviving [`BitPacked`] patches to `values` after `filter_chunked`, decoding each
/// surviving patch residual with the model of its original `(chunk, j)` position.
fn apply_filtered_patches<T>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This picks among four patch strategies, and visit_surviving_patches then picks between galloping and a bitmap scan with a 16x ratio. That is about 230 lines and two magic ratios with no benchmark. BitPacked's filter calls patches.filter(mask) and applies the result. Patches are rare by construction, so the simple path should be enough unless a bench shows otherwise.


/// Above this fraction of the array, fused full-array decode plus primitive gather beats sparse
/// chunked take.
const FULL_ARRAY_DECODE_RATIO: usize = 8;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ratios, and the 4096 switch in take_search, MAX_FUSED_DICT_VALUES, unpack_chunk_threshold, filter's ratios and the scheme's SAMPLE_CHUNKS, have no data in the repo, and no bench here covers take or filter. Please remove the ones no bench supports, or add the bench that chose them.

/// Select the [`AffineOptions`] to encode with during [`AffineScheme::compress`], matching
/// [`choose_mode`] while avoiding redundant sample cascades whenever Delta arbitration is not
/// needed.
fn choose_mode_for_compress(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

choose_mode_for_compress runs pre_estimate again and, when SCALE and a sloped mode are both viable, reruns measure_affine_bits and measure_delta_bits on the sample. The estimate already did those cascades. It also copies choose_mode's decision tree, and a comment is what keeps the two in sync. One function that returns the chosen AffineOptions for both callers would remove the drift risk.

pub slope: bool,
/// Fit only the least-squares slope, always, as LeCo-fix does, instead of choosing the
/// narrowest of several slopes and a zero slope. Requires `slope`.
pub least_squares: bool,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only tests use least_squares and AffineOptions::LECO, and the scheme never picks LECO. choose_slope_shift and choose_slope_shift_sampled share a body except for the chunk iteration, and so do evaluate and evaluate_pair. Removing LECO and merging each pair would shrink this file.

devin-ai-integration[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

devin-ai-integration[bot]

This comment was marked as resolved.

@lwwmanning

Copy link
Copy Markdown
Contributor Author

@codex review
@claude review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @lwwmanning's task in 54s —— View job


Review of #11907 at ab32591

  • Gather context (diff vs origin/wm/for-v2-complete, follow-up commits)
  • Verify fixes claimed in 0ec7d3e / ab32591
  • Review decode / compute kernels / plugin / scheme
  • Post review

I read the code only. I did not build it or run any tests or benchmarks.

Earlier findings: all confirmed fixed

  • Undefined behaviour from uninitialised output. Fixed. fused_decompress_typed (affine_decompress.rs:189-213) and AffineSameWidthBitPackedChunks::decode_chunk (compute/mod.rs:199-219) no longer transmute MaybeUninit<T> to &mut [T::Physical]. They unpack into an initialised scratch and then write() each value into the output.
  • Unsigned residuals as wide as the dtype. Fixed. validate_parts now requires a strictly narrower type (<). The plugin's match arms (1 if 1 < logical_bytes, …) reject equal widths, and 8 is no longer a valid encoded_bytes. This means compare_primitive_same_width and the patch fixup's as_slice::<T>() only ever see encoded_dtype == dtype.
  • Non-integer dtype in deserialize. Fixed. The dtype is checked as an integer Primitive before byte_width().
  • Signed dictionary codes. Fixed. Codes are now dispatched with match_each_integer_ptype!.
  • Logic inside match_each_*! bodies. Fixed. The patch loops, dictionary residual collection, scalar_at and the filter closures have moved into generic helpers.
  • Benchmark noise. Fixed. With 15-bit noise, the grid residuals after the gcd stay under u16::MAX, so affine_scale_grid now measures the bit-packed path.

New observations

  1. The UB fix gives up the in-place fused unpack on every full chunk (affine_decompress.rs:197-212, compute/mod.rs:200-218).
    • Every 1024-value chunk is now unpacked into scratch and then copied element by element. That includes the flat (unfor_pack) chunks that were meant to decode exactly like FoR.
    • The cost is an extra 8 KiB of store traffic per i64 chunk.
    • The decode numbers in the PR body and the ablation comment come from before 0ec7d3e. Please re-run affine_decode against for_chunked_* to confirm the 7.1x / FoR-parity claims still hold.
    • If they no longer hold, there are two sound ways to unpack straight into the output:
      • allocate the output initialised (zeroed or push_n) and pay one memset;
      • add an unpack entry point to the fastlanes crate that takes &mut [MaybeUninit<_>; 1024].
  2. decompress_dict panics on out-of-range codes (affine_decompress.rs:407, 415).
    • table[code.as_()] is bounds-checked, so a malformed file with a code ≥ values.len() panics the reader instead of returning an error. Now that signed codes are accepted, a negative code does the same.
    • Valid DictArrays can't hit this, and the generic dictionary path probably fails the same way, so this is low priority.
    • It is worth a vortex_ensure! on the code max, or a get() that returns an error, if malformed-file robustness is a goal for this encoding. The plugin hardening in ab32591 suggests it is.
  3. CodSpeed regression on decode_chunked_neon[i64, 524288] (−11.5%).
    • That benchmark is in for_decode.rs, which this PR doesn't touch.
    • It ran on a walltime leg that CodSpeed flags as unreliable, so it is most likely noise. It may still be worth acknowledging on CodSpeed so it doesn't block.

Still open from the earlier review (not re-argued)

  • The chunk decoders and the galloping patch fixup duplicate FoR v2's kernels.
  • About 2,200 lines of filter/take/compare optimisations, and tuned thresholds (FULL_ARRAY_DECODE_RATIO, the 16x bitmap/gallop ratio, MAX_FUSED_DICT_VALUES, unpack_chunk_threshold, SAMPLE_CHUNKS), have no take or filter benchmark in the tree.
  • choose_mode_for_compress repeats choose_mode's decision tree and re-runs the sample cascades.
  • LECO / least_squares is used only by tests.
  • Benchmark ordering. The reply that affine_decode "cannot compile before Affine exists" is right, so a benchmark-only PR isn't possible here. A follow-up that adds take/filter/compare benchmarks first, and then the kernels, would still give CodSpeed a baseline for the 1.9x–16x kernel claims.

Verdict

The correctness fixes hold, and I found no new correctness bugs in the decode, compare, plugin or validation changes. Before merging, confirm with affine_decode that the scratch-copy fix hasn't eaten the decode speedup. The structural points above are the remaining review risk.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@devin-ai-integration
devin-ai-integration Bot force-pushed the wm/affine-default branch 2 times, most recently from 5f3bde1 to 3bf1fa5 Compare November 24, 2026 12:31
@vortex-roborev-bot

vortex-roborev-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

roborev: Combined Review (326d641)

Verdict: No issues found.


Reviewers: claude-code | Synthesis: claude-code, 0s | Total: 3m17s, cost partial ~$1.61

@lwwmanning
lwwmanning marked this pull request as draft November 24, 2026 21:17
@devin-ai-integration
devin-ai-integration Bot force-pushed the wm/affine-default branch 2 times, most recently from 9d45762 to 2b2269b Compare November 25, 2026 00:14
devin-ai-integration[bot]

This comment was marked as resolved.

lwwmanning and others added 5 commits November 25, 2026 00:52
Adds the per-chunk FastLanes Affine encoding (fastlanes.affine) with fused BitPacked/Dict decompression, chunk-pruned filter/take/compare compute kernels, and a default-ready BtrBlocks AffineScheme gated behind the unstable edition and excluded in CUDA mode. Replaces multi-mode trial cascades with a direct residual bit-width and outlier-patch pre-estimator so rejected columns incur negligible encode overhead while preserving the two-tier boundary with FoR.v2 and excluding RunEnd/BoolRunEnd ends and dictionary codes.

Co-authored-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: Will Manning <will@willmanning.io>
…dings

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
…inks

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Devin Review

Comment thread encodings/fastlanes/src/affine/tests.rs Resolved
@lwwmanning

Copy link
Copy Markdown
Contributor Author

Closing after portfolio ablations: once FoR.v2, Delta, and an entropy leaf (vortex.rans / PIVCO) are present, Affine adds -0.32% net file-size savings (-7.6 MB across 10.39 GB raw) at a 12-15% encode throughput cost, and ~88% of its tabular delta comes from slopes == 0 cases where FoR.v2 cascading into the entropy leaf achieves the same result without a new wire format.

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

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant