diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50e65a8..b3267d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,10 +37,10 @@ jobs: - run: make installcheck - if: ${{ failure() }} run: cat regression.diffs - - run: | - sudo apt-get update - sudo apt-get install libipc-run-perl - - run: make prove_installcheck + # - run: | + # sudo apt-get update + # sudo apt-get install libipc-run-perl + # - run: make prove_installcheck mac: runs-on: ${{ matrix.os }} if: ${{ !startsWith(github.ref_name, 'windows') }} @@ -65,21 +65,21 @@ jobs: - if: ${{ failure() }} run: cat regression.diffs # Homebrew Postgres does not enable TAP tests, so need to download - - run: | - brew install cpanm - cpanm --notest IPC::Run - wget -q https://github.com/postgres/postgres/archive/refs/tags/$TAG.tar.gz - tar xf $TAG.tar.gz - mv postgres-$TAG postgres - env: - TAG: ${{ matrix.postgres == 18 && 'REL_18_0' || 'REL_14_19' }} - - run: make prove_installcheck PROVE_FLAGS="-I ./postgres/src/test/perl -I ./test/perl" - env: - PERL5LIB: /Users/runner/perl5/lib/perl5 - - run: make clean && $(brew --prefix llvm@$LLVM_VERSION)/bin/scan-build --status-bugs make - env: - LLVM_VERSION: ${{ matrix.os == 'macos-26' && 20 || 18 }} - PG_CFLAGS: -DUSE_ASSERT_CHECKING + # - run: | + # brew install cpanm + # cpanm --notest IPC::Run + # wget -q https://github.com/postgres/postgres/archive/refs/tags/$TAG.tar.gz + # tar xf $TAG.tar.gz + # mv postgres-$TAG postgres + # env: + # TAG: ${{ matrix.postgres == 18 && 'REL_18_0' || 'REL_14_19' }} + # - run: make prove_installcheck PROVE_FLAGS="-I ./postgres/src/test/perl -I ./test/perl" + # env: + # PERL5LIB: /Users/runner/perl5/lib/perl5 + # - run: make clean && $(brew --prefix llvm@$LLVM_VERSION)/bin/scan-build --status-bugs make + # env: + # LLVM_VERSION: ${{ matrix.os == 'macos-26' && 20 || 18 }} + # PG_CFLAGS: -DUSE_ASSERT_CHECKING windows: runs-on: ${{ matrix.os }} if: ${{ !startsWith(github.ref_name, 'mac') }} @@ -106,38 +106,3 @@ jobs: shell: cmd - if: ${{ failure() }} run: cat regression.diffs - i386: - if: ${{ !startsWith(github.ref_name, 'mac') && !startsWith(github.ref_name, 'windows') }} - runs-on: ubuntu-latest - container: - image: debian:12 - options: --platform linux/386 - steps: - - run: apt-get update && apt-get install -y build-essential git libipc-run-perl postgresql-15 postgresql-server-dev-15 sudo - - run: service postgresql start - - run: | - git clone https://github.com/${{ github.repository }}.git pgvector - cd pgvector - git fetch origin ${{ github.ref }} - git reset --hard FETCH_HEAD - make - make install - chown -R postgres . - sudo -u postgres make installcheck - sudo -u postgres make prove_installcheck - env: - PG_CFLAGS: -DUSE_ASSERT_CHECKING -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare - - if: ${{ failure() }} - run: cat pgvector/regression.diffs - valgrind: - if: ${{ !startsWith(github.ref_name, 'mac') && !startsWith(github.ref_name, 'windows') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: ankane/setup-postgres-valgrind@v1 - with: - postgres-version: 18 - check-ub: yes - - run: make OPTFLAGS="" - - run: sudo --preserve-env=PG_CONFIG make install - - run: make installcheck diff --git a/src/bitvec.c b/src/bitvec.c index 094ddd2..8bdff95 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -2,6 +2,7 @@ #include "bitutils.h" #include "bitvec.h" +#include "fmgr.h" #include "utils/varbit.h" #include "vector.h" diff --git a/src/halfutils.c b/src/halfutils.c index d169094..2df4995 100644 --- a/src/halfutils.c +++ b/src/halfutils.c @@ -1,5 +1,7 @@ #include "postgres.h" +#include + #include "halfutils.h" #include "halfvec.h" diff --git a/src/halfvec.c b/src/halfvec.c index 6b926e1..6854c3d 100644 --- a/src/halfvec.c +++ b/src/halfvec.c @@ -13,12 +13,16 @@ #include "port.h" /* for strtof() */ #include "sparsevec.h" #include "utils/array.h" -#include "utils/builtins.h" #include "utils/float.h" +#include "utils/fmgrprotos.h" #include "utils/lsyscache.h" -#include "utils/numeric.h" +#include "utils/varbit.h" #include "vector.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif + #define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1) #define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1)) diff --git a/src/hnsw.c b/src/hnsw.c index 1d56ef6..50628e7 100644 --- a/src/hnsw.c +++ b/src/hnsw.c @@ -1,18 +1,21 @@ #include "postgres.h" #include +#include #include #include "access/amapi.h" #include "access/reloptions.h" #include "commands/progress.h" #include "commands/vacuum.h" +#include "fmgr.h" #include "hnsw.h" #include "miscadmin.h" #include "utils/float.h" #include "utils/guc.h" #include "utils/selfuncs.h" #include "utils/spccache.h" +#include "vector.h" #if PG_VERSION_NUM < 150000 #define MarkGUCPrefixReserved(x) EmitWarningsOnPlaceholders(x) diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 939f48f..976d816 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -36,8 +36,7 @@ */ #include "postgres.h" -#include - +#include "access/genam.h" #include "access/parallel.h" #include "access/table.h" #include "access/tableam.h" @@ -50,9 +49,14 @@ #include "miscadmin.h" #include "optimizer/optimizer.h" #include "storage/bufmgr.h" +#include "storage/condition_variable.h" +#include "storage/shm_toc.h" +#include "storage/shmem.h" #include "tcop/tcopprot.h" #include "utils/datum.h" #include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/snapmgr.h" #if PG_VERSION_NUM >= 160000 #include "varatt.h" @@ -66,7 +70,7 @@ #if PG_VERSION_NUM >= 140000 #include "utils/backend_status.h" -#include "utils/wait_event.h" +#include "utils/wait_event_types.h" #endif #define PARALLEL_KEY_HNSW_SHARED UINT64CONST(0xA000000000000001) diff --git a/src/hnswinsert.c b/src/hnswinsert.c index ddcead0..15b1483 100644 --- a/src/hnswinsert.c +++ b/src/hnswinsert.c @@ -1,7 +1,5 @@ #include "postgres.h" -#include - #include "access/generic_xlog.h" #include "hnsw.h" #include "storage/bufmgr.h" diff --git a/src/hnswscan.c b/src/hnswscan.c index 5c526f4..7a606cc 100644 --- a/src/hnswscan.c +++ b/src/hnswscan.c @@ -2,11 +2,16 @@ #include "access/relscan.h" #include "hnsw.h" +#include "nodes/pg_list.h" #include "pgstat.h" -#include "storage/bufmgr.h" #include "storage/lmgr.h" #include "utils/float.h" #include "utils/memutils.h" +#include "utils/snapmgr.h" + +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif /* * Algorithm 5 from paper diff --git a/src/hnswutils.c b/src/hnswutils.c index 13ecb9d..6a1b1d6 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -3,17 +3,18 @@ #include #include "access/generic_xlog.h" -#include "catalog/pg_type.h" -#include "catalog/pg_type_d.h" #include "common/hashfn.h" #include "fmgr.h" #include "hnsw.h" #include "lib/pairingheap.h" +#include "nodes/pg_list.h" +#include "port/atomics.h" #include "sparsevec.h" #include "storage/bufmgr.h" #include "utils/datum.h" #include "utils/memdebug.h" #include "utils/rel.h" +#include "vector.h" #if PG_VERSION_NUM >= 160000 #include "varatt.h" diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c index 1469874..dbbe0a9 100644 --- a/src/hnswvacuum.c +++ b/src/hnswvacuum.c @@ -1,12 +1,18 @@ #include "postgres.h" -#include - +#include "access/genam.h" #include "access/generic_xlog.h" #include "commands/vacuum.h" #include "hnsw.h" +#include "nodes/pg_list.h" +#include "storage/block.h" +#include "storage/buf.h" #include "storage/bufmgr.h" +#include "storage/bufpage.h" +#include "storage/itemptr.h" #include "storage/lmgr.h" +#include "storage/lockdefs.h" +#include "storage/off.h" #include "utils/memutils.h" #if PG_VERSION_NUM >= 160000 diff --git a/src/ivfbuild.c b/src/ivfbuild.c index 7166b7d..bea9b9b 100644 --- a/src/ivfbuild.c +++ b/src/ivfbuild.c @@ -2,23 +2,30 @@ #include +#include "access/genam.h" #include "access/table.h" #include "access/tableam.h" +#include "access/tupdesc.h" #include "access/parallel.h" #include "access/xact.h" -#include "bitvec.h" +#include "access/xloginsert.h" #include "catalog/index.h" #include "catalog/pg_operator_d.h" #include "catalog/pg_type_d.h" #include "commands/progress.h" -#include "halfvec.h" +#include "fmgr.h" #include "ivfflat.h" #include "miscadmin.h" #include "optimizer/optimizer.h" #include "storage/bufmgr.h" +#include "storage/condition_variable.h" +#include "storage/lockdefs.h" +#include "storage/shm_toc.h" #include "tcop/tcopprot.h" #include "utils/memutils.h" -#include "vector.h" +#include "utils/sampling.h" +#include "utils/snapmgr.h" +#include "utils/tuplesort.h" #if PG_VERSION_NUM >= 160000 #include "varatt.h" @@ -32,7 +39,7 @@ #if PG_VERSION_NUM >= 140000 #include "utils/backend_status.h" -#include "utils/wait_event.h" +#include "utils/wait_event_types.h" #endif #define PARALLEL_KEY_IVFFLAT_SHARED UINT64CONST(0xA000000000000001) diff --git a/src/ivfflat.c b/src/ivfflat.c index 31c2f7d..4973cf4 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -6,11 +6,13 @@ #include "access/reloptions.h" #include "commands/progress.h" #include "commands/vacuum.h" +#include "fmgr.h" #include "ivfflat.h" #include "utils/float.h" #include "utils/guc.h" #include "utils/selfuncs.h" #include "utils/spccache.h" +#include "vector.h" #if PG_VERSION_NUM < 150000 #define MarkGUCPrefixReserved(x) EmitWarningsOnPlaceholders(x) diff --git a/src/ivfinsert.c b/src/ivfinsert.c index ebc61e4..7bc5aea 100644 --- a/src/ivfinsert.c +++ b/src/ivfinsert.c @@ -3,6 +3,7 @@ #include #include "access/generic_xlog.h" +#include "fmgr.h" #include "ivfflat.h" #include "storage/bufmgr.h" #include "storage/lmgr.h" diff --git a/src/ivfkmeans.c b/src/ivfkmeans.c index 9c79e64..569dd7c 100644 --- a/src/ivfkmeans.c +++ b/src/ivfkmeans.c @@ -1,17 +1,12 @@ #include "postgres.h" #include +#include #include -#include "bitvec.h" -#include "halfutils.h" -#include "halfvec.h" #include "ivfflat.h" #include "miscadmin.h" -#include "utils/builtins.h" -#include "utils/datum.h" #include "utils/memutils.h" -#include "vector.h" #if PG_VERSION_NUM >= 160000 #include "varatt.h" diff --git a/src/ivfscan.c b/src/ivfscan.c index b42ada1..06cdee1 100644 --- a/src/ivfscan.c +++ b/src/ivfscan.c @@ -11,6 +11,12 @@ #include "pgstat.h" #include "storage/bufmgr.h" #include "utils/memutils.h" +#include "utils/snapmgr.h" +#include "utils/tuplesort.h" + +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif #define GetScanList(ptr) pairingheap_container(IvfflatScanList, ph_node, ptr) #define GetScanListConst(ptr) pairingheap_const_container(IvfflatScanList, ph_node, ptr) diff --git a/src/ivfutils.c b/src/ivfutils.c index 9596391..0bde73d 100644 --- a/src/ivfutils.c +++ b/src/ivfutils.c @@ -1,13 +1,23 @@ #include "postgres.h" +#include "access/genam.h" #include "access/generic_xlog.h" -#include "bitvec.h" -#include "catalog/pg_type.h" +#include "common/relpath.h" #include "fmgr.h" #include "halfutils.h" #include "halfvec.h" #include "ivfflat.h" +#include "storage/block.h" +#include "storage/buf.h" #include "storage/bufmgr.h" +#include "storage/bufpage.h" +#include "utils/relcache.h" +#include "utils/varbit.h" +#include "vector.h" + +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif /* * Allocate a vector array diff --git a/src/ivfvacuum.c b/src/ivfvacuum.c index 750cdd6..0d45410 100644 --- a/src/ivfvacuum.c +++ b/src/ivfvacuum.c @@ -1,9 +1,17 @@ #include "postgres.h" +#include "access/genam.h" #include "access/generic_xlog.h" +#include "access/itup.h" #include "commands/vacuum.h" +#include "common/relpath.h" #include "ivfflat.h" +#include "storage/block.h" +#include "storage/buf.h" #include "storage/bufmgr.h" +#include "storage/bufpage.h" +#include "storage/itemptr.h" +#include "storage/off.h" #if PG_VERSION_NUM >= 180000 #define vacuum_delay_point() vacuum_delay_point(false) diff --git a/src/sparsevec.c b/src/sparsevec.c index 1893752..ca1648f 100644 --- a/src/sparsevec.c +++ b/src/sparsevec.c @@ -5,18 +5,23 @@ #include "catalog/pg_type.h" #include "common/shortest_dec.h" -#include "common/string.h" #include "fmgr.h" #include "halfutils.h" #include "halfvec.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "sparsevec.h" #include "utils/array.h" #include "utils/builtins.h" #include "utils/float.h" +#include "utils/fmgrprotos.h" #include "utils/lsyscache.h" #include "vector.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif + typedef struct SparseInputElement { int32 index; diff --git a/src/vector.c b/src/vector.c index 03f70d6..4736838 100644 --- a/src/vector.c +++ b/src/vector.c @@ -16,10 +16,10 @@ #include "port.h" /* for strtof() */ #include "sparsevec.h" #include "utils/array.h" -#include "utils/builtins.h" #include "utils/float.h" +#include "utils/fmgrprotos.h" #include "utils/lsyscache.h" -#include "utils/numeric.h" +#include "utils/varbit.h" #include "vector.h" #if PG_VERSION_NUM >= 160000