@delali/narsil 0.3.1-next.90 → 0.3.1-next.94
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.
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/browser/{chunk-3GZQKGVQ.mjs → chunk-4JTBL63P.mjs} +13 -5
- package/dist/browser/{chunk-3ZRMZIH4.mjs → chunk-5S74HQRT.mjs} +208 -78
- package/dist/browser/{chunk-FHFFWLEK.mjs → chunk-HARBSUWP.mjs} +3 -4
- package/dist/browser/{chunk-RAHUQOJL.mjs → chunk-HC6DMR4T.mjs} +2445 -2107
- package/dist/browser/{chunk-JACCR3BJ.mjs → chunk-PP6N5CCS.mjs} +2 -2
- package/dist/browser/{chunk-NQW2YXEX.mjs → chunk-WKPJ4E73.mjs} +1 -1
- package/dist/browser/{durability-wiring-VSUBLUDK.mjs → durability-wiring-7DKYHKT5.mjs} +498 -71
- package/dist/browser/{module-E25UDADM.mjs → module-O5WH32EL.mjs} +102 -54
- package/dist/browser/release-76MXRPGV.mjs +33 -0
- package/dist/browser/replace-RURXTGVG.mjs +57 -0
- package/dist/browser/restore-queue-Z7FZZNKH.mjs +35 -0
- package/dist/browser/{snapshot-5MXBEDXF.mjs → snapshot-PPTZ565G.mjs} +368 -103
- package/dist/browser/{write-6SBYTS62.mjs → write-2ZAA7UDH.mjs} +4 -4
- package/dist/{capabilities-SJPttcgQ.d.ts → capabilities-xsJfdFoQ.d.ts} +11 -3
- package/dist/chunk-2GZGBOQI.mjs +426 -0
- package/dist/{chunk-CVQWQVFX.mjs → chunk-4ZJWRETC.mjs} +2 -2
- package/dist/chunk-7KC56574.mjs +507 -0
- package/dist/{chunk-MXS5HWIH.mjs → chunk-7VALMHZF.mjs} +89 -17
- package/dist/chunk-7X5JST5L.mjs +114 -0
- package/dist/{chunk-UKSUENHK.mjs → chunk-AF2CIKYC.mjs} +40 -26
- package/dist/{chunk-BVOJIYRV.mjs → chunk-BB7MASRQ.mjs} +1 -1
- package/dist/{chunk-R6BMMQXH.mjs → chunk-C45FUYPI.mjs} +193 -79
- package/dist/{chunk-EMXAYPTQ.mjs → chunk-CHOGQSHK.mjs} +2326 -3503
- package/dist/{chunk-QZN3MIJ3.mjs → chunk-ES33L3HO.mjs} +2 -2
- package/dist/{chunk-VY4DXZ5P.mjs → chunk-EWBXO45L.mjs} +3 -3
- package/dist/{chunk-QAMUC2BJ.mjs → chunk-EX62BQT6.mjs} +10 -9
- package/dist/{chunk-MWJIAREY.mjs → chunk-EZD4MWOU.mjs} +4 -4
- package/dist/{chunk-YCJLVNWR.mjs → chunk-F52QGNZ2.mjs} +1 -1
- package/dist/{chunk-URGLSNKR.mjs → chunk-GJZHU4FC.mjs} +202 -16
- package/dist/{chunk-S4LQDSUL.mjs → chunk-J53IHLG7.mjs} +7 -7
- package/dist/{chunk-R7OSDAFK.mjs → chunk-K6A4FCVR.mjs} +1 -1
- package/dist/chunk-KOKM4PQN.mjs +52 -0
- package/dist/{chunk-GCM3JFVA.mjs → chunk-OHP7QR33.mjs} +2 -1
- package/dist/{chunk-T6CNO72J.mjs → chunk-QM3VPX4Z.mjs} +2 -2
- package/dist/{chunk-V7YUSKKZ.mjs → chunk-QWWCLRXX.mjs} +10 -6
- package/dist/chunk-QY7GC2MW.mjs +33 -0
- package/dist/{chunk-DCK4P5BI.mjs → chunk-R36MIGBU.mjs} +100 -59
- package/dist/{chunk-YRX6XMOQ.mjs → chunk-R6PR4WYZ.mjs} +1 -0
- package/dist/{chunk-RVM7AODE.mjs → chunk-RDJKYKMQ.mjs} +2 -2
- package/dist/{chunk-OOSIDHA3.mjs → chunk-RSRVGAIQ.mjs} +1 -1
- package/dist/{chunk-XSZVS4S3.mjs → chunk-RUIXODYU.mjs} +9 -4
- package/dist/{chunk-A3UB2MXL.mjs → chunk-SBCEHIPL.mjs} +4 -507
- package/dist/{chunk-TPJU7NDJ.mjs → chunk-SYWGORQB.mjs} +1 -0
- package/dist/chunk-UAUZGXJP.mjs +3591 -0
- package/dist/{chunk-CL4OM7GB.mjs → chunk-WBS3EYC4.mjs} +12 -8
- package/dist/{chunk-J2BPXTD7.mjs → chunk-WLOF6HSP.mjs} +3 -3
- package/dist/chunk-X5CV2E2B.mjs +1 -0
- package/dist/{chunk-ULRPNYAG.mjs → chunk-Z3MOCHG5.mjs} +120 -62
- package/dist/chunk-ZHS44YKF.mjs +35 -0
- package/dist/{client-BMK53IR2.d.ts → client-CgayPw2R.d.ts} +27 -3
- package/dist/client.d.ts +9 -8
- package/dist/client.mjs +16 -2
- package/dist/{config-UJx1dyX1.d.ts → config-3kBsQ0Pi.d.ts} +2 -2
- package/dist/{config-BUR-7eVQ.d.ts → config-B-RnO6dr.d.ts} +2 -2
- package/dist/direct-executor-IJTRU3YN.mjs +22 -0
- package/dist/distribution/coordinator/etcd.d.ts +3 -2
- package/dist/distribution/coordinator/etcd.mjs +5 -1
- package/dist/distribution/coordinator/in-memory.d.ts +3 -2
- package/dist/distribution/coordinator/in-memory.mjs +4 -0
- package/dist/distribution/transport/grpc.mjs +3 -3
- package/dist/distribution/transport/in-memory.mjs +1 -1
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +43 -9
- package/dist/distribution.mjs +4620 -4293
- package/dist/{durability-wiring-ZLRQU6FG.mjs → durability-wiring-Y55SCPFC.mjs} +524 -93
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-9X6W5naj.d.ts → engine-DSUfY2F0.d.ts} +53 -17
- package/dist/{index-vCMu8OeQ.d.ts → index-ONAEaqtx.d.ts} +8 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.ts +44 -25
- package/dist/index.mjs +22 -18
- package/dist/{memory-CV9NAxLY.d.ts → memory-wuXcYOD1.d.ts} +99 -79
- package/dist/{module-WIDYIJLY.mjs → module-VITS4ZR5.mjs} +72 -38
- package/dist/partial-words.mjs +5 -4
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +60 -58
- package/dist/persistence/durability/checkpoint-worker.mjs +27 -23
- package/dist/react.d.ts +8 -7
- package/dist/react.mjs +1 -0
- package/dist/release-BH3DKW3T.mjs +33 -0
- package/dist/replace-CEO5KJJ3.mjs +57 -0
- package/dist/restore-queue-4SG45BLF.mjs +35 -0
- package/dist/{schema-DtsgmNfU.d.ts → schema-DttzM-ln.d.ts} +12 -0
- package/dist/server.d.ts +11 -10
- package/dist/server.mjs +38 -11
- package/dist/snapshot-XBKE7PUG.mjs +738 -0
- package/dist/synonyms-CpOAHPa-.d.ts +52 -0
- package/dist/synonyms.d.ts +22 -0
- package/dist/synonyms.mjs +12 -0
- package/dist/{tasks-BGaZJyoY.d.ts → tasks-Bj9WBlFG.d.ts} +4 -1
- package/dist/{thread-ZP3UMIZT.mjs → thread-U7XYJWGG.mjs} +17 -12
- package/dist/vector/search-worker.d.ts +2 -1
- package/dist/vector/search-worker.mjs +6 -6
- package/dist/workers/entry.mjs +6 -6
- package/dist/{write-PXDKPG2R.mjs → write-BMNV7P2H.mjs} +24 -20
- package/package.json +15 -7
- package/dist/chunk-PR4O7CAP.mjs +0 -18
- package/dist/chunk-X4SEXL4U.mjs +0 -2310
- package/dist/chunk-Y2F66IQJ.mjs +0 -74
- package/dist/chunk-ZJ4CSAB2.mjs +0 -13
- package/dist/direct-executor-EGESD26S.mjs +0 -18
- package/dist/snapshot-22CUEYYW.mjs +0 -469
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { join, dirname } from 'path';
|
|
5
5
|
|
|
6
|
-
var NATIVE_CORE_ABI_VERSION =
|
|
6
|
+
var NATIVE_CORE_ABI_VERSION = 4;
|
|
7
7
|
var BINARY_FILE_NAME = "narsil-core.node";
|
|
8
8
|
var MUSL_DIRECTORY = "musl";
|
|
9
9
|
var PLATFORMS_WITH_A_BINARY = /* @__PURE__ */ new Set([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-QAMUC2BJ.mjs';
|
|
2
1
|
import { nodeThreadId } from './chunk-C7SLA6CM.mjs';
|
|
2
|
+
import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-EX62BQT6.mjs';
|
|
3
3
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
5
5
|
import { openSync, close, readFileSync } from 'fs';
|
|
6
6
|
import { rename, readFile, writeFile, unlink, realpath, readdir, readlink } from 'fs/promises';
|
|
7
7
|
import { endianness } from 'os';
|
|
@@ -628,4 +628,4 @@ async function listRecursive(dir, base, pathMod, fs) {
|
|
|
628
628
|
return results;
|
|
629
629
|
}
|
|
630
630
|
|
|
631
|
-
export { createDurableDirectory };
|
|
631
|
+
export { createDurableDirectory, getFs };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-
|
|
2
|
-
import { ReplicationMessageTypes } from './chunk-
|
|
1
|
+
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-EZD4MWOU.mjs';
|
|
2
|
+
import { ReplicationMessageTypes } from './chunk-OHP7QR33.mjs';
|
|
3
3
|
import { WIRE_BATCH_BUDGET } from './chunk-P36MUFEJ.mjs';
|
|
4
|
-
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-
|
|
10
|
-
import {
|
|
4
|
+
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-C45FUYPI.mjs';
|
|
5
|
+
import { MAX_FILE_BYTES } from './chunk-RDJKYKMQ.mjs';
|
|
6
|
+
import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, selectionKeeps, decodeMapWithoutFields, shareSegmentArrays, segmentArraysOf, mergeSegmentContents } from './chunk-UAUZGXJP.mjs';
|
|
7
|
+
import { fnv1a, isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-CHOGQSHK.mjs';
|
|
8
|
+
import { generateId, getLanguage } from './chunk-ZHS44YKF.mjs';
|
|
9
|
+
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-4ZJWRETC.mjs';
|
|
10
|
+
import { resolveIndexAnalysis } from './chunk-2GZGBOQI.mjs';
|
|
11
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
11
12
|
import { encode, decode } from '@msgpack/msgpack';
|
|
12
13
|
|
|
13
14
|
// src/persistence/durability/constants.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-
|
|
2
|
-
import { getNestedValue } from './chunk-
|
|
3
|
-
import { requireValidFieldTypes } from './chunk-
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-C45FUYPI.mjs';
|
|
2
|
+
import { getNestedValue } from './chunk-SBCEHIPL.mjs';
|
|
3
|
+
import { requireValidFieldTypes } from './chunk-4ZJWRETC.mjs';
|
|
4
4
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
5
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
5
|
+
import { ErrorCodes, NarsilError } from './chunk-SYWGORQB.mjs';
|
|
6
6
|
import { decode } from '@msgpack/msgpack';
|
|
7
7
|
|
|
8
8
|
function validateReplicationEntry(entry, localPrimaryTerm, log) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { osqRecordBytes } from './chunk-37CD3OKS.mjs';
|
|
2
2
|
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-KEHK2O6P.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
4
4
|
|
|
5
5
|
// src/vector/vector-index/dead-bits.ts
|
|
6
6
|
var NO_LIVE_VECTOR_AT_POSITION = -1;
|
|
@@ -1,11 +1,142 @@
|
|
|
1
1
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-P36MUFEJ.mjs';
|
|
2
|
-
import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-
|
|
3
|
-
import { getLanguage } from './chunk-PR4O7CAP.mjs';
|
|
2
|
+
import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-WLOF6HSP.mjs';
|
|
4
3
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-Q5DC6WAB.mjs';
|
|
4
|
+
import { generateId, getLanguage } from './chunk-ZHS44YKF.mjs';
|
|
5
|
+
import { decodeSynonymRules } from './chunk-7X5JST5L.mjs';
|
|
5
6
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
7
8
|
import { encode, decode } from '@msgpack/msgpack';
|
|
8
9
|
|
|
10
|
+
// src/distribution/cluster/constants.ts
|
|
11
|
+
var LEADERSHIP_IMBALANCE_THRESHOLD = 2;
|
|
12
|
+
var ESTIMATED_PARTITION_BYTES = 50 * 1024 * 1024;
|
|
13
|
+
var REBALANCE_THRESHOLD = 0.1;
|
|
14
|
+
var BOOTSTRAP_CAS_ATTEMPTS = 5;
|
|
15
|
+
var ALLOCATION_CAS_ATTEMPTS = 5;
|
|
16
|
+
var ALLOCATION_RETRY_DELAY_MS = 1e3;
|
|
17
|
+
var TEARDOWN_CAS_ATTEMPTS = 5;
|
|
18
|
+
var TEARDOWN_RETRY_DELAY_MS = 500;
|
|
19
|
+
var TEARDOWN_RETRY_ROUNDS = 3;
|
|
20
|
+
var RECOVERY_CAS_ATTEMPTS = 5;
|
|
21
|
+
var PARTITION_STORES_TIMEOUT_MS = 5e3;
|
|
22
|
+
var DEFAULT_CONTROLLER_CONFIG = {
|
|
23
|
+
leaseTtlMs: 15e3,
|
|
24
|
+
standbyRetryMs: 5e3
|
|
25
|
+
};
|
|
26
|
+
var DEFAULT_NODE_LIFECYCLE_CONFIG = {
|
|
27
|
+
bootstrapRetryBaseMs: 1e3,
|
|
28
|
+
bootstrapRetryMaxMs: 5e3,
|
|
29
|
+
bootstrapMaxRetries: 10,
|
|
30
|
+
allocationDebounceMs: 250,
|
|
31
|
+
nodeHeartbeatIntervalMs: 1e4
|
|
32
|
+
};
|
|
33
|
+
var MAX_SYNONYM_GENERATION_LENGTH = 128;
|
|
34
|
+
|
|
35
|
+
// src/distribution/payload-guards.ts
|
|
36
|
+
function isRecord(value) {
|
|
37
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
38
|
+
}
|
|
39
|
+
function isValidInteger(value) {
|
|
40
|
+
return typeof value === "number" && Number.isFinite(value) && Number.isInteger(value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/distribution/cluster/synonym-set.ts
|
|
44
|
+
var SYNONYM_CHUNK_BYTES = 1048576;
|
|
45
|
+
var SYNONYM_SET_PREFIX = "_narsil/synonyms/";
|
|
46
|
+
var MAX_UINT32 = 4294967295;
|
|
47
|
+
var DIGEST_PATTERN = /^[0-9a-f]{64}$/;
|
|
48
|
+
var FIRST_PRINTABLE_CODE = 32;
|
|
49
|
+
function isKeySegment(value) {
|
|
50
|
+
for (let i = 0; i < value.length; i++) {
|
|
51
|
+
const code = value.charCodeAt(i);
|
|
52
|
+
if (code < FIRST_PRINTABLE_CODE || value[i] === "/" || value[i] === "\\") return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
function synonymChunkKey(indexUuid, generation, chunk) {
|
|
57
|
+
return `${SYNONYM_SET_PREFIX}${indexUuid}/${generation}/${chunk}`;
|
|
58
|
+
}
|
|
59
|
+
function isUint32(value) {
|
|
60
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_UINT32;
|
|
61
|
+
}
|
|
62
|
+
async function digestOf(bytes) {
|
|
63
|
+
const view = bytes.buffer instanceof ArrayBuffer ? new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength) : Uint8Array.from(bytes);
|
|
64
|
+
const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", view));
|
|
65
|
+
return Array.from(hash, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
66
|
+
}
|
|
67
|
+
function synonymSetRefOf(raw) {
|
|
68
|
+
if (!isRecord(raw)) return "synonyms must be an object";
|
|
69
|
+
const { generation, digest, chunkCount, byteLength } = raw;
|
|
70
|
+
if (typeof generation !== "string" || generation.length === 0 || generation.length > MAX_SYNONYM_GENERATION_LENGTH || !isKeySegment(generation)) {
|
|
71
|
+
return "synonyms.generation must hold 1 to 128 characters, with no control character, slash, or backslash";
|
|
72
|
+
}
|
|
73
|
+
if (typeof digest !== "string" || !DIGEST_PATTERN.test(digest)) {
|
|
74
|
+
return "synonyms.digest must be a lowercase hexadecimal SHA-256";
|
|
75
|
+
}
|
|
76
|
+
if (!isUint32(byteLength) || byteLength === 0) {
|
|
77
|
+
return "synonyms.byteLength must be a positive whole number";
|
|
78
|
+
}
|
|
79
|
+
if (!isUint32(chunkCount) || chunkCount !== Math.ceil(byteLength / SYNONYM_CHUNK_BYTES)) {
|
|
80
|
+
return "synonyms.chunkCount must match synonyms.byteLength";
|
|
81
|
+
}
|
|
82
|
+
return { generation, digest, chunkCount, byteLength };
|
|
83
|
+
}
|
|
84
|
+
function decodeSynonymSetRef(raw, reject) {
|
|
85
|
+
const ref = synonymSetRefOf(raw);
|
|
86
|
+
return typeof ref === "string" ? reject(ref) : ref;
|
|
87
|
+
}
|
|
88
|
+
function synonymSetRefOrNull(raw) {
|
|
89
|
+
const ref = synonymSetRefOf(raw);
|
|
90
|
+
return typeof ref === "string" ? null : ref;
|
|
91
|
+
}
|
|
92
|
+
async function deleteSynonymSet(coordinator, indexUuid, ref) {
|
|
93
|
+
for (let chunk = 0; chunk < ref.chunkCount; chunk++) {
|
|
94
|
+
await coordinator.delete(synonymChunkKey(indexUuid, ref.generation, chunk));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function storeSynonymSet(coordinator, indexUuid, encoded) {
|
|
98
|
+
const ref = {
|
|
99
|
+
generation: generateId(),
|
|
100
|
+
digest: await digestOf(encoded),
|
|
101
|
+
chunkCount: Math.ceil(encoded.byteLength / SYNONYM_CHUNK_BYTES),
|
|
102
|
+
byteLength: encoded.byteLength
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
for (let chunk = 0; chunk < ref.chunkCount; chunk++) {
|
|
106
|
+
const start = chunk * SYNONYM_CHUNK_BYTES;
|
|
107
|
+
const bytes = encoded.subarray(start, Math.min(start + SYNONYM_CHUNK_BYTES, encoded.byteLength));
|
|
108
|
+
if (!await coordinator.compareAndSet(synonymChunkKey(indexUuid, ref.generation, chunk), null, bytes)) {
|
|
109
|
+
throw new NarsilError(
|
|
110
|
+
ErrorCodes.CONTROLLER_METADATA_INVALID,
|
|
111
|
+
`Synonym set chunk ${chunk} of a fresh copy already exists in the coordinator`,
|
|
112
|
+
{ indexUuid, generation: ref.generation, chunk }
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
await deleteSynonymSet(coordinator, indexUuid, ref).catch(() => void 0);
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
120
|
+
return ref;
|
|
121
|
+
}
|
|
122
|
+
async function readSynonymSet(coordinator, indexUuid, ref, reject) {
|
|
123
|
+
const encoded = new Uint8Array(ref.byteLength);
|
|
124
|
+
let filled = 0;
|
|
125
|
+
for (let chunk = 0; chunk < ref.chunkCount; chunk++) {
|
|
126
|
+
const bytes = await coordinator.get(synonymChunkKey(indexUuid, ref.generation, chunk));
|
|
127
|
+
if (bytes === null) return null;
|
|
128
|
+
if (bytes.byteLength > encoded.byteLength - filled) return reject("the stored synonym set exceeds its byteLength");
|
|
129
|
+
encoded.set(bytes, filled);
|
|
130
|
+
filled += bytes.byteLength;
|
|
131
|
+
}
|
|
132
|
+
if (filled !== ref.byteLength) return reject("the stored synonym set falls short of its byteLength");
|
|
133
|
+
if (await digestOf(encoded) !== ref.digest) return reject("the stored synonym set does not match its digest");
|
|
134
|
+
return encoded;
|
|
135
|
+
}
|
|
136
|
+
function storedSynonymSetRules(encoded, reject) {
|
|
137
|
+
return decodeSynonymRules(encoded, (message) => reject(message));
|
|
138
|
+
}
|
|
139
|
+
|
|
9
140
|
// src/distribution/cluster/index-settings.ts
|
|
10
141
|
function partitionLimitsOf(partitions) {
|
|
11
142
|
if (partitions === void 0) {
|
|
@@ -71,7 +202,7 @@ function indexSettingsOf(config) {
|
|
|
71
202
|
...settingsFieldsOf(config)
|
|
72
203
|
};
|
|
73
204
|
}
|
|
74
|
-
function
|
|
205
|
+
function isRecord2(value) {
|
|
75
206
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
76
207
|
}
|
|
77
208
|
function settingsRejection(indexName) {
|
|
@@ -88,7 +219,7 @@ function decodeIndexSettings(raw, indexName) {
|
|
|
88
219
|
return void 0;
|
|
89
220
|
}
|
|
90
221
|
const reject = settingsRejection(indexName);
|
|
91
|
-
if (!
|
|
222
|
+
if (!isRecord2(raw)) {
|
|
92
223
|
return reject("settings must be an object");
|
|
93
224
|
}
|
|
94
225
|
if (typeof raw.language !== "string" || raw.language.length === 0) {
|
|
@@ -96,13 +227,15 @@ function decodeIndexSettings(raw, indexName) {
|
|
|
96
227
|
}
|
|
97
228
|
const embedding = restoredEmbedding(raw.embedding, reject);
|
|
98
229
|
const partitions = restoredPartitionConfig(raw.partitionConfig, reject);
|
|
230
|
+
const synonyms = raw.synonyms === void 0 ? void 0 : decodeSynonymSetRef(raw.synonyms, reject);
|
|
99
231
|
return {
|
|
100
232
|
language: raw.language,
|
|
101
233
|
...settingsFieldsOf({
|
|
102
234
|
...readSharedConfigFields(raw, reject),
|
|
103
235
|
...partitions !== void 0 ? { partitions } : {},
|
|
104
236
|
...embedding !== void 0 ? { embedding } : {}
|
|
105
|
-
})
|
|
237
|
+
}),
|
|
238
|
+
...synonyms !== void 0 ? { synonyms } : {}
|
|
106
239
|
};
|
|
107
240
|
}
|
|
108
241
|
function withPartitionCount(config, partitionCount) {
|
|
@@ -112,7 +245,7 @@ function indexConfigFromSettings(schema, settings, indexName) {
|
|
|
112
245
|
if (settings === void 0) {
|
|
113
246
|
return { schema };
|
|
114
247
|
}
|
|
115
|
-
const { language, embedding, partitionConfig, ...fields } = settings;
|
|
248
|
+
const { language, embedding, partitionConfig, synonyms: _synonyms, ...fields } = settings;
|
|
116
249
|
return {
|
|
117
250
|
schema,
|
|
118
251
|
language,
|
|
@@ -153,14 +286,14 @@ function validateIndexName(indexName) {
|
|
|
153
286
|
);
|
|
154
287
|
}
|
|
155
288
|
}
|
|
156
|
-
function
|
|
289
|
+
function isValidInteger2(value) {
|
|
157
290
|
return typeof value === "number" && Number.isFinite(value) && Number.isInteger(value);
|
|
158
291
|
}
|
|
159
292
|
function indexConfigKey(indexName) {
|
|
160
293
|
return `${INDEX_CONFIG_PREFIX}${indexName}${INDEX_CONFIG_SUFFIX}`;
|
|
161
294
|
}
|
|
162
295
|
function validateDecodedMetadata(decoded, indexName) {
|
|
163
|
-
if (!
|
|
296
|
+
if (!isRecord2(decoded)) {
|
|
164
297
|
throw new NarsilError(
|
|
165
298
|
ErrorCodes.CONTROLLER_METADATA_INVALID,
|
|
166
299
|
`Index metadata for '${indexName}' is not an object`,
|
|
@@ -181,21 +314,21 @@ function validateDecodedMetadata(decoded, indexName) {
|
|
|
181
314
|
{ indexName, received: truncateForDisplay(decoded.indexName) }
|
|
182
315
|
);
|
|
183
316
|
}
|
|
184
|
-
if (!
|
|
317
|
+
if (!isValidInteger2(decoded.partitionCount) || decoded.partitionCount <= 0 || decoded.partitionCount > MAX_PARTITION_COUNT) {
|
|
185
318
|
throw new NarsilError(
|
|
186
319
|
ErrorCodes.CONTROLLER_METADATA_INVALID,
|
|
187
320
|
`Index metadata for '${indexName}' has invalid partitionCount (must be an integer between 1 and ${MAX_PARTITION_COUNT})`,
|
|
188
321
|
{ indexName, partitionCount: truncateForDisplay(decoded.partitionCount) }
|
|
189
322
|
);
|
|
190
323
|
}
|
|
191
|
-
if (!
|
|
324
|
+
if (!isValidInteger2(decoded.replicationFactor) || decoded.replicationFactor < 0 || decoded.replicationFactor > MAX_REPLICATION_FACTOR) {
|
|
192
325
|
throw new NarsilError(
|
|
193
326
|
ErrorCodes.CONTROLLER_METADATA_INVALID,
|
|
194
327
|
`Index metadata for '${indexName}' has invalid replicationFactor (must be an integer between 0 and ${MAX_REPLICATION_FACTOR})`,
|
|
195
328
|
{ indexName, replicationFactor: truncateForDisplay(decoded.replicationFactor) }
|
|
196
329
|
);
|
|
197
330
|
}
|
|
198
|
-
if (!
|
|
331
|
+
if (!isRecord2(decoded.constraints)) {
|
|
199
332
|
throw new NarsilError(
|
|
200
333
|
ErrorCodes.CONTROLLER_METADATA_INVALID,
|
|
201
334
|
`Index metadata for '${indexName}' has invalid constraints`,
|
|
@@ -244,14 +377,67 @@ async function readStoredMetadata(coordinator, indexName) {
|
|
|
244
377
|
}
|
|
245
378
|
const decoded = decode(raw);
|
|
246
379
|
const record = validateDecodedMetadata(decoded, indexName);
|
|
247
|
-
return { record, rawSettings:
|
|
380
|
+
return { bytes: raw, record, rawSettings: isRecord2(decoded) ? decoded.settings : void 0 };
|
|
381
|
+
}
|
|
382
|
+
async function readIndexMetadataSnapshot(coordinator, indexName) {
|
|
383
|
+
const stored = await readStoredMetadata(coordinator, indexName);
|
|
384
|
+
if (stored === null) return null;
|
|
385
|
+
return { bytes: stored.bytes, record: stored.record, settings: decodeIndexSettings(stored.rawSettings, indexName) };
|
|
386
|
+
}
|
|
387
|
+
function metadataWithSynonymSet(snapshot, ref) {
|
|
388
|
+
const decoded = decode(snapshot.bytes);
|
|
389
|
+
const fields = isRecord2(decoded) ? decoded : {};
|
|
390
|
+
const { synonyms: _replaced, ...settings } = isRecord2(fields.settings) ? fields.settings : { language: snapshot.settings?.language ?? getLanguage("english").name };
|
|
391
|
+
const nextSettings = ref === null ? settings : { ...settings, synonyms: ref };
|
|
392
|
+
return new Uint8Array(encode({ ...fields, settings: nextSettings }, { ignoreUndefined: true }));
|
|
248
393
|
}
|
|
249
394
|
async function getIndexMetadata(coordinator, indexName) {
|
|
250
395
|
return (await readStoredMetadata(coordinator, indexName))?.record ?? null;
|
|
251
396
|
}
|
|
397
|
+
async function readIndexState(coordinator, indexName) {
|
|
398
|
+
const reject = settingsRejection(indexName);
|
|
399
|
+
let stored = await readStoredMetadata(coordinator, indexName);
|
|
400
|
+
while (stored !== null) {
|
|
401
|
+
const { record } = stored;
|
|
402
|
+
const settings = decodeIndexSettings(stored.rawSettings, indexName);
|
|
403
|
+
const ref = settings?.synonyms;
|
|
404
|
+
if (ref === void 0) return { record, settings, synonyms: [] };
|
|
405
|
+
const encoded = await readSynonymSet(coordinator, record.indexUuid, ref, reject);
|
|
406
|
+
if (encoded !== null) return { record, settings, synonyms: storedSynonymSetRules(encoded, reject) };
|
|
407
|
+
stored = await readStoredMetadata(coordinator, indexName);
|
|
408
|
+
if (stored !== null && referencesSameSet(stored, record.indexUuid, ref, indexName)) {
|
|
409
|
+
return reject(`a chunk of synonym set ${ref.generation} is missing`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
function referencesSameSet(stored, indexUuid, ref, indexName) {
|
|
415
|
+
if (stored.record.indexUuid !== indexUuid) return false;
|
|
416
|
+
return decodeIndexSettings(stored.rawSettings, indexName)?.synonyms?.generation === ref.generation;
|
|
417
|
+
}
|
|
252
418
|
async function getClusterIndexConfig(coordinator, indexName, schema) {
|
|
253
|
-
const
|
|
254
|
-
|
|
419
|
+
const state = await readIndexState(coordinator, indexName);
|
|
420
|
+
const config = indexConfigFromSettings(schema, state?.settings, indexName);
|
|
421
|
+
return state === null || state.synonyms.length === 0 ? config : { ...config, synonyms: state.synonyms };
|
|
422
|
+
}
|
|
423
|
+
function decodedMetadataOf(bytes) {
|
|
424
|
+
let decoded;
|
|
425
|
+
try {
|
|
426
|
+
decoded = decode(bytes);
|
|
427
|
+
} catch {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
return isRecord2(decoded) ? decoded : null;
|
|
431
|
+
}
|
|
432
|
+
function indexUuidOfStoredMetadata(bytes) {
|
|
433
|
+
const decoded = decodedMetadataOf(bytes);
|
|
434
|
+
return typeof decoded?.indexUuid === "string" ? decoded.indexUuid : null;
|
|
435
|
+
}
|
|
436
|
+
function storedSynonymSetOf(bytes) {
|
|
437
|
+
const decoded = decodedMetadataOf(bytes);
|
|
438
|
+
if (decoded === null || typeof decoded.indexUuid !== "string" || !isRecord2(decoded.settings)) return null;
|
|
439
|
+
const ref = synonymSetRefOrNull(decoded.settings.synonyms);
|
|
440
|
+
return ref === null ? null : { indexUuid: decoded.indexUuid, ref };
|
|
255
441
|
}
|
|
256
442
|
|
|
257
|
-
export { getClusterIndexConfig, getIndexMetadata, indexConfigKey, indexSettingsOf, putIndexMetadata, validateIndexName, withPartitionCount };
|
|
443
|
+
export { ALLOCATION_CAS_ATTEMPTS, ALLOCATION_RETRY_DELAY_MS, BOOTSTRAP_CAS_ATTEMPTS, DEFAULT_CONTROLLER_CONFIG, DEFAULT_NODE_LIFECYCLE_CONFIG, ESTIMATED_PARTITION_BYTES, LEADERSHIP_IMBALANCE_THRESHOLD, PARTITION_STORES_TIMEOUT_MS, REBALANCE_THRESHOLD, RECOVERY_CAS_ATTEMPTS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, TEARDOWN_RETRY_ROUNDS, deleteSynonymSet, getClusterIndexConfig, getIndexMetadata, indexConfigFromSettings, indexConfigKey, indexSettingsOf, indexUuidOfStoredMetadata, isRecord, isValidInteger, metadataWithSynonymSet, putIndexMetadata, readIndexMetadataSnapshot, readIndexState, storeSynonymSet, storedSynonymSetOf, validateIndexName, withPartitionCount };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-
|
|
4
|
-
import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-
|
|
5
|
-
import { HEADER_SIZE } from './chunk-
|
|
6
|
-
import { MAX_FILE_BYTES } from './chunk-
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { vectorsPerFile } from './chunk-7VALMHZF.mjs';
|
|
2
|
+
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-WBS3EYC4.mjs';
|
|
3
|
+
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-F52QGNZ2.mjs';
|
|
4
|
+
import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-EX62BQT6.mjs';
|
|
5
|
+
import { HEADER_SIZE } from './chunk-C45FUYPI.mjs';
|
|
6
|
+
import { MAX_FILE_BYTES } from './chunk-RDJKYKMQ.mjs';
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
8
8
|
|
|
9
9
|
// src/persistence/archive/memory-store.ts
|
|
10
10
|
function joined(chunks) {
|
|
@@ -14,7 +14,7 @@ function requireLoadedVectorCode() {
|
|
|
14
14
|
function loadVectorCode() {
|
|
15
15
|
if (loaded !== null) return Promise.resolve(loaded);
|
|
16
16
|
if (loading === null) {
|
|
17
|
-
loading = import('./module-
|
|
17
|
+
loading = import('./module-VITS4ZR5.mjs').then(
|
|
18
18
|
(code) => {
|
|
19
19
|
loaded = code;
|
|
20
20
|
return code;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/runtime/simd-support.ts
|
|
2
|
+
var SIMD_PROBE_MODULE = new Uint8Array([
|
|
3
|
+
0,
|
|
4
|
+
97,
|
|
5
|
+
115,
|
|
6
|
+
109,
|
|
7
|
+
1,
|
|
8
|
+
0,
|
|
9
|
+
0,
|
|
10
|
+
0,
|
|
11
|
+
1,
|
|
12
|
+
5,
|
|
13
|
+
1,
|
|
14
|
+
96,
|
|
15
|
+
0,
|
|
16
|
+
1,
|
|
17
|
+
123,
|
|
18
|
+
3,
|
|
19
|
+
2,
|
|
20
|
+
1,
|
|
21
|
+
0,
|
|
22
|
+
10,
|
|
23
|
+
10,
|
|
24
|
+
1,
|
|
25
|
+
8,
|
|
26
|
+
0,
|
|
27
|
+
65,
|
|
28
|
+
0,
|
|
29
|
+
253,
|
|
30
|
+
15,
|
|
31
|
+
253,
|
|
32
|
+
98,
|
|
33
|
+
11
|
|
34
|
+
]);
|
|
35
|
+
function runtimeStartsSimdModule() {
|
|
36
|
+
try {
|
|
37
|
+
if (typeof WebAssembly === "undefined") return false;
|
|
38
|
+
new WebAssembly.Instance(new WebAssembly.Module(SIMD_PROBE_MODULE));
|
|
39
|
+
return true;
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var simdAvailable = runtimeStartsSimdModule();
|
|
45
|
+
function isSimdAvailable() {
|
|
46
|
+
return simdAvailable;
|
|
47
|
+
}
|
|
48
|
+
function markSimdUnavailable() {
|
|
49
|
+
simdAvailable = false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { isSimdAvailable, markSimdUnavailable };
|
|
@@ -58,7 +58,8 @@ var ClusterMessageTypes = {
|
|
|
58
58
|
PING: "cluster.ping",
|
|
59
59
|
PONG: "cluster.pong",
|
|
60
60
|
BOOTSTRAP_COMPLETE: "cluster.bootstrap_complete",
|
|
61
|
-
PARTITION_STORES: "cluster.partition_stores"
|
|
61
|
+
PARTITION_STORES: "cluster.partition_stores",
|
|
62
|
+
INDEX_SETTINGS: "cluster.index_settings"
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
export { ClusterMessageTypes, DEFAULT_TRANSPORT_CONFIG, QueryMessageTypes, ReplicationMessageTypes, TransportError, TransportErrorCodes };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
|
|
2
2
|
import { tabulatedLevenshtein } from './chunk-GES7U2PM.mjs';
|
|
3
|
-
import { parsedTypeOf } from './chunk-
|
|
3
|
+
import { parsedTypeOf } from './chunk-BB7MASRQ.mjs';
|
|
4
4
|
import { codePointCount, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
5
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
5
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
6
6
|
|
|
7
7
|
// src/core/bitset.ts
|
|
8
8
|
function createBitSet(capacity) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { decodeSegmentManifest, loadPartitionSegments, loadVectorField } from './chunk-
|
|
2
|
-
import { manifestKey, segmentsPrefix } from './chunk-
|
|
3
|
-
import { readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader } from './chunk-
|
|
4
|
-
import { VALID_HNSW_METRICS } from './chunk-
|
|
5
|
-
import { requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-
|
|
1
|
+
import { decodeSegmentManifest, loadPartitionSegments, loadVectorField } from './chunk-WBS3EYC4.mjs';
|
|
2
|
+
import { manifestKey, segmentsPrefix } from './chunk-EX62BQT6.mjs';
|
|
3
|
+
import { readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader } from './chunk-C45FUYPI.mjs';
|
|
4
|
+
import { VALID_HNSW_METRICS } from './chunk-RDJKYKMQ.mjs';
|
|
5
|
+
import { requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-4ZJWRETC.mjs';
|
|
6
6
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
8
8
|
import { decode, encode } from '@msgpack/msgpack';
|
|
9
9
|
|
|
10
10
|
// src/serialization/stored-vector-values.ts
|
|
@@ -255,6 +255,9 @@ function metadataToWire(meta) {
|
|
|
255
255
|
if (meta.heldPartitions !== void 0) {
|
|
256
256
|
wire.held_partitions = meta.heldPartitions;
|
|
257
257
|
}
|
|
258
|
+
if (Array.isArray(meta.synonyms) && meta.synonyms.length > 0) {
|
|
259
|
+
wire.synonyms = meta.synonyms;
|
|
260
|
+
}
|
|
258
261
|
return wire;
|
|
259
262
|
}
|
|
260
263
|
function wireToMetadata(raw) {
|
|
@@ -386,6 +389,7 @@ function wireToMetadata(raw) {
|
|
|
386
389
|
if (Array.isArray(raw.held_partitions) && raw.held_partitions.every(isNonNegativeInteger)) {
|
|
387
390
|
meta.heldPartitions = raw.held_partitions;
|
|
388
391
|
}
|
|
392
|
+
if (raw.synonyms !== void 0 && raw.synonyms !== null) meta.synonyms = raw.synonyms;
|
|
389
393
|
return meta;
|
|
390
394
|
}
|
|
391
395
|
function isNonNegativeInteger(value) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/vector/constants.ts
|
|
2
|
+
var WASM_PAGE_BYTES = 65536;
|
|
3
|
+
var MAX_WASM_PAGES = 65536;
|
|
4
|
+
var VECTOR_STORE_INITIAL_CAPACITY = 16;
|
|
5
|
+
var VECTOR_BLOCK_INITIAL_SLOTS = 256;
|
|
6
|
+
var DISK_STORAGE_BLOCK_BYTES = 67108864;
|
|
7
|
+
var MAX_VECTOR_ORDINALS = 16777216;
|
|
8
|
+
var UNPLACED_FLAG_CHUNK_ORDINALS = 1024;
|
|
9
|
+
var VECTOR_SCRATCH_SLOTS = 64;
|
|
10
|
+
var SCRATCH_SLOTS_PER_THREAD_POOL = 31;
|
|
11
|
+
var MAX_DOC_ID_TABLE_BYTES = 1073741824;
|
|
12
|
+
var MAX_WORKER_COPIES = 64;
|
|
13
|
+
var VECTOR_SEARCH_TIMEOUT_MS = 3e4;
|
|
14
|
+
var VECTOR_SEARCH_LOAD_TIMEOUT_MS = 3e5;
|
|
15
|
+
var VECTOR_INSERT_TIMEOUT_MS = 6e5;
|
|
16
|
+
var NATIVE_ATTACH_RETRY_MS = 1e3;
|
|
17
|
+
var MAX_RENUMBERED_SEARCH_ATTEMPTS = 3;
|
|
18
|
+
var LOCK_SPIN_ITERATIONS = 128;
|
|
19
|
+
var LOCK_WAIT_SLICE_MS = 20;
|
|
20
|
+
var GRAPH_LOCK_WAIT_SLICE_MS = 1;
|
|
21
|
+
var GRAPH_BUILD_DISPATCH_CHUNK = 64;
|
|
22
|
+
var GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER = 2;
|
|
23
|
+
|
|
24
|
+
// src/vector/osq/constants.ts
|
|
25
|
+
var OSQ_GRID = { 1: 0.798, 2: 1.493, 4: 2.514, 8: 3.922 };
|
|
26
|
+
var OSQ_STEPS = { 1: 1, 2: 3, 4: 15, 8: 255 };
|
|
27
|
+
var OSQ_QUERY_BITS = { 1: 4, 2: 4, 4: 4, 8: 8 };
|
|
28
|
+
var OSQ_LAMBDA = 0.1;
|
|
29
|
+
var OSQ_REFINE_ROUNDS = 5;
|
|
30
|
+
var OSQ_REFINE_TOLERANCE = 1e-8;
|
|
31
|
+
var MIN_OVERSAMPLE = 1;
|
|
32
|
+
|
|
33
|
+
export { DISK_STORAGE_BLOCK_BYTES, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, GRAPH_BUILD_DISPATCH_CHUNK, GRAPH_LOCK_WAIT_SLICE_MS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, MAX_DOC_ID_TABLE_BYTES, MAX_RENUMBERED_SEARCH_ATTEMPTS, MAX_VECTOR_ORDINALS, MAX_WASM_PAGES, MAX_WORKER_COPIES, MIN_OVERSAMPLE, NATIVE_ATTACH_RETRY_MS, OSQ_GRID, OSQ_LAMBDA, OSQ_QUERY_BITS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_STEPS, SCRATCH_SLOTS_PER_THREAD_POOL, UNPLACED_FLAG_CHUNK_ORDINALS, VECTOR_BLOCK_INITIAL_SLOTS, VECTOR_INSERT_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_STORE_INITIAL_CAPACITY, WASM_PAGE_BYTES };
|