epzero 0.5.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. epzero-1.0.0/CHANGELOG.md +259 -0
  2. epzero-1.0.0/LICENSE +21 -0
  3. epzero-1.0.0/PKG-INFO +393 -0
  4. {epzero-0.5.0 → epzero-1.0.0}/fuzz/make_seeds.cpp +6 -1
  5. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/auto.h +21 -0
  6. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/database.h +4 -1
  7. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/distance.h +11 -0
  8. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/hnsw.h +56 -9
  9. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/recall.h +18 -6
  10. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/text.h +15 -0
  11. {epzero-0.5.0 → epzero-1.0.0}/pyproject.toml +7 -3
  12. epzero-0.5.0/PKG-INFO → epzero-1.0.0/python/README.md +139 -47
  13. {epzero-0.5.0 → epzero-1.0.0}/python/epzero/auto.py +11 -2
  14. epzero-1.0.0/python/epzero/collection_cli.py +158 -0
  15. epzero-1.0.0/python/epzero/collection_ids.py +50 -0
  16. {epzero-0.5.0 → epzero-1.0.0}/python/epzero/haystack.py +0 -6
  17. epzero-1.0.0/python/epzero/ingest.py +96 -0
  18. epzero-1.0.0/python/epzero/ir.py +450 -0
  19. {epzero-0.5.0 → epzero-1.0.0}/python/epzero/langchain.py +43 -43
  20. {epzero-0.5.0 → epzero-1.0.0}/python/epzero/llamaindex.py +17 -17
  21. epzero-1.0.0/python/epzero/snapshots.py +137 -0
  22. {epzero-0.5.0 → epzero-1.0.0}/python/epzero_py.cpp +280 -107
  23. epzero-1.0.0/python/tests/data/collection-metadata/empty-exhausted-v2.json +1 -0
  24. epzero-1.0.0/python/tests/data/collection-metadata/valid-v1.json +1 -0
  25. epzero-1.0.0/python/tests/data/collection-metadata/valid-v2.json +1 -0
  26. epzero-1.0.0/python/tests/data/collection-released-0.6.0/legacy/ids.json +1 -0
  27. epzero-1.0.0/python/tests/data/collection-released-0.6.0/legacy/text.epzero +0 -0
  28. epzero-1.0.0/python/tests/data/collection-released-0.6.0/legacy/vectors.epzero +0 -0
  29. epzero-1.0.0/python/tests/data/collection-released-0.6.0/provenance.json +21 -0
  30. epzero-1.0.0/python/tests/data/collection-released-0.6.0/v1/collection.json +1 -0
  31. epzero-1.0.0/python/tests/data/collection-released-0.6.0/v1/generation-0123456789abcdef0123456789abcdef/ids.json +1 -0
  32. epzero-1.0.0/python/tests/data/collection-released-0.6.0/v1/generation-0123456789abcdef0123456789abcdef/text.epzero +0 -0
  33. epzero-1.0.0/python/tests/data/collection-released-0.6.0/v1/generation-0123456789abcdef0123456789abcdef/vectors.epzero +0 -0
  34. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_auto.py +9 -0
  35. epzero-1.0.0/python/tests/test_collection_cli.py +107 -0
  36. epzero-1.0.0/python/tests/test_collection_compact.py +63 -0
  37. epzero-1.0.0/python/tests/test_collection_ids.py +194 -0
  38. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_epzero.py +87 -13
  39. epzero-1.0.0/python/tests/test_ingest.py +60 -0
  40. epzero-1.0.0/python/tests/test_ir.py +375 -0
  41. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_langchain.py +4 -0
  42. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_llamaindex.py +2 -0
  43. epzero-1.0.0/python/tests/test_snapshots.py +186 -0
  44. epzero-1.0.0/python/tests/test_storage_reclamation.py +99 -0
  45. {epzero-0.5.0 → epzero-1.0.0}/server/node_main.cpp +33 -12
  46. {epzero-0.5.0 → epzero-1.0.0}/src/auto.cpp +258 -10
  47. {epzero-0.5.0 → epzero-1.0.0}/src/database.cpp +58 -16
  48. {epzero-0.5.0 → epzero-1.0.0}/src/distance.cpp +62 -0
  49. {epzero-0.5.0 → epzero-1.0.0}/src/distance_avx2.cpp +80 -6
  50. {epzero-0.5.0 → epzero-1.0.0}/src/distance_avx512.cpp +22 -2
  51. epzero-1.0.0/src/distance_avx512vnni.cpp +80 -0
  52. epzero-1.0.0/src/distance_avxvnni.cpp +107 -0
  53. {epzero-0.5.0 → epzero-1.0.0}/src/distance_f16c.cpp +29 -2
  54. {epzero-0.5.0 → epzero-1.0.0}/src/distance_neon.cpp +37 -0
  55. {epzero-0.5.0 → epzero-1.0.0}/src/distance_scalar.cpp +21 -0
  56. {epzero-0.5.0 → epzero-1.0.0}/src/hnsw.cpp +705 -230
  57. {epzero-0.5.0 → epzero-1.0.0}/src/kernels.h +10 -0
  58. {epzero-0.5.0 → epzero-1.0.0}/src/metadata.cpp +77 -10
  59. {epzero-0.5.0 → epzero-1.0.0}/src/pca.h +5 -2
  60. {epzero-0.5.0 → epzero-1.0.0}/src/recall.cpp +86 -25
  61. epzero-1.0.0/src/sq4.h +49 -0
  62. {epzero-0.5.0 → epzero-1.0.0}/src/text.cpp +90 -17
  63. {epzero-0.5.0 → epzero-1.0.0}/src/visited_pool.h +39 -19
  64. {epzero-0.5.0 → epzero-1.0.0}/tests/auto_test.cpp +108 -0
  65. {epzero-0.5.0 → epzero-1.0.0}/tests/database_test.cpp +51 -0
  66. {epzero-0.5.0 → epzero-1.0.0}/tests/distance_test.cpp +32 -0
  67. {epzero-0.5.0 → epzero-1.0.0}/tests/half_test.cpp +25 -0
  68. {epzero-0.5.0 → epzero-1.0.0}/tests/hnsw_test.cpp +312 -0
  69. {epzero-0.5.0 → epzero-1.0.0}/tests/metadata_test.cpp +18 -0
  70. {epzero-0.5.0 → epzero-1.0.0}/tests/text_test.cpp +27 -0
  71. epzero-0.5.0/CHANGELOG.md +0 -129
  72. epzero-0.5.0/python/README.md +0 -206
  73. epzero-0.5.0/python/epzero/ir.py +0 -257
  74. epzero-0.5.0/python/tests/test_ir.py +0 -128
  75. epzero-0.5.0/src/distance_avx512vnni.cpp +0 -34
  76. epzero-0.5.0/src/distance_avxvnni.cpp +0 -60
  77. {epzero-0.5.0 → epzero-1.0.0}/CMakeLists.txt +0 -0
  78. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_adaptive.cpp +0 -0
  79. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_churn.cpp +0 -0
  80. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_distance.cpp +0 -0
  81. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_filter.cpp +0 -0
  82. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_guard.cpp +0 -0
  83. {epzero-0.5.0 → epzero-1.0.0}/bench/bench_recall.cpp +0 -0
  84. {epzero-0.5.0 → epzero-1.0.0}/bench/regression.json +0 -0
  85. {epzero-0.5.0 → epzero-1.0.0}/fuzz/common.h +0 -0
  86. {epzero-0.5.0 → epzero-1.0.0}/fuzz/fuzz_graph.cpp +0 -0
  87. {epzero-0.5.0 → epzero-1.0.0}/fuzz/fuzz_metadata.cpp +0 -0
  88. {epzero-0.5.0 → epzero-1.0.0}/fuzz/fuzz_snapshot.cpp +0 -0
  89. {epzero-0.5.0 → epzero-1.0.0}/fuzz/fuzz_text.cpp +0 -0
  90. {epzero-0.5.0 → epzero-1.0.0}/fuzz/fuzz_wal.cpp +0 -0
  91. {epzero-0.5.0 → epzero-1.0.0}/fuzz/regressions/graph-empty-with-entry-point +0 -0
  92. {epzero-0.5.0 → epzero-1.0.0}/fuzz/regressions/graph-entry-level-overflow +0 -0
  93. {epzero-0.5.0 → epzero-1.0.0}/fuzz/regressions/graph-upper-link-to-base-node +0 -0
  94. {epzero-0.5.0 → epzero-1.0.0}/fuzz/regressions/snapshot-empty-with-entry-point +0 -0
  95. {epzero-0.5.0 → epzero-1.0.0}/fuzz/regressions/snapshot-huge-capacity +0 -0
  96. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/brute_force.h +0 -0
  97. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/dataset.h +0 -0
  98. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/metadata.h +0 -0
  99. {epzero-0.5.0 → epzero-1.0.0}/include/epzero/parallel.h +0 -0
  100. {epzero-0.5.0 → epzero-1.0.0}/python/epzero/__init__.py +0 -0
  101. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_haystack.py +0 -0
  102. {epzero-0.5.0 → epzero-1.0.0}/python/tests/test_metadata.py +0 -0
  103. {epzero-0.5.0 → epzero-1.0.0}/src/brute_force.cpp +0 -0
  104. {epzero-0.5.0 → epzero-1.0.0}/src/dataset.cpp +0 -0
  105. {epzero-0.5.0 → epzero-1.0.0}/src/distance_wasm.cpp +0 -0
  106. {epzero-0.5.0 → epzero-1.0.0}/src/half.h +0 -0
  107. {epzero-0.5.0 → epzero-1.0.0}/src/platform.h +0 -0
  108. {epzero-0.5.0 → epzero-1.0.0}/src/porter.h +0 -0
  109. {epzero-0.5.0 → epzero-1.0.0}/src/rabitq.h +0 -0
  110. {epzero-0.5.0 → epzero-1.0.0}/tests/data/v4-from-0.4.0.epzero +0 -0
  111. {epzero-0.5.0 → epzero-1.0.0}/tests/dataset_test.cpp +0 -0
  112. {epzero-0.5.0 → epzero-1.0.0}/tests/recall_test.cpp +0 -0
  113. {epzero-0.5.0 → epzero-1.0.0}/tools/export_graph.cpp +0 -0
  114. {epzero-0.5.0 → epzero-1.0.0}/wasm/epzero_wasm.cpp +0 -0
@@ -0,0 +1,259 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (unreleased)
4
+
5
+ This release establishes the supported embedded Python library and local collection CLI.
6
+ See the Python 1.0 compatibility contract for API stability, persistence and operational limits.
7
+ The distributed cluster and browser demonstration remain experimental.
8
+
9
+ Collection persistence and local document workflows are the focus of this release candidate.
10
+ The native vector/text file formats remain compatible with 0.6.0; newly saved Collection metadata
11
+ uses version 2 and requires upgraded readers.
12
+
13
+ - Collection replacements stage new labels before retiring old documents. Live document metadata
14
+ no longer allocates an entry for every historical label; retired labels are never reused.
15
+ - Collection saves publish complete vector/text/ID generations through an atomic manifest.
16
+ Cooperating CLI writers coordinate the entire load/update/save operation with a folder lock.
17
+ Explicit snapshot inventory and preview-first pruning control retained disk space.
18
+ - Collection compaction rebuilds live graph and keyword structures. `shrink_capacity=True` (CLI
19
+ `--shrink-capacity`) also releases historical graph capacity; default compaction retains it.
20
+ Text rebuilding discards obsolete vocabulary and postings while preserving keyword scores.
21
+ - `epzero-collection` provides build, upsert, remove, query, inspect, compact and prune commands.
22
+ Optional local-model `embed` and `encode-query` commands prepare text vectors in batches.
23
+ Embedding output refuses overwrite and is published only after complete input succeeds.
24
+ - Source and wheel distributions include the repository's MIT license text. Release CI verifies
25
+ source-archive completeness and rebuilds/tests the archive with the optional adapter suites.
26
+ - Engine search and SIMD optimizations (+7–19% QPS on interleaved A/B benchmarks with identical
27
+ results): 4-way unrolled AVX2/AVX-VNNI/AVX-512/F16C accumulators, zero-branch specialized
28
+ `search_layer` dispatch, 8-byte inline stack `Beam` with branchless binary search, transposed
29
+ PCA outlier projection (`nav_basis_t_`), sliding-window multi-line rerank prefetch with max-heap
30
+ early stopping and `partial_sort`, and sharded word-tracked `VisitedPool`.
31
+ - Engine correctness, concurrency and memory fixes: release/acquire node publication (`ready_`)
32
+ preventing concurrent `add()`/`exact_search()`/`get_vector()` races; 8,192 cache-line-padded lock
33
+ stripes replacing per-node mutex arrays; contiguous `TombstoneBeam` eliminating the 1-tombstone
34
+ cliff; exact full-vector scanning for `FilterStrategy::Exact` on quantized/`nav_dim` indexes;
35
+ outlier splitting in `project_query()`; native C++ filtered BM25 (`TextIndex.search(filter=...)`
36
+ and `epzero.hybrid_search(filter=...)`); safe live `Index.add()`/`reserve()` growth with
37
+ `RecallGuard` attached; `SyncMode::Batch` and replica WAL pre-validation fixes; Windows-safe
38
+ atomic publication in `epzero-collection embed`; and removal of duplicate vector buffers and
39
+ load-time rebuilds across the LangChain, LlamaIndex and Haystack adapters.
40
+ - Experimental cluster fixes: 256 MiB gRPC send/recv limits on peer snapshot channels and router
41
+ dials, thread-safe shard assignment status, context-aware write retries and graceful shutdown.
42
+
43
+ Legacy and version-1 Collection snapshots remain readable. Upgrading their saved metadata is
44
+ one-way for older clients: retain a coordinated backup before saving with this candidate.
45
+ These guarantees concern cooperating processes and local filesystem snapshots, not a document
46
+ WAL, shared multi-writer service, power-loss certification or network-filesystem durability.
47
+ The changes do not establish a generally superior ANN repair algorithm or a service latency SLA.
48
+
49
+ ## 0.6.0
50
+
51
+ Indexes that keep growing without leaving their newest vectors behind; 4-bit codes; walks on principal
52
+ directions chosen by measurement (opt-in); faster builds; a deeper re-rank at k = 100; and a library that
53
+ refuses the usual first-time mistakes with a clear message. Files written by 0.5 load unchanged.
54
+
55
+ **Indexes that keep growing.** A vector inserted late has had no time to gain incoming links from
56
+ later arrivals, so the newest vectors of a grown index are found less often than in a rebuild.
57
+
58
+ - `extra_backlinks` (Python: `Index(..., extra_backlinks=8)`, `epzero.build(..., extra_backlinks=8)`;
59
+ C++: `HnswParams::extra_backlinks`): each insertion also asks that many of its closest construction
60
+ candidates that it did not choose to link to it. Off by default; not saved with the index, so
61
+ `index.set_extra_backlinks(n)` sets it again after `load()`.
62
+ - `index.refine_links(ef=..., first=n)`: reconnects only the vectors inserted from position `n` on, for
63
+ a checkpoint after a batch of additions. It returns the number of vectors refined. `around=True` also
64
+ refines the older vectors those link to, so that they can choose the new ones beside them.
65
+ - Both are opt-in. A one-off build doesn't change. Together (8 extra links, each batch refined at a beam
66
+ of 100) they removed the newest vectors' extra misses on a growing collection for about 9% more
67
+ insertion work.
68
+
69
+ **4-bit codes.** The graph walk can score 4-bit codes instead of 8-bit ones: half the bytes per scored
70
+ node, on the same per-dimension ranges at 16 levels, with the full vectors re-ranking more of the beam.
71
+
72
+ - `epzero.build(..., code_bits=4)` builds the graph on 8-bit codes as before and walks it on 4-bit ones.
73
+ They were 25-43% faster on GooAQ and Yahoo (walks over every dimension) and slower on most walks on
74
+ principal directions and on CLIP and ALIGN image vectors (Xeon Gold 6226), so the default stays 8 bits.
75
+ - `measure_code_bits=True` calibrates and times the walk at both widths on the same graph and keeps 4 bits
76
+ only where they reach the recall target at least 3% faster (`index.plan.reasons["code_bits"]` gives both
77
+ timings). Opt-in: its choice was within 3% of the better one on 9 of 12 datasets, but 24% slower on GooAQ
78
+ at k = 10, where the two tied at calibration. Below 128 codes per vector it keeps 8 bits without trying.
79
+ - `index.set_code_bits(4)` (C++: `HnswIndex::set_code_bits`) converts a built index in place, keeping
80
+ the graph, and back with `set_code_bits(8)`. 4-bit codes need the full vectors (the default).
81
+ - Integer kernels for AVX2, AVX-VNNI, AVX-512 VNNI and NEON (base ARMv8, no dot-product extension needed);
82
+ WebAssembly uses a scalar kernel for 4-bit codes, so there the planner's timing keeps 8 bits.
83
+ - Saved with the index as a storage flag; builds before this one refuse such a file instead of misreading it.
84
+
85
+ **Walking on the right directions, chosen by measurement (opt-in).**
86
+
87
+ - `check_walk=True`: with your own `queries=`, if they look unlike the data (as `check_queries` judges, on a
88
+ sample before the build), the build times the variance rule's walk on principal directions against no walk,
89
+ on 50,000 rows, and keeps the faster. On COCO (text queries against image vectors) the rule's 128-direction
90
+ walk never reached recall 0.95 (beam width 4096); with the check, no walk reached it at 128, for 26% more build
91
+ time on a laptop. On the full set on a Xeon Gold 6226 the highest recall rose from 0.76-0.82 to 0.996, for 1.5x
92
+ the build time (25 to 38 s). Queries like the data skip the trial (AG News: build time unchanged).
93
+ - `measure_nav=True`: the number of directions itself by trial indexes on 100,000 rows (none, 128-512 and the
94
+ rule's), timed on your queries or on held-out rows. On eight datasets it chose the count that was fastest on
95
+ the full data, or within 5% of it, 15 times out of 16 (Xeon Gold 6226, round 14), but it costs 2-3.5x the build
96
+ time, so it stays opt-in.
97
+
98
+ **Searching deeper at k = 100.** With the walk on principal directions, the early-stopping re-rank with
99
+ full vectors now scores up to max(`rerank`, `ef`) candidates instead of `rerank`: at k = 100 a wide beam
100
+ holds true neighbours past the first 300. Highest recall at k = 100 rose from 0.987 to 0.999 on AG News,
101
+ 0.970 to 0.999 on arXiv and 0.910 to 0.995 on GIST1M; at k = 10 the early stop ends the re-rank first,
102
+ and speed is unchanged within 1-2%.
103
+
104
+ **Faster builds.**
105
+
106
+ - Building with 16-bit full vectors (`half_vectors=True`) and no walk on principal directions widened each
107
+ stored vector to floats one value at a time for every pair the build compared; it now uses F16C or NEON.
108
+ Such a build took 2.6x as long as an 8-bit one on 300,000 AG News vectors (1.7x on GooAQ, 24 cores); now 1.01x,
109
+ and 0.68-1.02x on nine datasets on a Xeon Gold 6226 (GooAQ 0.82x). 16-bit vectors stay opt-in: they cost up to
110
+ 0.006 recall at 10 neighbours on some text embeddings.
111
+ - A build that also times 4-bit codes computes its calibration queries' exact neighbours once, not twice.
112
+ - `refine_ef=` sets the refine pass's beam width (by default efConstruction with a walk on directions, half
113
+ of it without).
114
+
115
+ **Friendlier for a first-time user** (found by installing from PyPI and trying the usual mistakes):
116
+
117
+ - Vectors or queries holding a NaN or an infinity are refused with the row and column (`ValueError: row 42
118
+ contains NaN (column 5)`). Before, such data built an index that calibrated to its widest beam and returned
119
+ noise. C++: `HnswIndex::add` throws `std::invalid_argument`, and `Database` refuses them before they reach
120
+ its log. A log written by an older version that holds such a vector still opens: the vector is skipped
121
+ and counted in `recovery()["skipped"]`, on a replica too.
122
+ - Metric names other libraries use are accepted, in any case: `"euclidean"` and `"l2sq"` for `"l2"`, `"dot"`,
123
+ `"inner_product"` and `"mips"` for `"ip"`, `"angular"` and `"cos"` for `"cosine"`.
124
+ - `save`, `load` and `Database.open` take any path-like object (`pathlib.Path`), not only strings.
125
+ - A negative `k`, `ef` or `rerank` gets `ValueError: k must be 0 or more` instead of a pybind11 cast error.
126
+ - `search` documents what fills a short result: label -1 and distance inf.
127
+
128
+ **Retrieval evaluation** (`epzero.ir`): run files keep full score precision; qrels with a non-integer or
129
+ non-finite grade, or a duplicate judgment, are refused with the file and the offending value; `evaluate(...,
130
+ population=...)` chooses which queries count (`"positive"`, the default and the earlier behaviour, `"judged"`,
131
+ or `"explicit"` with `query_ids=`), and a query missing from the run scores 0.
132
+
133
+ ## 0.5.0
134
+
135
+ An index that stays accurate as its data changes, fixed in place; metadata and keyword search in the
136
+ engine; LlamaIndex and Haystack beside LangChain; retrieval evaluation; and Windows. Files written by
137
+ 0.4 load unchanged.
138
+
139
+ **Staying accurate after the build.**
140
+
141
+ - `index.recalibrate(queries)` (C++: `epzero::recalibrate`): re-measures the beam width for the
142
+ recall target on real queries and saves it in the profile, without rebuilding.
143
+ - `index.health()` (C++: `check_health`): live and deleted vectors, growth since calibration, and how
144
+ much of the data the principal directions still capture, with advice in plain words: compact,
145
+ recalibrate, or rebuild.
146
+ - `RecallGuard(index)` takes its target and starting beam width from the profile.
147
+ - `index.check_queries(queries)` (C++: `check_queries`) says whether queries look like the data: text
148
+ queries against image vectors sit 2.2-2.3× farther from their nearest neighbours than rows of the data,
149
+ against 0.99-1.09× for queries like the data, and recall calibrated on the data then falls to 0.74-0.80
150
+ for a 0.95 target. Its advice: `recalibrate(queries)`, which restored 0.945-0.958 on VIBE's
151
+ text-to-image sets.
152
+ - `index.requantize()` (C++: `HnswIndex::requantize`, then `refine_links`): for vectors added since the
153
+ build that lie outside the ranges the 8-bit codes were fitted on. It refits the ranges on the live
154
+ vectors, re-encodes them and reconnects the graph, in about half a rebuild's time; after a 4 sd drift
155
+ it brought the beam width for recall 0.95 from 200 back to a rebuild's 12. `health()` reports
156
+ `code_error` and advises it above 0.01.
157
+ - `index.get_vector(label)` returns a stored vector.
158
+
159
+ **Information retrieval.** `epzero.ir`: a `Collection` of documents with string ids, retrieved by vector,
160
+ by keyword (BM25) or both (reciprocal rank fusion), growing and shrinking after the build; TREC run files
161
+ in and out; relevance judgements in TREC or BEIR form; nDCG@k, MAP, recall, precision and MRR, matching
162
+ trec_eval (tested against it); and a BEIR dataset loader.
163
+
164
+ **Stemming.** `TextIndex` reduces English words to their Porter stems, so "connections" matches
165
+ "connected" (`stemmer="none"` keeps words as written). It is the reference implementation's algorithm,
166
+ the one Lucene and Anserini use, and agrees with NLTK's on all 39,011 words of SciFact's and NFCorpus's
167
+ vocabularies. nDCG@10 for BM25 went from 0.660 to 0.688 on SciFact and from 0.305 to 0.321 on NFCorpus
168
+ (BEIR's Anserini baselines: 0.665 and 0.325), and for hybrid search with all-MiniLM-L6-v2 from 0.682 to
169
+ 0.713 and from 0.344 to 0.354. Stemmed text indexes are saved as text format 2; files saved before load
170
+ unstemmed, as they were written.
171
+
172
+ **Fixes.** `hybrid_search` searched with a fixed beam width of 64 and the default re-rank, ignoring the
173
+ index's calibrated profile; it now uses the profile unless `ef` is given. Calibration could settle on a
174
+ beam width below k, which only k-sized searches had measured.
175
+
176
+ **File format 5.** Indexes with a profile or 16-bit vectors are written as version 5; 0.4's version 4
177
+ files are still read (a file written by 0.4.0 is part of the test suite). See `docs/file-format.md`.
178
+
179
+ **Indexes grow.** `add()` no longer fails when an index is full: it grows the capacity (at least
180
+ doubling), copying the nodes and keeping the graph; `index.reserve(n)` and `index.capacity` do it ahead.
181
+ The LangChain, LlamaIndex and Haystack stores, which rebuilt their whole graph each time they filled, now
182
+ grow in place: loading 40,000 documents in batches of 100 went from 6.0 s to 3.4 s. Searches on other
183
+ threads wait for a growth, which moves the index's memory; with a RecallGuard attached, growing must be
184
+ done beforehand with `reserve()`.
185
+
186
+ **Metadata in the engine.** `epzero.Metadata` (C++: `MetadataIndex`) keeps str, int, float and bool fields
187
+ per label, with an inverted index per field and ordered numeric values, and `select(where)` returns the
188
+ labels that pass ({field: value}, {field: [values]}, or `$eq`, `$ne`, `$in`, `$nin`, `$gt`, `$gte`, `$lt`,
189
+ `$lte`, `$exists`) for a filtered search. The LangChain store now runs dict filters there instead of
190
+ checking every document in Python. Saved in its own file format, fuzzed in CI.
191
+
192
+ **Memory.** `half_vectors=True` keeps the full vectors as 16-bit floats: about half an index's memory,
193
+ at some speed (up to 17% on GIST1M) and recall (0.003-0.004 on OpenAI embeddings), so never chosen
194
+ automatically. Full-precision search is 4-9% faster, as vector addresses are resolved once per query.
195
+
196
+ **LlamaIndex.** `epzero.llamaindex.EpzeroVectorStore` (`pip install "epzero[llamaindex]"`): nodes with
197
+ their text and metadata, filters in the engine, `delete_ref_doc`, and persistence.
198
+
199
+ **Haystack.** `epzero.haystack.EpzeroDocumentStore` and `EpzeroEmbeddingRetriever`
200
+ (`pip install "epzero[haystack]"`): Haystack filters in the engine where the answer is provably the same,
201
+ and Haystack's document-store test suite passes.
202
+
203
+ **Windows.** The engine builds with MSVC and its tests run on Windows in CI; wheels for Windows (x64).
204
+
205
+ **Easier to read.** `Index`, `Metadata`, `TextIndex` and `Database` print what they hold (size, metric,
206
+ compression, calibrated beam width), and shape and name errors say what was passed.
207
+
208
+ ## 0.4.0
209
+
210
+ **Automatic configuration.** `epzero.build(vectors, metric=...)` (C++: `epzero::build_auto` in
211
+ `epzero/auto.h`) configures an index from its data and the machine it is built on:
212
+
213
+ - From the data: 8-bit codes, whether to walk the graph on principal directions (at 256 dimensions or
214
+ more, when few directions hold most of the variance), the build passes, the re-rank, and the beam
215
+ width (`ef`) that reaches a recall target, calibrated on rows held out of the graph or on queries
216
+ you pass (`queries=`).
217
+ - From the machine: the prefetch setting, timed on this CPU, and every core.
218
+ - Measured on an Intel Xeon Gold 6226 and an AMD Threadripper PRO 9985WX: as fast as hand-tuned
219
+ settings (within 1-5%), recall 0.949-0.957 on real queries for a 0.95 target, and 1.3-4.1× Glass's
220
+ queries per second on GIST1M, OpenAI DBpedia and DEEP10M.
221
+ - Every setting can be fixed instead (`epzero.build(vectors, nav_dim=0, M=32)`, or `epzero.plan()`,
222
+ edit, build). `index.plan` shows each setting and why it was chosen.
223
+ - The choices are saved inside the index (`IndexProfile`, file format v4), and `search()` uses them
224
+ when called without settings. A loaded index re-applies its prefetch setting only on the same kind
225
+ of CPU (`epzero.machine()` names it).
226
+
227
+ **Faster search and builds.**
228
+
229
+ - `nav_dim`: walk the graph on 8-bit codes of principal directions, re-ranking with the full vectors.
230
+ With the other changes here, 2.8-4.2× Glass's queries per second on GIST1M and 1.6-2.7× on OpenAI
231
+ DBpedia embeddings at equal recall, on Intel and AMD servers.
232
+ - `refine_links()`: a second build pass in which every node searches the finished graph and
233
+ reconnects; `fill_free_links()` gives free link slots to two-hop neighbours.
234
+ - `fast_build`: build on the 8-bit codes.
235
+ - `rerank_z`: stop the re-rank early once the remaining candidates can't reach the top k.
236
+ - Queries are projected onto principal directions on the integer kernel; the AVX2 and AVX-VNNI integer
237
+ kernels finish with vector loads instead of a scalar tail.
238
+ - The prefetch tuner can fetch a record's every cache line; on a Xeon Gold 6226 that was worth up to
239
+ 1.7× on some datasets.
240
+ - PCA runs as blocked matrix products (choosing directions 5× faster on GIST1M), training runs on
241
+ every core, and index memory is zeroed on every core, which spreads it across NUMA nodes.
242
+
243
+ **Fixes.**
244
+
245
+ - `Database`: a write that could not be applied (the database full, or not yet trained) was written to
246
+ the log first, after which every open failed replaying it. Writes are now checked before they are
247
+ logged, and replacing a vector in a full database frees its slot before compacting.
248
+ - `RecallGuard` searched, and measured its reference, with the default re-rank depth; it now uses the
249
+ index's own settings and re-ranks the reference's whole beam. `explain()` and `trace()` likewise.
250
+ - The LangChain store copied every stored vector on each add (quadratic in the store's size).
251
+ - `pip install epzero` from source failed on machines with gRPC installed: it tried to build the
252
+ cluster node, whose protocol files aren't in the package.
253
+
254
+ **Compatibility.** Indexes without a profile are still written in the format older versions read
255
+ (v2, or v3 with principal directions); automatically configured ones are v4, which 0.3 cannot load.
256
+ `search()`'s `k`, `ef`, `rerank` and `rerank_z` now default to the index's profile, which for an index
257
+ built by hand is the old defaults (10, 64, 2 × k, off).
258
+
259
+ Earlier releases are described by their git tags (`v0.2.0`, `v0.3.0`).
epzero-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lajat Manekar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.