diff --git a/.editorconfig b/.editorconfig index e7f7227..21f8ed5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,38 +1,27 @@ -# EditorConfig is awesome: https://EditorConfig.org +# https://EditorConfig.org -# Top-most EditorConfig file root = true -# Global settings (applicable to all files unless overridden) [*] -charset = utf-8 # Default character encoding -end_of_line = lf # Use LF for line endings (Unix-style) -indent_style = space # Use spaces for indentation -indent_size = 4 # Default indentation size -insert_final_newline = true # Make sure files end with a newline -trim_trailing_whitespace = true # Remove trailing whitespace +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true -# Go files [*.go] max_line_length = 100 -# Markdown files [*.md] -max_line_length = 120 -trim_trailing_whitespace = false # Don't remove trailing whitespace in Markdown files +max_line_length = 150 +trim_trailing_whitespace = false -# Bash scripts -[*.sh] +[*.{yml,yaml,json}] indent_size = 2 -# YAML files -[*.{yml,yaml}] +[*.{c,h,sh}] indent_size = 2 -# C files -[*.{c,h}] -indent_size = 2 - -# Python files [*.py] max_line_length = 100 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..3f31b87 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,24 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Logs** +If applicable, add logs to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..84b745a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Discussions + url: https://github.com/habedi/hann/discussions + about: Please ask and answer general questions here diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 71c42b3..5e2f870 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -6,6 +6,8 @@ on: branches: - main push: + branches: + - develop tags: - 'v*' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64e3732..426dadd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,8 @@ on: branches: - main push: + branches: + - develop tags: - 'v*' @@ -19,7 +21,7 @@ jobs: strategy: matrix: # Define the Go versions to test against - go-version: [ "1.21", "1.22", "1.23", "1.24" ] + go-version: [ "1.21", "1.22", "1.23", "1.24", "1.25", "1.26" ] steps: - name: Checkout Repository diff --git a/.gitignore b/.gitignore index d0d35d5..106aaf9 100644 --- a/.gitignore +++ b/.gitignore @@ -83,11 +83,14 @@ template-go-project *.gob *.bin *.index -*.pb\.gz +*.pb.gz *_prof *_prof.go # Ignore the directories where the data for the examples is stored example/data/nearest-neighbors-datasets example/data/nearest-neighbors-datasets-large -*_output.txt +.codex +.claude/ +.agents/ +.antigravitycli/ diff --git a/README.md b/README.md index 6932263..d009017 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ It can be used to add fast in-memory similarity search capabilities to your Go a - Unified interface for different indexes (see [core/index.go](core/index.go)) - Support for indexing and searching vectors of arbitrary dimension -- Fast distance computation using SIMD (AVX) instructions (see [core/simd_distance.c](core/simd_distance.c)) +- Fast distance computation using SIMD (AVX/AVX2) instructions (see [core/simd_distance.c](core/simd_distance.c)) - Support for bulk insertion, deletion, and updates - Support for saving indexes to disk and loading them back diff --git a/example/cmd/bench_pqivf.go b/example/cmd/bench_pqivf.go index 6d409b1..26a254c 100644 --- a/example/cmd/bench_pqivf.go +++ b/example/cmd/bench_pqivf.go @@ -39,7 +39,7 @@ func BenchPQIVFIndexFashionMNIST() { coarseK := 16 numSubquantizers := 8 pqK := 256 - kMeansIters := 25 + kMeansIters := 10 return pqivf.NewPQIVFIndex(dimension, coarseK, numSubquantizers, pqK, kMeansIters) } diff --git a/example/cmd/pqivf.go b/example/cmd/pqivf.go index 5ce9697..c3e18cc 100644 --- a/example/cmd/pqivf.go +++ b/example/cmd/pqivf.go @@ -28,7 +28,7 @@ func PQIVFIndexFashionMNIST() { coarseK := 16 numSubquantizers := 8 pqK := 256 - kMeansIters := 25 + kMeansIters := 10 return pqivf.NewPQIVFIndex(dimension, coarseK, numSubquantizers, pqK, kMeansIters) } diff --git a/example/cmd/pqivf_large.go b/example/cmd/pqivf_large.go index 3a17152..7b13c1f 100644 --- a/example/cmd/pqivf_large.go +++ b/example/cmd/pqivf_large.go @@ -27,7 +27,7 @@ func PQIVFIndexGIST() { coarseK := 16 numSubquantizers := 8 pqK := 256 - kMeansIters := 25 + kMeansIters := 10 return pqivf.NewPQIVFIndex(dimension, coarseK, numSubquantizers, pqK, kMeansIters) } diff --git a/pyproject.toml b/pyproject.toml index 5c924aa..6f321b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,7 @@ [project] name = "hann" version = "0.1.0" -description = "Python environment for Hann" -readme = "README.md" -license = { text = "MIT" } -authors = [ - { name = "Hassan Abedi", email = "hassan.abedi.t@gmail.com" } -] +description = "The Python environment for the Hann project" requires-python = ">=3.10,<4.0" dependencies = [