@soulcraft/cortex 2.4.0 → 2.5.0

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 (2) hide show
  1. package/dist/plugin.js +12 -4
  2. package/package.json +3 -3
package/dist/plugin.js CHANGED
@@ -123,6 +123,11 @@ const cortexPlugin = {
123
123
  // Quantized distance: SQ8 cosine distance on uint8 arrays (no dequantization).
124
124
  // Consumed by brainy's HNSW SQ8 reranking (setSQ8DistanceImplementation).
125
125
  context.registerProvider('distance:sq8', native.cosineDistanceSq8);
126
+ // Quantized distance: SQ4 cosine distance on packed nibbles (2 values per byte).
127
+ // Consumed by brainy 7.28.0+ HNSW SQ4 reranking when config.hnsw.quantization.bits === 4
128
+ // via setSQ4DistanceImplementation. Byte-for-byte identical to brainy's
129
+ // distanceSQ4Js; cross-language parity verified in the brainy test suite.
130
+ context.registerProvider('distance:sq4', native.cosineDistanceSq4);
126
131
  // Graph connection compression: delta-varint encoded connection lists.
127
132
  // Reserved for the 2.4.0 vector/graph-storage initiative (HNSW connection
128
133
  // persistence). Registered now so that work wires brainy without a cortex change.
@@ -134,10 +139,13 @@ const cortexPlugin = {
134
139
  // up. The following native capabilities exist in Rust + napi but are intentionally
135
140
  // NOT registered (no brainy consumer yet) — they are re-registered the moment a
136
141
  // hook lands, with no Rust change required:
137
- // • SQ8 batch distance, SQ8/SQ4 quantize-codec, SQ4 distance, PQ codebook
138
- // → pending a brainy quantization-delegation hook (handoff BR-QUANT-SQ4-PQ)
139
- // compaction:bfsOrder / compaction:hnswOrder
140
- // pending a brainy compaction-order hook (handoff BR-COMPACTION-HOOK)
142
+ // • SQ8 batch distance, SQ8/SQ4 quantize-codec, PQ codebook
143
+ // → pending broader brainy quantization-delegation hooks beyond the
144
+ // distance-fn swap (already wired for SQ8 + SQ4 above)
145
+ // compaction:bfsOrder / compaction:hnswOrder superseded after the
146
+ // 2026-05-28 strategic reset: DiskANN's Vamana produces locality natively,
147
+ // so the HNSW BFS-compaction hook is not pursued. Rust impls stay as
148
+ // future-utility; no brainy hook will be added.
141
149
  // HNSW: Native Rust graph engine with SIMD distance and Arc-based COW
142
150
  const { NativeHNSWWrapper } = await import('./hnsw/NativeHNSWWrapper.js');
143
151
  context.registerProvider('hnsw', (config, distanceFn, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/cortex",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Native Rust acceleration for Brainy — SIMD distance, vector quantization, zero-copy mmap, native embeddings. Free tier for storage, Pro license for compute acceleration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,11 +66,11 @@
66
66
  "LICENSE"
67
67
  ],
68
68
  "peerDependencies": {
69
- "@soulcraft/brainy": ">=7.26.0"
69
+ "@soulcraft/brainy": ">=7.28.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@napi-rs/cli": "^3.0.0",
73
- "@soulcraft/brainy": "^7.26.0",
73
+ "@soulcraft/brainy": "^7.28.0",
74
74
  "@types/node": "^22.0.0",
75
75
  "tsx": "^4.21.0",
76
76
  "typescript": "^5.9.3",