Skip to content

Commit 2cde1f0

Browse files
committed
?
1 parent bccf85d commit 2cde1f0

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.github/workflows/check.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ jobs:
100100
psql:
101101
strategy:
102102
matrix:
103-
version: ["14", "15", "16", "17", "18"]
103+
version: ["18"]
104104
arch: ["x86_64", "aarch64"]
105+
index: ["0", "1", "2", "3", "4", "5", "6", "7"]
106+
fail-fast: false
105107
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
106108

107109
env:
@@ -154,6 +156,7 @@ jobs:
154156
psql -c 'ALTER SYSTEM SET max_worker_processes = 1024'
155157
psql -c 'ALTER SYSTEM SET shared_preload_libraries = pg_tokenizer, vchord_bm25'
156158
psql -c 'ALTER SYSTEM SET search_path = "\$user", public, tokenizer_catalog, bm25_catalog'
159+
psql -c 'ALTER SYSTEM SET log_autovacuum_min_duration = 0'
157160
sudo systemctl stop postgresql
158161
159162
pg_config
@@ -178,7 +181,7 @@ jobs:
178181
- name: Upload Artifacts
179182
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
180183
with:
181-
name: postgresql-${{ matrix.version }}-vchord-bm25_0.0.0_${{ matrix.arch }}-linux-gnu
184+
name: postgresql-${{ matrix.version }}-vchord-bm25_0.0.0_${{ matrix.arch }}-linux-gnu-${{ matrix.index }}
182185
path: ./build
183186
compression-level: 9
184187
retention-days: 14
@@ -196,3 +199,9 @@ jobs:
196199
- name: Fuzz
197200
run: |
198201
cargo run -p fuzz -- "user=$(whoami) dbname=$(whoami) host=localhost"
202+
203+
- name: Logging
204+
if: always()
205+
run: |
206+
sudo systemctl stop postgresql || true
207+
cat /var/log/postgresql/postgresql-${{ matrix.version }}-main.log

crates/fuzz/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ publish = false
77
[dependencies]
88
postgres = "0.19.12"
99
rand.workspace = true
10+
sha2 = "0.10.9"
1011

1112
[lints]
1213
workspace = true

crates/fuzz/src/main.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
//
1313
// Copyright (c) 2025 TensorChord Inc.
1414

15-
use std::collections::{BTreeMap, BTreeSet};
16-
use std::fmt::Debug;
17-
1815
use rand::seq::IndexedRandom;
1916
use rand::{RngExt, SeedableRng};
17+
use sha2::{Digest, Sha256};
18+
use std::collections::{BTreeMap, BTreeSet};
19+
use std::fmt::Debug;
2020

2121
#[allow(unused)]
2222
#[derive(Debug, Clone, Copy)]
@@ -40,7 +40,7 @@ const FUZZ_OPERATIONS: [Operation; 3] = [
4040
];
4141

4242
fn test(client: &mut postgres::Client) {
43-
let seed = rand::rng().random_range(0..u64::MAX);
43+
let seed = 15418557822313552730; // rand::rng().random_range(0..u64::MAX);
4444
let mut rng = rand::rngs::StdRng::seed_from_u64(seed);
4545
println!("Seed: {}", seed); // for reproducibility
4646

@@ -50,7 +50,7 @@ fn test(client: &mut postgres::Client) {
5050
CREATE TABLE documents (
5151
id SERIAL PRIMARY KEY,
5252
embedding bm25vector
53-
);
53+
) WITH (autovacuum_enabled = off);
5454
"#,
5555
&[],
5656
)
@@ -222,6 +222,11 @@ fn fuzz_select(client: &mut postgres::Client, rng: &mut impl RngExt) {
222222
}
223223
seq_results.pop_last();
224224

225+
let result = Sha256::digest(format!(
226+
"index_results = {index_results:?}, seq_results = {seq_results:?}"
227+
));
228+
println!("{result:x}");
229+
225230
let mut miss_cnt = 0;
226231
for (rank, seq_id) in &seq_results {
227232
let Some(index_id) = index_results.get(rank) else {

0 commit comments

Comments
 (0)