Skip to content
Open
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
c2f88a6
Removed the writer so that newest version of FastLanes can be used.
Aug 6, 2025
19d2795
comment benchmark/Makefile, it needs to be fixed
azimafroozeh Aug 6, 2025
30b967a
enable benchmarks
azimafroozeh Aug 6, 2025
16c86b4
reformat
azimafroozeh Aug 6, 2025
14ee8d6
reformat
azimafroozeh Aug 6, 2025
2b8fef5
Memory access changes.
Aug 7, 2025
9f90159
Implemented TPC-H for Parquet, DuckDB and FastLanes
Aug 7, 2025
c4dc7e4
Remove unused file
Aug 7, 2025
9295cf6
Update README.md
sebastiaan-dev Aug 7, 2025
f9eab0e
Added missing fls benchmark template
Aug 7, 2025
e14d6da
Added NOTE to README.md
Aug 7, 2025
b29e8a6
Merge branch 'azim_branch' of https://github.com/sebastiaan-dev/duckd…
Aug 7, 2025
a8df09e
Structured the materializer into multiple decoders with state.
Sep 11, 2025
3e62148
Moved column decoders into thread local state, seperated column decod…
Sep 11, 2025
2e15480
Merge branch 'azim_branch' into reader-only
Sep 11, 2025
a902966
Added physical type promotion to handle types across row groups. Adde…
Sep 20, 2025
bc3786d
Fixed empty parent path in FLS file generator. ISSUE: FLS_U08 corrupt…
Sep 20, 2025
50fdb6f
Initial row group pruning
Sep 21, 2025
2780bd7
Added filtering in DataChunks
Sep 21, 2025
bf91ed1
Expanded row group filtering to support both min,max. Fixed bug that …
Sep 22, 2025
7a3c455
Enabled adaptive filter.
Sep 22, 2025
15f14fe
Enabled filter_pushdown and filter_prune.
Sep 22, 2025
f9998f5
Refactored FastLanesReader into separate logical components.
Sep 22, 2025
1843078
Added files to CMakeLists.txt
Sep 22, 2025
94b542d
Separated the materializer into distinct decoding kernels.
Sep 27, 2025
7f0c1b4
Added generic filter execution for DataChunks, with optional direct f…
Sep 27, 2025
19b35e7
Separated out schema building from the FastLanes reader constructor. …
Sep 27, 2025
101f0e2
Moved initialization from the hot loop to TryInitializeScan, added th…
Sep 27, 2025
b08d7a4
Moved initialization from the hot loop to TryInitializeScan, added th…
Sep 27, 2025
fa727f7
Formatting
Sep 27, 2025
5406fce
Support all filters in the extension, enable filter pruning and filte…
Sep 27, 2025
69c91bf
Cleanup benchmarking setup.
Sep 27, 2025
53bf023
Added scripts to auto generate data and benchmark files for different…
Sep 28, 2025
93288f0
Reintroduce writer code.
Sep 28, 2025
f38c3c2
Formatting
Sep 28, 2025
8a9a554
Fix nullptr bug in Init() when there are no filters defined.
Sep 30, 2025
90c9d72
Cleanup decimal writing.
Sep 30, 2025
5b80bb8
When dealing with a decimal type override the promoted type.
Sep 30, 2025
a04edcd
Remove string usage to denote statistic keys.
Sep 30, 2025
db8ac84
Restructured metadata to be more efficient (no duplicate table descri…
Oct 1, 2025
2c6a0de
Added statistics.
Oct 2, 2025
557cf1b
Update scripts
Oct 2, 2025
846b43e
Add volumetric benchmark script.
Oct 3, 2025
83c3877
Added virtual column support and fixed statistics for non-numerical t…
Oct 4, 2025
015f661
Added union by name
Oct 5, 2025
470b97a
Update kernels
Oct 9, 2025
bd6bb31
Update scripts
Oct 9, 2025
47ad161
Removed unused headers
Oct 9, 2025
37dde0f
Support accessor FlatBuffers instead of using the object API.
Oct 10, 2025
eb1c661
Extended gitignore
Oct 10, 2025
d0885ad
Fix casting to set type, should have been template instead. Fix decim…
Oct 22, 2025
988a0a1
Bump DuckDB submodule to v1.4.1
Oct 30, 2025
96d9151
benchmark scripts based on duckdb
Oct 31, 2025
8301699
update benchmark script to dynamically stop
Oct 31, 2025
808623e
Update to DuckDB 1.4.0
Nov 1, 2025
1632cab
Updated scripts to generate data (do not overwrite metadata file)
Nov 2, 2025
89e4d4b
Add log to data generation
Nov 2, 2025
1cafcc9
Update data generation script to include all tpch scale factors
Nov 2, 2025
11395a6
Update kernels
Nov 13, 2025
b2efcc8
Fix ramdisk on ubuntu, fix incorrect batch calculation, modified benc…
Nov 14, 2025
1f1dae7
Reworked scripts used for benchmarking
Mar 23, 2026
ea7fada
Add fallback when dealing with MCC encodings (we expand to all columns)
Mar 23, 2026
9413c58
Clean up filter trial code.
Mar 23, 2026
797c23d
Moved reader specific functions into the fls_reader.cpp file.
Mar 24, 2026
2485778
Split TryInitializeScan into multiple domain specific functions
Mar 24, 2026
4303572
Fixed naming for row group tuple count in local state
Mar 24, 2026
d3dd63f
Split Scan function into multiple domain specific functions.
Mar 24, 2026
913c8c6
Remove old comment
Mar 24, 2026
62fc766
Refactored how we determine the mapping from requested columns in the…
Mar 24, 2026
d7408c6
Changed FastLanes dependency source in CMakeLists.txt
Mar 24, 2026
472b6bf
Remove benchmark scripts
Mar 24, 2026
4b03a41
Update README.md
Mar 24, 2026
0d9461d
Update README.md
Mar 24, 2026
1d5b33a
Rename fsst decode function, removed dead code
Mar 24, 2026
4ba0a35
Cleanup CMakeLists.txt
Mar 24, 2026
57c0a4f
Removed section from readme which currently is not implemented
Mar 24, 2026
81a89c4
Support DuckDB 1.5.6 with pinned FastLanes patches and regression tests
sebastiaan-dev Oct 14, 2026
18ab0f7
Reconcile dev and bench histories already squashed into main
sebastiaan-dev Oct 14, 2026
2a348d3
Include consolidated FastLanes writer and positional-I/O features
sebastiaan-dev Oct 14, 2026
e239e02
Document published archives and remote branch cleanup
sebastiaan-dev Oct 14, 2026
d19f23e
Build compatibility CI with Clang and repair formatting and tidy checks
sebastiaan-dev Oct 14, 2026
788c04a
Keep patches LF on Windows and use the manylinux Clang toolchain defa…
sebastiaan-dev Oct 14, 2026
d6d1f87
Fix native-reader regressions, tidy diagnostics, and Windows Clang fr…
sebastiaan-dev Oct 14, 2026
dc69118
Mirror native portability fixes and bound macOS build parallelism
sebastiaan-dev Oct 14, 2026
d2a63bf
Handle DuckDB deleted-export declarations under clang-cl; cache macOS…
sebastiaan-dev Oct 14, 2026
d792548
Mirror operand-vector safety and Windows native regression fixes
sebastiaan-dev Oct 14, 2026
0d6aa7c
Support floating-point dictionaries and improve Windows crash diagnos…
sebastiaan-dev Oct 14, 2026
97f02d0
Avoid MSYS linker-flag path conversion and complete native include fixes
sebastiaan-dev Oct 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Unified diffs prefix context lines with a space (including blank/tabbed lines).
patches/*.patch whitespace=-blank-at-eol,-space-before-tab
16 changes: 8 additions & 8 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:

duckdb-stable-build:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.3.2
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.5.6
with:
duckdb_version: v1.3.2
ci_tools_version: v1.3.2
duckdb_version: v1.5.6
ci_tools_version: v1.5.6
extension_name: fastlanes
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64_mingw;linux_amd64_musl;linux_amd64_gcc4'

code-quality-check:
name: Code Quality Check
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@main
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@v1.5.6
with:
duckdb_version: v1.3.2
ci_tools_version: main
extension_name: quack
format_checks: 'format;tidy'
duckdb_version: v1.5.6
ci_tools_version: v1.5.6
extension_name: fastlanes
format_checks: 'format;tidy'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vcpkg_installed/
.envrc.*

.ccache
.cache/

temp/
benchmark/data/
Expand Down
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,35 @@ message(STATUS "C++: ${CMAKE_CXX_COMPILER} (ID=${CMAKE_CXX_COMPILER_ID})")

#-----------------------------------------------------------------------------------------------------------------------
include(FetchContent)
if (POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif ()
option(FLS_EXTENSION_BUILD_EXAMPLES "Build Examples Option" OFF)
#### TODO: enable
option(FLS_ENABLE_CLANG_TIDY "Enable clang_tidy on all targets" OFF)

add_compile_definitions(FLS_EXTENSION_CMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")

# The extension relies on the writer, projection, table-API and positional-I/O
# patches in this revision, not vanilla cwida/FastLanes. Override locally with
# FETCHCONTENT_SOURCE_DIR_FLS_REPO (or FASTLANES_SOURCE_DIR via make).
# Include patch contents in the FetchContent command so an existing build
# reruns the patch step when this patch series changes.
set(FLS_PATCH_SIGNATURE "")
foreach(patch_file cmake/patch_fastlanes.cmake patches/fastlanes-build.patch
patches/fastlanes-branch-consolidation.patch)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${patch_file}")
file(SHA256 "${CMAKE_CURRENT_SOURCE_DIR}/${patch_file}" patch_hash)
string(APPEND FLS_PATCH_SIGNATURE "${patch_hash}")
endforeach()

FetchContent_Declare(
fls_repo
GIT_REPOSITORY https://github.com/sebastiaan-dev/fastlanes-patched
GIT_TAG dev
URL https://codeload.github.com/sebastiaan-dev/fastlanes-patched/tar.gz/7f91afdbd916d24ab5b39a990fbdf7d9157c0f69
URL_HASH SHA256=5cc986dab44d4a2d2b1fd8fd2e32645cd6cc1e9e03e950b1cb1615ee5415d5de
PATCH_COMMAND ${CMAKE_COMMAND} -DFLS_SOURCE_DIR=<SOURCE_DIR>
-DFLS_PATCH_SIGNATURE=${FLS_PATCH_SIGNATURE}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_fastlanes.cmake
)

FetchContent_MakeAvailable(fls_repo)
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ ifeq (${BUILD_BENCHMARK}, 1)
TOOLCHAIN_FLAGS:=${TOOLCHAIN_FLAGS} -DBUILD_BENCHMARKS=1
endif

# Optional local FastLanes checkout (otherwise CMake fetches the pinned patch stack).
ifneq ($(FASTLANES_SOURCE_DIR),)
override EXT_FLAGS += -DFETCHCONTENT_SOURCE_DIR_FLS_REPO="$(abspath $(FASTLANES_SOURCE_DIR))"
endif

# Include the Makefile from extension-ci-tools
include extension-ci-tools/makefiles/duckdb_extension.Makefile
# Include the Makefile used for benchmarking
include makefiles/bench.Makefile
24 changes: 24 additions & 0 deletions cmake/patch_fastlanes.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
find_package(Git REQUIRED)
set(patches fastlanes-build.patch fastlanes-branch-consolidation.patch)
# Archive sources live inside the extension's worktree. Do not let git discover
# that parent repository: git apply would then silently skip these paths.
get_filename_component(source_parent "${FLS_SOURCE_DIR}" DIRECTORY)
set(git_apply "${CMAKE_COMMAND}" -E env "GIT_CEILING_DIRECTORIES=${source_parent}"
"${GIT_EXECUTABLE}" apply)

# FetchContent can rerun its patch step when reconfiguring. Accept an already
# applied patch, but fail rather than silently building an incompatible source.
foreach(patch_name IN LISTS patches)
set(patch "${CMAKE_CURRENT_LIST_DIR}/../patches/${patch_name}")
execute_process(COMMAND ${git_apply} --reverse --check "${patch}"
WORKING_DIRECTORY "${FLS_SOURCE_DIR}"
RESULT_VARIABLE already_applied OUTPUT_QUIET ERROR_QUIET)
if (NOT already_applied EQUAL 0)
execute_process(COMMAND ${git_apply} "${patch}"
WORKING_DIRECTORY "${FLS_SOURCE_DIR}"
RESULT_VARIABLE result ERROR_VARIABLE error)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Could not apply ${patch_name}: ${error}")
endif ()
endif ()
endforeach()
59 changes: 59 additions & 0 deletions docs/branch-consolidation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Branch consolidation audit

The consolidation target is `fix/duckdb-1.5.6`. The repository origin now uses
`git@github.com:sebastiaan-dev/duckdb-fastlanes.git` locally. Public submodule and
FetchContent download URLs are intentionally unchanged.

| Branch | Original tip | Decision |
| --- | --- | --- |
| `dev` | `57c0a4f` | Its entire `src/` tree matches origin/main. Main includes this work through squash commit `1be8b5f` (#43); the only remaining differences are obsolete CMake comments and README content. Reconcile history without replacing the 1.5.6 code. |
| `bench` | `d7408c6` | Ancestor of dev. Its benchmark scripts were deliberately removed in `472b6bf`, and the FSST changes after bench are already present. Do not resurrect the removed harness. |
| `main` | `c6b6bcd` | Retain the default branch and existing main worktree unchanged. |

A history-only merge of dev makes both dev and bench ancestors of the current
branch, while preserving the tested source tree. This is deliberate reconciliation
of squash-merged work, not a replacement of the current implementation with the
old branch contents.

## FastLanes feature additions

The paired fork audit identified two useful missing features:

- Forward Connection footer, sample size and forced encoding options into the
writer, including the WithSampleSize builder method (`ad34adf` from update).
Keep the declared physical types when an encoding is forced, rather than
narrowing the column before applying its codec.
- Defer read-only file opening while retaining thread-safe positional reads
(adapted from task/ifstream-to-pread). Also handle I/O failure and EOF in Release
instead of relying on disabled assertions.

They are included in `patches/fastlanes-branch-consolidation.patch`, on top of
`fastlanes-build.patch`. CMake fingerprints the patch series so existing downloaded
source builds run the patch step again when it changes. The patch helper accepts
an already-applied patch, including upgrading the previous build-patch-only source.
Local FastLanes overrides remain untouched by patch application.

The fork's `docs/branch-consolidation.md` contains the complete branch audit and
the six standalone regression cases. Build those through this extension with:

```sh
CMAKE_BUILD_PARALLEL_LEVEL=8 make release GEN=ninja \
FASTLANES_SOURCE_DIR=../FastLanes.fix-duckdb-1.5.6 \
EXT_FLAGS=-DFLS_BUILD_STANDALONE_TESTS=ON
build/release/_deps/fls_repo-build/test/standalone/fastlanes_integration_test
make test
```

## Recovery and deletion status

Original branch tips are preserved locally and on GitHub as annotated tags under
`archive/branch-consolidation/origin/<branch>`. The previous integration commit is
`archive/branch-consolidation/current`. A verified full Git bundle is stored at
`~/repos/duckdb-fastlanes/.git/branch-archives/pre-consolidation.bundle`.

The consolidated `fix/duckdb-1.5.6` branch and all archive tags are published.
After verifying the remote archives, `dev` and `bench` were deleted using an
atomic push with exact-tip leases. Local remote-tracking refs were pruned.
`main` and the repository default branch remain unchanged. There were no
redundant local feature branches to delete, only main and the integration
worktree branch.
114 changes: 114 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Building against DuckDB 1.5.6

## Dependencies

- DuckDB submodule: `v1.5.6` (`069cc9f9b5b`)
- extension-ci-tools submodule: `v1.5.6` (`3dc5c2a2754`)
- FastLanes: `sebastiaan-dev/fastlanes-patched` at
`7f91afdbd916d24ab5b39a990fbdf7d9157c0f69`, plus
[`patches/fastlanes-build.patch`](../patches/fastlanes-build.patch) and
[`patches/fastlanes-branch-consolidation.patch`](../patches/fastlanes-branch-consolidation.patch).

Use Clang (13 or newer), CMake (3.22 or newer), Ninja, Git and Python 3.
The pinned FastLanes version requires C++20 and Clang; GCC is not supported by
this patch stack. Local validation was on macOS arm64 with Apple Clang 21.
Linux, Windows and WASM have not been validated by this migration.

## Reproducible build

```sh
git submodule update --init --recursive
CC=clang CXX=clang++ CMAKE_BUILD_PARALLEL_LEVEL=10 make release GEN=ninja
make test
```

CMake downloads a SHA-256-verified archive of the pinned FastLanes revision and
applies the checked-in patch series. It does not follow a moving `dev` branch.
The build patch respects the embedding project's compiler/toolchain and fixes the
`TypedStats<std::string>` null-pointer construction caught by current Clang.
The consolidation patch restores writer option forwarding and safe deferred
positional I/O; see [the branch audit](branch-consolidation.md).

Outputs:

- CLI with FastLanes linked in: `build/release/duckdb`
- Loadable extension: `build/release/extension/fastlanes/fastlanes.duckdb_extension`
- Test runner: `build/release/test/unittest`

The loadable extension must be loaded into **DuckDB 1.5.6**, not another DuckDB
version. Locally built extensions are unsigned, so use `duckdb -unsigned` when
loading the binary into a separate CLI.

## Paired Worktrunk workspaces

The repositories and worktrees are siblings under `~/repos`:

| Repository | Worktree | Branch |
| --- | --- | --- |
| `FastLanes` | `FastLanes.fix-duckdb-1.5.6` | `fix/duckdb-1.5.6` |
| `duckdb-fastlanes` | `duckdb-fastlanes.fix-duckdb-1.5.6` | `fix/duckdb-1.5.6` |

```sh
wt -C ~/repos/FastLanes switch fix/duckdb-1.5.6
wt -C ~/repos/duckdb-fastlanes switch fix/duckdb-1.5.6

cd ~/repos/duckdb-fastlanes.fix-duckdb-1.5.6
CC=clang CXX=clang++ CMAKE_BUILD_PARALLEL_LEVEL=10 make release GEN=ninja \
FASTLANES_SOURCE_DIR=../FastLanes.fix-duckdb-1.5.6
make test
```

`FASTLANES_SOURCE_DIR` maps to CMake's `FETCHCONTENT_SOURCE_DIR_FLS_REPO`.
With this override, CMake uses the worktree **as-is** and does not download or
patch it. The FastLanes worktree already contains the same fixes and features.
To return to the downloaded source in an existing build directory, pass
`EXT_FLAGS=-DFETCHCONTENT_SOURCE_DIR_FLS_REPO=` (CMake caches this override).

## Patch provenance

The older branches in `sebastiaan-dev/FastLanes` contain the lambda writer,
parallel/out-of-order row-group writer, CMake overrides and positional-read
experiments. The extension's current main branch already depends on a newer,
consolidated stack in the separate `fastlanes-patched` repository:

- `6c48943`: projection support
- `55c5e40`: minimum statistics metadata
- `01aa52a`: preserve DATE schema information
- `5d60b2e`, `24732f1`: owned spans and vector removal
- `4cddc20`, `8d69b15`, `8981180`: multithreaded/positional I/O and buffer pooling
- `f13af16`: writer and larger row groups
- `7a87f06`, `64b0341`, `7f91afd`: table-API integration and buffer-pool completion

The FastLanes worktree starts from that consolidated revision, imported via the
`patched` remote; its `origin` still points to `sebastiaan-dev/FastLanes`, and
`upstream` points to `cwida/FastLanes`. This preserves the extension's required
patches without mixing in incompatible intermediate experiments. It is **not**
a rebase onto the latest `cwida/FastLanes/dev`. Subsequent consolidation restores
useful missing work from `update` and `task/ifstream-to-pread` and reconciles
superseded branch histories; see [the branch audit](branch-consolidation.md).

## Migration and tests

The 1.5.6 adaptation uses `AsyncResult` for scans and reusable dictionaries for
string materialization. Dictionary selection buffers are owned per output
chunk. Per-file filter/decoder state is reset when MultiFileFunction reuses a
worker for a different reader, while filter references keep their reader alive.
It also fixes reader counters/bind-info access, string dictionary offsets,
and adds the missing BOOLEAN bitmap materializer exposed by the existing tests.

`make test` runs the existing single-/multi-threaded type tests and portable
regressions for projections, count-only scans, filters, partial vectors, virtual
row numbers, multiple files, union-by-name, string dictionaries, BOOLEAN values,
and ordered/unordered parallel COPY over multiple row groups.

Validation on macOS arm64:

- Full Release build and all **175 assertions in 4 test cases** pass with the
paired FastLanes worktree and independently with the downloaded/patched source.
- The SQL regressions passed 20 consecutive runs after the multi-file state fix.
- Loading into the official DuckDB 1.5.6 CLI succeeds; a 200,003-row parallel
round trip and BOOLEAN filter also pass.

This is build/API compatibility and regression coverage, not a claim of complete
format support. Existing limitations such as general NULL/nested-type support
and full logical-type preservation remain outside this migration.
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 4990 files
Loading
Loading