From cefdcf7798708e9a4838f943b6a4b64dd6b044ab Mon Sep 17 00:00:00 2001 From: R3gardless Date: Thu, 23 Apr 2026 17:29:42 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20enhance=20VectorChord=20CLI=20optio?= =?UTF-8?q?ns=20for=20lists=20and=20probes=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated the `lists` and `probes` parameters to accept comma-separated integers for more flexibility. - Added a helper function `_parse_int_list` to handle input parsing and validation. 🛠️ --- .../backend/clients/vectorchord/cli.py | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/vectordb_bench/backend/clients/vectorchord/cli.py b/vectordb_bench/backend/clients/vectorchord/cli.py index 2b3e3862b..9d86af0b1 100644 --- a/vectordb_bench/backend/clients/vectorchord/cli.py +++ b/vectordb_bench/backend/clients/vectorchord/cli.py @@ -14,6 +14,15 @@ ) +def _parse_int_list(ctx: click.Context, param: click.Parameter, value: str | None) -> list[int] | None: + if value is None or value == "": + return None + try: + return [int(v.strip()) for v in value.split(",") if v.strip()] + except ValueError as e: + raise click.BadParameter(f"expected comma-separated integers, got {value!r}") from e + + class VectorChordTypedDict(CommonTypedDict): user_name: Annotated[ str, @@ -66,20 +75,25 @@ class VectorChordTypedDict(CommonTypedDict): class VectorChordRQTypedDict(VectorChordTypedDict): lists: Annotated[ - int | None, + list[int] | None, click.option( "--lists", - type=int, - help="Number of IVF lists for vchordrq index", + type=str, + callback=_parse_int_list, + help=( + "Comma-separated IVF list sizes for vchordrq index. " + "Single value for single-level (e.g. '1000') or multiple for multi-level IVF (e.g. '4096,128')" + ), ), ] probes: Annotated[ - int | None, + list[int] | None, click.option( "--probes", - type=int, - help="Number of probes during search", - default=10, + type=str, + callback=_parse_int_list, + help="Comma-separated probes per IVF level during search (e.g. '10' or '10,1')", + default="10", show_default=True, ), ] From c936a997387079545825f8f15ede1ae726baa0bc Mon Sep 17 00:00:00 2001 From: R3gardless Date: Thu, 23 Apr 2026 17:29:54 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20update=20VectorChordRQConfig=20to?= =?UTF-8?q?=20support=20list=20types=20for=20lists=20and=20probes=20?= =?UTF-8?q?=F0=9F=8E=89=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed 'lists' and 'probes' from single integers to lists of integers for better flexibility in configuration. This allows for multi-level IVF setups and multiple probes per IVF level. 🚀 --- vectordb_bench/backend/clients/vectorchord/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vectordb_bench/backend/clients/vectorchord/config.py b/vectordb_bench/backend/clients/vectorchord/config.py index 95916eb06..1c9d97a01 100644 --- a/vectordb_bench/backend/clients/vectorchord/config.py +++ b/vectordb_bench/backend/clients/vectorchord/config.py @@ -94,13 +94,13 @@ class VectorChordRQConfig(VectorChordIndexConfig): rerank_in_table: bool = False degree_of_parallelism: int | None = None # default 32, range [1, 256] # Build parameters ([build.internal] section) - lists: int | None = None + lists: list[int] | None = None # e.g. [1000] for single-level or [4096, 128] for multi-level IVF spherical_centroids: bool = False build_threads: int | None = None # range [1, 255] # PostgreSQL tuning parameter max_parallel_workers: int | None = None # sets max_parallel_workers & max_parallel_maintenance_workers # Search parameters (GUCs) - probes: int | None = 10 + probes: list[int] | None = [10] # one probe per IVF level, e.g. [10] or [10, 1] epsilon: float | None = 1.9 # range [0.0, 4.0] max_scan_tuples: int | None = None # default -1, range [-1, 2147483647] @@ -114,7 +114,7 @@ def index_param(self) -> dict: options_parts.append(f"degree_of_parallelism = {self.degree_of_parallelism}") options_parts.append("[build.internal]") if self.lists is not None: - options_parts.append(f"lists = [{self.lists}]") + options_parts.append(f"lists = [{', '.join(str(v) for v in self.lists)}]") if self.spherical_centroids: options_parts.append("spherical_centroids = true") if self.build_threads is not None: @@ -136,7 +136,7 @@ def search_param(self) -> dict: def session_param(self) -> dict: params = {} if self.probes is not None: - params["vchordrq.probes"] = str(self.probes) + params["vchordrq.probes"] = ",".join(str(v) for v in self.probes) if self.epsilon is not None: params["vchordrq.epsilon"] = str(self.epsilon) if self.max_scan_tuples is not None: From a734acacf532c4aaabcb6e5eff1929fa7fa2db75 Mon Sep 17 00:00:00 2001 From: R3gardless Date: Fri, 24 Apr 2026 11:40:06 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20improve=20error=20message=20in=20=5F?= =?UTF-8?q?parse=5Fint=5Flist=20function=20=F0=9F=9B=A0=EF=B8=8F=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the error handling in the _parse_int_list function to provide a clearer message when invalid input is given. This enhances user experience by making it easier to understand input requirements. 📜 --- vectordb_bench/backend/clients/vectorchord/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vectordb_bench/backend/clients/vectorchord/cli.py b/vectordb_bench/backend/clients/vectorchord/cli.py index 9d86af0b1..99723959c 100644 --- a/vectordb_bench/backend/clients/vectorchord/cli.py +++ b/vectordb_bench/backend/clients/vectorchord/cli.py @@ -14,13 +14,14 @@ ) -def _parse_int_list(ctx: click.Context, param: click.Parameter, value: str | None) -> list[int] | None: +def _parse_int_list(_ctx: click.Context, _param: click.Parameter, value: str | None) -> list[int] | None: if value is None or value == "": return None try: return [int(v.strip()) for v in value.split(",") if v.strip()] except ValueError as e: - raise click.BadParameter(f"expected comma-separated integers, got {value!r}") from e + msg = f"expected comma-separated integers, got {value!r}" + raise click.BadParameter(msg) from e class VectorChordTypedDict(CommonTypedDict):