@delali/narsil 0.3.1-next.102 → 0.3.1-next.104
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-KPJMDPHG.mjs → chunk-5YMT23EX.mjs} +13 -13
- package/dist/browser/{chunk-JOVZ6HMT.mjs → chunk-6E4SWUYZ.mjs} +65 -41
- package/dist/browser/{chunk-EJDUFWSO.mjs → chunk-CWWD2UHP.mjs} +2 -2
- package/dist/browser/{chunk-PGIM3HIM.mjs → chunk-ECSLQ3S5.mjs} +5 -5
- package/dist/browser/{chunk-RHG4O77A.mjs → chunk-J3QB4LBD.mjs} +1 -0
- package/dist/browser/{chunk-BDOSMEEP.mjs → chunk-PW7GJFPW.mjs} +3 -3
- package/dist/browser/{chunk-RIJSLY2I.mjs → chunk-SFXM7PLV.mjs} +2 -2
- package/dist/browser/{durability-wiring-SRUYT3VV.mjs → durability-wiring-HTBWDAOX.mjs} +6 -6
- package/dist/browser/{module-CBB2ETYP.mjs → module-6FVNK7DO.mjs} +5 -5
- package/dist/browser/{restore-queue-EEZQO6RF.mjs → restore-queue-CL43WZTZ.mjs} +1 -1
- package/dist/browser/{runtime-7ZAHCHWR.mjs → runtime-JQYPNOK6.mjs} +1 -1
- package/dist/browser/{snapshot-OAAA5UJ7.mjs → snapshot-NL4GSDUD.mjs} +7 -7
- package/dist/browser/{write-7D6VIK6O.mjs → write-YFOOPLAN.mjs} +5 -5
- package/dist/{capabilities-ByQRMOx-.d.ts → capabilities-DGaz7cb3.d.ts} +2 -2
- package/dist/{chunk-PC2G76VW.mjs → chunk-2MNJ2HX7.mjs} +2 -2
- package/dist/{chunk-SP3NM3ZG.mjs → chunk-35KEGAOS.mjs} +10 -10
- package/dist/{chunk-OEYI3KRB.mjs → chunk-3IQZYNW6.mjs} +2 -2
- package/dist/{chunk-S7GNDRPS.mjs → chunk-47PZE6CJ.mjs} +3 -3
- package/dist/{chunk-5JNA5SKS.mjs → chunk-5W2ODPPO.mjs} +4 -3
- package/dist/{chunk-KWTW6VTG.mjs → chunk-6GFVUXUH.mjs} +8 -8
- package/dist/{chunk-BWJVNZPR.mjs → chunk-6JUOMMHQ.mjs} +1 -0
- package/dist/{chunk-LKOB5COA.mjs → chunk-77SO7G55.mjs} +1 -1
- package/dist/{chunk-UTG5YNXV.mjs → chunk-AEF2O7B4.mjs} +1 -1
- package/dist/{chunk-BOFBLJFZ.mjs → chunk-B7BSQZ27.mjs} +3 -6
- package/dist/{chunk-LGAMKHA2.mjs → chunk-BLDJ5I6I.mjs} +65 -41
- package/dist/{chunk-OZDFA4WC.mjs → chunk-CYHQNM3T.mjs} +2 -2
- package/dist/{chunk-CVXLLEQ3.mjs → chunk-DQ5NJSBZ.mjs} +3 -3
- package/dist/chunk-DUWYU4D5.mjs +19 -0
- package/dist/{chunk-ZKWYWW4Y.mjs → chunk-FABI2JA7.mjs} +1 -1
- package/dist/{chunk-J5QP52HA.mjs → chunk-IGUTV3MX.mjs} +9 -9
- package/dist/{chunk-XADZPPZI.mjs → chunk-J2KRH2RJ.mjs} +4 -4
- package/dist/{chunk-2RIRGOUL.mjs → chunk-JSSGO4B5.mjs} +1 -1
- package/dist/{chunk-PNFKUCG3.mjs → chunk-KNRU5CJ4.mjs} +6 -6
- package/dist/{chunk-Q6XWVUZX.mjs → chunk-KSQS77DK.mjs} +1 -1
- package/dist/{chunk-YEEQHT4V.mjs → chunk-MJIJG4YT.mjs} +2 -2
- package/dist/{chunk-EMRMGYRE.mjs → chunk-MKPE3VZF.mjs} +2 -2
- package/dist/{chunk-75XIEF6H.mjs → chunk-MZW4V4DS.mjs} +1 -1
- package/dist/{chunk-WVCOCKBU.mjs → chunk-O372FZM4.mjs} +21 -21
- package/dist/{chunk-S7FL6UAH.mjs → chunk-OIN27OQH.mjs} +3 -3
- package/dist/{chunk-YYQIODMF.mjs → chunk-PAWVKEVS.mjs} +1 -1
- package/dist/{chunk-UA3AUGNV.mjs → chunk-PFQQ3LCQ.mjs} +6 -6
- package/dist/{chunk-JZVARCRZ.mjs → chunk-PQHR5FHC.mjs} +1 -1
- package/dist/{chunk-ZM7KU4YW.mjs → chunk-QALAFGF5.mjs} +1 -1
- package/dist/{chunk-GBEEG5AN.mjs → chunk-QSK35UC2.mjs} +2 -2
- package/dist/{chunk-46D6JQIG.mjs → chunk-RI5VNFAI.mjs} +2 -2
- package/dist/{chunk-PNEYIHA4.mjs → chunk-RPIE4QCL.mjs} +0 -1
- package/dist/{chunk-RF7PLG43.mjs → chunk-RWXFSGKJ.mjs} +2 -2
- package/dist/{chunk-OM362BRO.mjs → chunk-TDUBQ546.mjs} +3 -3
- package/dist/{chunk-R27EMH5M.mjs → chunk-VFEALJEA.mjs} +2 -2
- package/dist/{chunk-EWZLIYHV.mjs → chunk-WCNN2PLX.mjs} +1 -1
- package/dist/{chunk-ZI34TVOA.mjs → chunk-WU4P5J4G.mjs} +3 -3
- package/dist/{chunk-VI4R6W25.mjs → chunk-XWJGJ2SE.mjs} +6 -6
- package/dist/{client-BOStAkc5.d.ts → client-DI-xIXgR.d.ts} +2 -2
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +1 -0
- package/dist/{config-Cjvzbs_j.d.ts → config-DL_bDDD8.d.ts} +1 -1
- package/dist/{config-H6SGzbPH.d.ts → config-DWxtDsJ6.d.ts} +2 -2
- package/dist/{direct-executor-ZD64PPEZ.mjs → direct-executor-5NX2ZIAG.mjs} +11 -11
- package/dist/distribution/coordinator/etcd.mjs +3 -1
- package/dist/distribution/transport/grpc.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +5 -4
- package/dist/distribution/transport/in-memory.d.ts +2 -2
- package/dist/distribution/transport/in-memory.mjs +3 -2
- package/dist/distribution/transport/tcp.d.ts +2 -2
- package/dist/distribution/transport/tcp.mjs +4 -3
- package/dist/distribution.d.ts +6 -6
- package/dist/distribution.mjs +1746 -2276
- package/dist/{durability-wiring-FEUBR5BT.mjs → durability-wiring-LD4GWPWD.mjs} +25 -25
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-rC0vjjY-.d.ts → engine-D_SYDsId.d.ts} +1 -1
- package/dist/{events-DqOIg5xa.d.ts → events-C7_dboUr.d.ts} +1 -0
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +17 -17
- package/dist/{module-3S65MVCM.mjs → module-QFWZ5OBF.mjs} +10 -10
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.mjs +21 -21
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +1 -0
- package/dist/{rerank-K7C4WZFG.mjs → rerank-WVFFZV76.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{restore-queue-KQHA7ZV2.mjs → restore-queue-7QIKM6PY.mjs} +1 -1
- package/dist/{runtime-6Y4ZYXOG.mjs → runtime-AVUUCJWQ.mjs} +5 -5
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +12 -12
- package/dist/{snapshot-QGZPODM5.mjs → snapshot-JYTT36WI.mjs} +26 -26
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-CwPTz-tP.d.ts → tasks-BhjQZ8Qf.d.ts} +1 -1
- package/dist/{thread-N3IUGUS3.mjs → thread-AHLISTRZ.mjs} +12 -12
- package/dist/{types-2qoitTXg.d.ts → types-Ck97nB3D.d.ts} +1 -1
- package/dist/{types-Cz5okLml.d.ts → types-DvncmvuQ.d.ts} +11 -0
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/workers/entry.mjs +5 -5
- package/dist/{write-U5RI7MAX.mjs → write-GPFM2EIX.mjs} +19 -19
- package/package.json +7 -7
- package/dist/chunk-747OHOUA.mjs +0 -11
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, sortSignatureOf, requireSortableFields, fanOutQuery, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, FNV_OFFSET_BASIS, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, fnv1aContinue, partitionsIn, fnv1aContinueTaggedNumbers, undeclaredFieldOnStrictIndex } from './chunk-
|
|
1
|
+
import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, sortSignatureOf, requireSortableFields, fanOutQuery, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, FNV_OFFSET_BASIS, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, fnv1aContinue, partitionsIn, fnv1aContinueTaggedNumbers, undeclaredFieldOnStrictIndex } from './chunk-XWJGJ2SE.mjs';
|
|
2
2
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, DEFAULT_LIMIT, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, DEFAULT_OFFSET } from './chunk-LXWDQLTW.mjs';
|
|
3
|
-
import { MIN_OVERSAMPLE, MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-
|
|
4
|
-
import { flattenSchema, partialFieldsOf } from './chunk-
|
|
3
|
+
import { MIN_OVERSAMPLE, MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-QSK35UC2.mjs';
|
|
4
|
+
import { flattenSchema, partialFieldsOf } from './chunk-3IQZYNW6.mjs';
|
|
5
5
|
import { DEFAULT_MAX_PER_GROUP, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, RESULT_WINDOW, MAX_TOLERANCE, MAX_PREFIX_LENGTH } from './chunk-E74YLAIG.mjs';
|
|
6
6
|
import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
7
|
-
import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-
|
|
8
|
-
import { tokenize } from './chunk-
|
|
7
|
+
import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-77SO7G55.mjs';
|
|
8
|
+
import { tokenize } from './chunk-AEF2O7B4.mjs';
|
|
9
9
|
import { compareComparableKeys } from './chunk-R6A773WK.mjs';
|
|
10
10
|
import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
|
|
11
11
|
import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
12
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
12
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
13
13
|
|
|
14
14
|
// src/search/cursor-binding.ts
|
|
15
15
|
var ABSENT_TAG = 0;
|
|
@@ -1401,13 +1401,13 @@ function requireCursorDepth(cursor, signature, binding) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
function hybridSearchOf(params, context, limit, offset, cursorDepth) {
|
|
1403
1403
|
if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
|
|
1404
|
-
return import('./runtime-
|
|
1404
|
+
return import('./runtime-AVUUCJWQ.mjs').then(
|
|
1405
1405
|
(runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
|
|
1406
1406
|
);
|
|
1407
1407
|
}
|
|
1408
1408
|
function executeQuery(request, callerContext) {
|
|
1409
1409
|
if (request.rerank === void 0) return runQuery(request, callerContext);
|
|
1410
|
-
return import('./runtime-
|
|
1410
|
+
return import('./runtime-AVUUCJWQ.mjs').then(
|
|
1411
1411
|
(runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
|
|
1412
1412
|
);
|
|
1413
1413
|
}
|
|
@@ -68,6 +68,7 @@ var ErrorCodes = {
|
|
|
68
68
|
REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID",
|
|
69
69
|
REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED",
|
|
70
70
|
REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED",
|
|
71
|
+
REPLICATION_OUTCOME_UNKNOWN: "REPLICATION_OUTCOME_UNKNOWN",
|
|
71
72
|
REPLICATION_LOG_FULL: "REPLICATION_LOG_FULL",
|
|
72
73
|
REPLICATION_ENTRY_CORRUPT: "REPLICATION_ENTRY_CORRUPT",
|
|
73
74
|
REPLICATION_SNAPSHOT_CORRUPT: "REPLICATION_SNAPSHOT_CORRUPT",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PARSED_FIELD_TYPE_CACHE_ENTRIES, VECTOR_PATTERN, MAX_STORED_VECTOR_DIMENSION } from './chunk-L5ORED7V.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
3
3
|
|
|
4
4
|
// src/schema/validator/field-type.ts
|
|
5
5
|
var FIELD_OPTION_ORDER = ["sortable", "pattern", "partial"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
2
|
-
import { createNarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { createNarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
3
3
|
|
|
4
4
|
// src/core/tokenizer/constants.ts
|
|
5
5
|
var TOKEN_CACHE_SIZE_FLOOR = 5e4;
|
|
@@ -26,9 +26,6 @@ var COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS = [
|
|
|
26
26
|
5,
|
|
27
27
|
10
|
|
28
28
|
];
|
|
29
|
-
var CAPACITY_EXHAUSTED_BACKOFF_BASE_MS = 100;
|
|
30
|
-
var CAPACITY_EXHAUSTED_BACKOFF_MAX_MS = 500;
|
|
31
|
-
var JITTERED_BACKOFF_POLL_INTERVAL_MS = 20;
|
|
32
29
|
var DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS = 6e5;
|
|
33
30
|
var SYNCED_POSITION_REPORT_TIMEOUT_MS = 5e3;
|
|
34
31
|
var REGISTRATION_LEASE_DRIFT_SHARE = 0.1;
|
|
@@ -39,12 +36,10 @@ var CATCH_UP_FEED_WINDOW_MS = 1e3;
|
|
|
39
36
|
var MAX_CATCH_UP_IN_FLIGHT_BYTES = 67108864;
|
|
40
37
|
var CLEAR_PAGE_SIZE = 1e3;
|
|
41
38
|
var MAX_SYNONYM_REPLACEMENT_ATTEMPTS = 5;
|
|
42
|
-
var DEFAULT_MAX_CONCURRENT_SNAPSHOTS = 2;
|
|
43
39
|
var DEFAULT_MAX_PER_SOURCE_SNAPSHOTS = 1;
|
|
44
40
|
var DEFAULT_MAX_STREAMS_PER_INDEX = 4;
|
|
45
41
|
var SNAPSHOT_CHUNK_YIELD_INTERVAL_MS = 8;
|
|
46
42
|
var WRITE_APPLY_YIELD_INTERVAL_MS = 8;
|
|
47
|
-
var MAX_SNAPSHOT_SYNC_REQUEST_BYTES = 4096;
|
|
48
43
|
var MAX_SOURCE_ID_LENGTH = 256;
|
|
49
44
|
var MAX_WAIT_FOR_ACTIVE_REPLICAS = 255;
|
|
50
45
|
var MIN_CONTROLLER_LEASE_TTL_MS = 1e3;
|
|
@@ -52,6 +47,8 @@ var PRIMARY_CHANGE_RETRY_WINDOW_MS = 3e4;
|
|
|
52
47
|
var PRIMARY_CHANGE_POLL_INTERVAL_MS = 50;
|
|
53
48
|
var FORWARD_RETRY_INITIAL_DELAY_MS = 50;
|
|
54
49
|
var FORWARD_RETRY_DELAY_CAP_MS = 1e3;
|
|
50
|
+
var ROLLBACK_RETRY_INITIAL_DELAY_MS = 50;
|
|
51
|
+
var ROLLBACK_RETRY_DELAY_CAP_MS = 1e3;
|
|
55
52
|
var PARTITION_WRITE_CONCURRENCY = 16;
|
|
56
53
|
var MAX_NODE_LEFT_DELAY_MS = 2147483647;
|
|
57
54
|
var DEFAULT_BLOCK_WRITES_ABOVE = 0.9;
|
|
@@ -206,4 +203,4 @@ function readRecentMemoryFigures() {
|
|
|
206
203
|
return recentFigures;
|
|
207
204
|
}
|
|
208
205
|
|
|
209
|
-
export { ADMISSION_TIMEOUT_MS,
|
|
206
|
+
export { ADMISSION_TIMEOUT_MS, CASE_FOLD_EXPANSION_FACTOR, CATCH_UP_FEED_WINDOW_MS, CATCH_UP_TICK_MS, CLEAR_PAGE_SIZE, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, COPY_FAILURE_RETRY_DELAY_MS, DECOMMISSION_RECHECK_INTERVAL_MS, DEFAULT_BLOCK_WRITES_ABOVE, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DEFAULT_CAPACITY, DEFAULT_CREATE_INDEX_WAIT_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DEFAULT_RESUME_WRITES_BELOW, DISTINCT_TERM_HEAP_BYTES, DOCUMENT_ENTRY_OVERHEAD_BYTES, DOCUMENT_HEAP_BYTES_PER_ESTIMATED_BYTE, DOCUMENT_NUMBER_BYTES, DOCUMENT_PROPERTY_HEAP_BYTES, DOCUMENT_SCALAR_BYTES, DOCUMENT_VALUE_HEAP_BYTES, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, ENUM_VALUE_HEAP_BYTES, FORWARD_RETRY_DELAY_CAP_MS, FORWARD_RETRY_INITIAL_DELAY_MS, FULL_MEMORY_COLLECTION_INTERVAL_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, MAX_DROP_ACKNOWLEDGE_WAIT_MS, MAX_NODE_LEFT_DELAY_MS, MAX_SOURCE_ID_LENGTH, MAX_SYNONYM_REPLACEMENT_ATTEMPTS, MAX_WAIT_FOR_ACTIVE_REPLICAS, MEMORY_SAMPLE_INTERVAL_MS, MIN_CONTROLLER_LEASE_TTL_MS, NORMALIZATION_EXPANSION_FACTOR, PARTIAL_SPELLING_HEAP_BYTES, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, PARTITION_WRITE_CONCURRENCY, PATTERN_RUN_HEAP_BYTES, PRIMARY_CHANGE_POLL_INTERVAL_MS, PRIMARY_CHANGE_RETRY_WINDOW_MS, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, ROLLBACK_RETRY_DELAY_CAP_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, SYNCED_POSITION_REPORT_TIMEOUT_MS, TERM_UNIT_HEAP_BYTES, VECTOR_COMPONENT_HEAP_BYTES, VECTOR_DOCUMENT_HEAP_BYTES, WRITE_APPLY_YIELD_INTERVAL_MS, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, admitHeapBytes, collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, onRefusalAfterCollection, readMemoryFigures, readRecentMemoryFigures, reportRefusalAfterCollection, reserveHeapBytes, reservedHeapBytes };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { stopUsingTheNativeSearchCore, noteFallback, nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
|
|
2
2
|
import { unpackLevels, readTrailer, stageQueryLevels, osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, writeRecord } from './chunk-37CD3OKS.mjs';
|
|
3
3
|
import { markSimdUnavailable } from './chunk-KOKM4PQN.mjs';
|
|
4
|
-
import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, OSQ_STEPS, OSQ_GRID, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS,
|
|
5
|
-
import { loadNativeCore } from './chunk-
|
|
4
|
+
import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, OSQ_STEPS, OSQ_GRID, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, OSQ_QUERY_BITS, NATIVE_ATTACH_RETRY_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, OSQ_LAMBDA, MAX_DOC_ID_TABLE_BYTES } from './chunk-QSK35UC2.mjs';
|
|
5
|
+
import { loadNativeCore } from './chunk-PQHR5FHC.mjs';
|
|
6
6
|
import { COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, DEFAULT_EF_SEARCH, FARTHEST_REJECTED_LINKS_KEPT } from './chunk-HMFNFVP7.mjs';
|
|
7
7
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
8
|
import { threadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
9
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
9
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
10
10
|
|
|
11
11
|
// src/vector/shared-buffers/growable.ts
|
|
12
12
|
function sharedMemoryAvailable() {
|
|
@@ -81,6 +81,7 @@ var HELD_WRITE_VERSION = 1;
|
|
|
81
81
|
var HELD_GRAPH = 2;
|
|
82
82
|
var HELD_FENCE = 3;
|
|
83
83
|
var HELD_GRAPH_WAITING = 4;
|
|
84
|
+
var HELD_ENTRY = 5;
|
|
84
85
|
var HELD_WORDS_PER_THREAD = 32;
|
|
85
86
|
var METRIC_CODES = ["cosine", "dotProduct", "euclidean"];
|
|
86
87
|
function perOrdinal(bytesPerOrdinal, initialOrdinals) {
|
|
@@ -168,33 +169,16 @@ function waitOn(words, index, seen, sliceMs = LOCK_WAIT_SLICE_MS) {
|
|
|
168
169
|
function heldIndex(locks, kind) {
|
|
169
170
|
return locks.threadSlot * HELD_WORDS_PER_THREAD + kind;
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function acquireExclusiveWithin(words, index, deadlineMs) {
|
|
184
|
-
let spins = 0;
|
|
185
|
-
let deadline = Number.NaN;
|
|
186
|
-
for (; ; ) {
|
|
187
|
-
const seen = Atomics.compareExchange(words, index, FREE, EXCLUSIVE);
|
|
188
|
-
if (seen === FREE) return true;
|
|
189
|
-
if (spins < LOCK_SPIN_ITERATIONS) {
|
|
190
|
-
spins += 1;
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
const now = performance.now();
|
|
194
|
-
if (Number.isNaN(deadline)) deadline = now + deadlineMs;
|
|
195
|
-
else if (now >= deadline) return false;
|
|
196
|
-
waitOn(words, index, seen, GRAPH_LOCK_WAIT_SLICE_MS);
|
|
197
|
-
}
|
|
172
|
+
function waitedSince(locks, startedAt, lock) {
|
|
173
|
+
const now = performance.now();
|
|
174
|
+
if (Number.isNaN(startedAt)) return now;
|
|
175
|
+
if (now - startedAt < GRAPH_LOCK_WAIT_DEADLINE_MS) return startedAt;
|
|
176
|
+
if (releaseGoneThreads(locks) > 0) return now;
|
|
177
|
+
throw new NarsilError(
|
|
178
|
+
ErrorCodes.WORKER_TIMEOUT,
|
|
179
|
+
`Another thread held a lock on the vector graph for ${GRAPH_LOCK_WAIT_DEADLINE_MS} ms, so this thread stopped waiting for it`,
|
|
180
|
+
{ waitedMs: GRAPH_LOCK_WAIT_DEADLINE_MS, threadSlot: locks.threadSlot, lock }
|
|
181
|
+
);
|
|
198
182
|
}
|
|
199
183
|
function releaseExclusive(words, index) {
|
|
200
184
|
Atomics.store(words, index, FREE);
|
|
@@ -205,9 +189,22 @@ var WRITER_WAITING = 2;
|
|
|
205
189
|
var VERSION_STEP = 4;
|
|
206
190
|
function beginNodeRead(locks, ord) {
|
|
207
191
|
const words = locks.words(ord);
|
|
192
|
+
const seen = Atomics.load(words, ord);
|
|
193
|
+
if ((seen & WRITE_HELD) === 0) return seen;
|
|
194
|
+
return waitForNodeRead(locks, words, ord);
|
|
195
|
+
}
|
|
196
|
+
function waitForNodeRead(locks, words, ord) {
|
|
197
|
+
let spins = 0;
|
|
198
|
+
let startedAt = Number.NaN;
|
|
208
199
|
for (; ; ) {
|
|
209
200
|
const seen = Atomics.load(words, ord);
|
|
210
201
|
if ((seen & WRITE_HELD) === 0) return seen;
|
|
202
|
+
if (spins < LOCK_SPIN_ITERATIONS) {
|
|
203
|
+
spins += 1;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
spins = 0;
|
|
207
|
+
startedAt = waitedSince(locks, startedAt, "node");
|
|
211
208
|
}
|
|
212
209
|
}
|
|
213
210
|
function nodeReadHeld(locks, ord, version) {
|
|
@@ -217,6 +214,7 @@ function nodeReadHeld(locks, ord, version) {
|
|
|
217
214
|
function lockNodeWrite(locks, ord) {
|
|
218
215
|
const words = locks.words(ord);
|
|
219
216
|
let spins = 0;
|
|
217
|
+
let startedAt = Number.NaN;
|
|
220
218
|
for (; ; ) {
|
|
221
219
|
const seen = Atomics.load(words, ord);
|
|
222
220
|
if ((seen & WRITE_HELD) === 0) {
|
|
@@ -232,6 +230,7 @@ function lockNodeWrite(locks, ord) {
|
|
|
232
230
|
spins += 1;
|
|
233
231
|
continue;
|
|
234
232
|
}
|
|
233
|
+
startedAt = waitedSince(locks, startedAt, "node");
|
|
235
234
|
const waiting = seen | WRITER_WAITING;
|
|
236
235
|
if (waiting === seen || Atomics.compareExchange(words, ord, seen, waiting) === seen) {
|
|
237
236
|
waitOn(words, ord, waiting);
|
|
@@ -250,6 +249,7 @@ function unlockNodeWrite(locks, ord) {
|
|
|
250
249
|
function lockGraphShared(locks) {
|
|
251
250
|
const { header } = locks;
|
|
252
251
|
let spins = 0;
|
|
252
|
+
let startedAt = Number.NaN;
|
|
253
253
|
for (; ; ) {
|
|
254
254
|
const seen = Atomics.load(header, GRAPH_LOCK);
|
|
255
255
|
if (seen >= FREE && Atomics.load(header, GRAPH_WRITERS_WAITING) === 0) {
|
|
@@ -263,6 +263,7 @@ function lockGraphShared(locks) {
|
|
|
263
263
|
spins += 1;
|
|
264
264
|
continue;
|
|
265
265
|
}
|
|
266
|
+
startedAt = waitedSince(locks, startedAt, "graph");
|
|
266
267
|
waitOn(header, GRAPH_LOCK, seen, GRAPH_LOCK_WAIT_SLICE_MS);
|
|
267
268
|
}
|
|
268
269
|
}
|
|
@@ -272,17 +273,22 @@ function unlockGraphShared(locks) {
|
|
|
272
273
|
if (Atomics.sub(header, GRAPH_LOCK, 1) === 1 && canWait(header)) Atomics.notify(header, GRAPH_LOCK);
|
|
273
274
|
}
|
|
274
275
|
function lockGraphExclusive(locks) {
|
|
276
|
+
const { header } = locks;
|
|
275
277
|
Atomics.store(locks.held, heldIndex(locks, HELD_GRAPH_WAITING), 1);
|
|
276
|
-
Atomics.add(
|
|
278
|
+
Atomics.add(header, GRAPH_WRITERS_WAITING, 1);
|
|
277
279
|
try {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
280
|
+
let spins = 0;
|
|
281
|
+
let startedAt = Number.NaN;
|
|
282
|
+
for (; ; ) {
|
|
283
|
+
const seen = Atomics.compareExchange(header, GRAPH_LOCK, FREE, EXCLUSIVE);
|
|
284
|
+
if (seen === FREE) return;
|
|
285
|
+
if (spins < LOCK_SPIN_ITERATIONS) {
|
|
286
|
+
spins += 1;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
startedAt = waitedSince(locks, startedAt, "graphAlone");
|
|
290
|
+
waitOn(header, GRAPH_LOCK, seen, GRAPH_LOCK_WAIT_SLICE_MS);
|
|
291
|
+
}
|
|
286
292
|
} finally {
|
|
287
293
|
Atomics.sub(locks.header, GRAPH_WRITERS_WAITING, 1);
|
|
288
294
|
Atomics.store(locks.held, heldIndex(locks, HELD_GRAPH_WAITING), 0);
|
|
@@ -292,9 +298,25 @@ function unlockGraphExclusive(locks) {
|
|
|
292
298
|
releaseExclusive(locks.header, GRAPH_LOCK);
|
|
293
299
|
}
|
|
294
300
|
function lockEntry(locks) {
|
|
295
|
-
|
|
301
|
+
const { header } = locks;
|
|
302
|
+
let spins = 0;
|
|
303
|
+
let startedAt = Number.NaN;
|
|
304
|
+
for (; ; ) {
|
|
305
|
+
const seen = Atomics.compareExchange(header, GRAPH_ENTRY_LOCK, FREE, EXCLUSIVE);
|
|
306
|
+
if (seen === FREE) {
|
|
307
|
+
Atomics.store(locks.held, heldIndex(locks, HELD_ENTRY), 1);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (spins < LOCK_SPIN_ITERATIONS) {
|
|
311
|
+
spins += 1;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
startedAt = waitedSince(locks, startedAt, "entry");
|
|
315
|
+
waitOn(header, GRAPH_ENTRY_LOCK, seen, GRAPH_LOCK_WAIT_SLICE_MS);
|
|
316
|
+
}
|
|
296
317
|
}
|
|
297
318
|
function unlockEntry(locks) {
|
|
319
|
+
Atomics.store(locks.held, heldIndex(locks, HELD_ENTRY), 0);
|
|
298
320
|
releaseExclusive(locks.header, GRAPH_ENTRY_LOCK);
|
|
299
321
|
}
|
|
300
322
|
function releaseGoneThreads(locks) {
|
|
@@ -306,7 +328,8 @@ function releaseGoneThreads(locks) {
|
|
|
306
328
|
const writeOrd = Atomics.load(locks.held, base + HELD_WRITE) - 1;
|
|
307
329
|
const holdsGraph = Atomics.load(locks.held, base + HELD_GRAPH) === 1;
|
|
308
330
|
const waitsForGraph = Atomics.load(locks.held, base + HELD_GRAPH_WAITING) === 1;
|
|
309
|
-
|
|
331
|
+
const holdsEntry = Atomics.load(locks.held, base + HELD_ENTRY) === 1;
|
|
332
|
+
if (!holdsGraph && !waitsForGraph && !holdsEntry && writeOrd < 0) continue;
|
|
310
333
|
releaseSlot(locks.header, locks.held, writeOrd >= 0 ? locks.words(writeOrd) : null, slot);
|
|
311
334
|
released += 1;
|
|
312
335
|
}
|
|
@@ -320,6 +343,7 @@ function releaseSlot(header, held, words, threadSlot) {
|
|
|
320
343
|
if (Atomics.exchange(held, base + HELD_GRAPH_WAITING, 0) === 1) {
|
|
321
344
|
Atomics.sub(header, GRAPH_WRITERS_WAITING, 1);
|
|
322
345
|
}
|
|
346
|
+
if (Atomics.exchange(held, base + HELD_ENTRY, 0) === 1) releaseExclusive(header, GRAPH_ENTRY_LOCK);
|
|
323
347
|
const writeOrd = Atomics.exchange(held, base + HELD_WRITE, 0) - 1;
|
|
324
348
|
const writeVersion = Atomics.load(held, base + HELD_WRITE_VERSION);
|
|
325
349
|
if (words !== null && writeOrd >= 0 && writeOrd < words.length) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-QSK35UC2.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
3
3
|
|
|
4
4
|
// src/workers/constants.ts
|
|
5
5
|
var WORKER_YOUNG_GENERATION_MB = 24;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, BLOCK_MAX_BYTES, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, growBufferTo, unplacedChunkCount, STORE_DOC_ID_BYTES, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-
|
|
2
|
-
import { MAX_VECTOR_ORDINALS } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, BLOCK_MAX_BYTES, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, growBufferTo, unplacedChunkCount, STORE_DOC_ID_BYTES, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-BLDJ5I6I.mjs';
|
|
2
|
+
import { MAX_VECTOR_ORDINALS } from './chunk-QSK35UC2.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
4
4
|
import { readSync, closeSync, openSync } from 'fs';
|
|
5
5
|
|
|
6
6
|
function createVectorFileReader() {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReplicationMessageTypes } from './chunk-RPIE4QCL.mjs';
|
|
2
|
+
|
|
3
|
+
// src/distribution/transport/reply-deadline.ts
|
|
4
|
+
function replyDeadlineMs(messageType, config) {
|
|
5
|
+
if (messageType === ReplicationMessageTypes.ENTRY || messageType === ReplicationMessageTypes.ENTRY_BATCH) {
|
|
6
|
+
return config.replicationTimeout;
|
|
7
|
+
}
|
|
8
|
+
return config.requestTimeout;
|
|
9
|
+
}
|
|
10
|
+
function timeoutsOf(config) {
|
|
11
|
+
return {
|
|
12
|
+
connectTimeout: config.connectTimeout,
|
|
13
|
+
requestTimeout: config.requestTimeout,
|
|
14
|
+
replicationTimeout: config.replicationTimeout,
|
|
15
|
+
snapshotTimeout: config.snapshotTimeout
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { replyDeadlineMs, timeoutsOf };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
|
|
2
|
-
import { TransportError, TransportErrorCodes } from './chunk-
|
|
2
|
+
import { TransportError, TransportErrorCodes } from './chunk-RPIE4QCL.mjs';
|
|
3
3
|
import { encode, decode } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
// src/distribution/transport/tcp/types.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-
|
|
1
|
+
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-J2KRH2RJ.mjs';
|
|
2
2
|
import { WIRE_BATCH_BUDGET } from './chunk-P36MUFEJ.mjs';
|
|
3
|
-
import { ReplicationMessageTypes } from './chunk-
|
|
4
|
-
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-
|
|
5
|
-
import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, selectionKeeps, decodeMapWithoutFields, shareSegmentArrays, segmentArraysOf, mergeSegmentContents } from './chunk-
|
|
6
|
-
import { fnv1a, isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-
|
|
7
|
-
import { generateId, getLanguage } from './chunk-
|
|
8
|
-
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-
|
|
3
|
+
import { ReplicationMessageTypes } from './chunk-RPIE4QCL.mjs';
|
|
4
|
+
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-O372FZM4.mjs';
|
|
5
|
+
import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, selectionKeeps, decodeMapWithoutFields, shareSegmentArrays, segmentArraysOf, mergeSegmentContents } from './chunk-35KEGAOS.mjs';
|
|
6
|
+
import { fnv1a, isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-XWJGJ2SE.mjs';
|
|
7
|
+
import { generateId, getLanguage } from './chunk-QALAFGF5.mjs';
|
|
8
|
+
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-3IQZYNW6.mjs';
|
|
9
9
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
10
|
-
import { resolveIndexAnalysis } from './chunk-
|
|
11
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
10
|
+
import { resolveIndexAnalysis } from './chunk-RI5VNFAI.mjs';
|
|
11
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
12
12
|
import { encode, decode } from '@msgpack/msgpack';
|
|
13
13
|
|
|
14
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-O372FZM4.mjs';
|
|
2
|
+
import { getNestedValue } from './chunk-TDUBQ546.mjs';
|
|
3
|
+
import { requireValidFieldTypes } from './chunk-3IQZYNW6.mjs';
|
|
4
4
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
5
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
5
|
+
import { ErrorCodes, NarsilError } from './chunk-6JUOMMHQ.mjs';
|
|
6
6
|
import { decode } from '@msgpack/msgpack';
|
|
7
7
|
|
|
8
8
|
function validateReplicationEntry(entry, localPrimaryTerm, log) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-
|
|
2
|
-
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, manifestKey, segmentsPrefix, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-
|
|
3
|
-
import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope } from './chunk-
|
|
4
|
-
import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-
|
|
5
|
-
import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-
|
|
1
|
+
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-PAWVKEVS.mjs';
|
|
2
|
+
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, manifestKey, segmentsPrefix, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-IGUTV3MX.mjs';
|
|
3
|
+
import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope } from './chunk-O372FZM4.mjs';
|
|
4
|
+
import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-35KEGAOS.mjs';
|
|
5
|
+
import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-3IQZYNW6.mjs';
|
|
6
6
|
import { MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
|
|
7
7
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
8
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
9
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
9
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
10
10
|
import { decode, encode } from '@msgpack/msgpack';
|
|
11
11
|
|
|
12
12
|
// src/engine/durability-metadata.ts
|
|
@@ -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-QFWZ5OBF.mjs').then(
|
|
18
18
|
(code) => {
|
|
19
19
|
loaded = code;
|
|
20
20
|
return code;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { rerankQueryTextOf } from './chunk-KZ3NX2P7.mjs';
|
|
2
|
-
import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-
|
|
2
|
+
import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-WCNN2PLX.mjs';
|
|
3
3
|
import { DEFAULT_RERANK_WINDOW, MIN_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
4
4
|
import { DEFAULT_LIMIT, DEFAULT_OFFSET } from './chunk-LXWDQLTW.mjs';
|
|
5
5
|
import { RESULT_WINDOW } from './chunk-E74YLAIG.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
7
7
|
|
|
8
8
|
// src/rerank/params.ts
|
|
9
9
|
function invalid(message, details = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-
|
|
2
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
1
|
+
import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-3IQZYNW6.mjs';
|
|
2
|
+
import { ErrorCodes, NarsilError } from './chunk-6JUOMMHQ.mjs';
|
|
3
3
|
|
|
4
4
|
// src/narsil/internals.ts
|
|
5
5
|
var engineCores = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, queryBindingOf, executeQuery, executePreflight, executeSuggest, executeListDocuments, validateDocId } from './chunk-
|
|
2
|
-
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-
|
|
3
|
-
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-
|
|
1
|
+
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, queryBindingOf, executeQuery, executePreflight, executeSuggest, executeListDocuments, validateDocId } from './chunk-6GFVUXUH.mjs';
|
|
2
|
+
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-MKPE3VZF.mjs';
|
|
3
|
+
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-CYHQNM3T.mjs';
|
|
4
4
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
5
|
-
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-
|
|
6
|
-
import { requirePatternSearchFor, requirePartialWordSearchFor, collectQueryTermStats, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-
|
|
7
|
-
import { generateId, getLanguage } from './chunk-
|
|
5
|
+
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-35KEGAOS.mjs';
|
|
6
|
+
import { requirePatternSearchFor, requirePartialWordSearchFor, collectQueryTermStats, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-XWJGJ2SE.mjs';
|
|
7
|
+
import { generateId, getLanguage } from './chunk-QALAFGF5.mjs';
|
|
8
8
|
import { readHeapStatistics } from './chunk-LPQOEU5M.mjs';
|
|
9
9
|
import { DEFAULT_MAX_RERANK_WINDOW, DEFAULT_RERANK_TIMEOUT_MS } from './chunk-HJSN7UYG.mjs';
|
|
10
10
|
import { MAX_INDEX_CONFIGURATION_BYTES, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MAX_IMPORT_REFUSALS_REPORTED, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION, BATCH_CHUNK_SIZE } from './chunk-LXWDQLTW.mjs';
|
|
11
|
-
import { requireSearchBackendSettings } from './chunk-
|
|
12
|
-
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-
|
|
13
|
-
import { getNestedValue } from './chunk-
|
|
14
|
-
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, extractVectorFieldsFromSchema, schemaFieldsOf, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-
|
|
11
|
+
import { requireSearchBackendSettings } from './chunk-PQHR5FHC.mjs';
|
|
12
|
+
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-2MNJ2HX7.mjs';
|
|
13
|
+
import { getNestedValue } from './chunk-TDUBQ546.mjs';
|
|
14
|
+
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, extractVectorFieldsFromSchema, schemaFieldsOf, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-3IQZYNW6.mjs';
|
|
15
15
|
import { NATIVE_CRC32_MIN_BYTES, MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-U476IXKQ.mjs';
|
|
16
|
-
import { isSingleStringFieldType } from './chunk-
|
|
16
|
+
import { isSingleStringFieldType } from './chunk-77SO7G55.mjs';
|
|
17
17
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
18
18
|
import { createRequestId, isValidWorkerResponse } from './chunk-CQUMNIIG.mjs';
|
|
19
|
-
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-
|
|
19
|
+
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-KSQS77DK.mjs';
|
|
20
20
|
import { noteThreadSlotLive, threadSlotOfWorker, noteThreadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
21
21
|
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
22
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
22
|
+
import { ErrorCodes, NarsilError } from './chunk-6JUOMMHQ.mjs';
|
|
23
23
|
import { encode, decode } from '@msgpack/msgpack';
|
|
24
24
|
import * as zlib from 'zlib';
|
|
25
25
|
|
|
@@ -4026,7 +4026,7 @@ async function emitWriteEventAfter(source, indexName, write) {
|
|
|
4026
4026
|
// src/engine/core.ts
|
|
4027
4027
|
async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
4028
4028
|
validateWorkerConfig(config?.workers, config?.lifecycle);
|
|
4029
|
-
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-
|
|
4029
|
+
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-AVUUCJWQ.mjs')).resolveRerankSettings(config);
|
|
4030
4030
|
const eventHandlers = eventHandlersOf(config?.events);
|
|
4031
4031
|
const vectorWorkerCount = splitWorkerBudget(resolveWorkerCount(config?.workers?.count)).vector;
|
|
4032
4032
|
const vectorCopyPolicy = {
|
|
@@ -4037,7 +4037,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4037
4037
|
if (config?.lifecycle !== void 0 && durabilityTier === null) {
|
|
4038
4038
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index lifecycle settings require durability");
|
|
4039
4039
|
}
|
|
4040
|
-
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-
|
|
4040
|
+
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-LD4GWPWD.mjs');
|
|
4041
4041
|
const filesystemDurability = durabilityTier?.kind === "wal";
|
|
4042
4042
|
const executor = createDirectExecutor({
|
|
4043
4043
|
vectorWorkerCopies: vectorCopyPolicy,
|
|
@@ -4334,7 +4334,7 @@ async function shutdownEngine(core) {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
4336
4336
|
if (core.rerankAdapters.size > 0) {
|
|
4337
|
-
await (await import('./runtime-
|
|
4337
|
+
await (await import('./runtime-AVUUCJWQ.mjs')).shutdownRerankAdapters(core.rerankAdapters);
|
|
4338
4338
|
}
|
|
4339
4339
|
await orchestrator.shutdown();
|
|
4340
4340
|
await executor.shutdown();
|
|
@@ -6951,14 +6951,14 @@ function portabilityOperations(core, config, engine) {
|
|
|
6951
6951
|
return {
|
|
6952
6952
|
snapshot(indexName) {
|
|
6953
6953
|
return withOpenIndex(indexName, async () => {
|
|
6954
|
-
const { createSnapshot } = await import('./snapshot-
|
|
6954
|
+
const { createSnapshot } = await import('./snapshot-JYTT36WI.mjs');
|
|
6955
6955
|
return createSnapshot(snapshotDepsOf(indexName));
|
|
6956
6956
|
});
|
|
6957
6957
|
},
|
|
6958
6958
|
async restore(indexName, data) {
|
|
6959
6959
|
core.guardShutdown();
|
|
6960
6960
|
validateIndexName(indexName);
|
|
6961
|
-
const restored = import('./restore-queue-
|
|
6961
|
+
const restored = import('./restore-queue-7QIKM6PY.mjs').then(
|
|
6962
6962
|
({ queueRestore }) => queueRestore(core, restoreHost, restoresInFlight, indexName, data)
|
|
6963
6963
|
);
|
|
6964
6964
|
await emitWriteEventAfter(core, indexName, restored);
|
|
@@ -6967,8 +6967,8 @@ function portabilityOperations(core, config, engine) {
|
|
|
6967
6967
|
exportDocuments(indexName) {
|
|
6968
6968
|
return withOpenIndex(indexName, async () => {
|
|
6969
6969
|
const [{ checkpointForArchive }, { documentExportStream }] = await Promise.all([
|
|
6970
|
-
import('./snapshot-
|
|
6971
|
-
import('./write-
|
|
6970
|
+
import('./snapshot-JYTT36WI.mjs'),
|
|
6971
|
+
import('./write-GPFM2EIX.mjs')
|
|
6972
6972
|
]);
|
|
6973
6973
|
const header = indexConfigurationOf(core.requireIndex(indexName));
|
|
6974
6974
|
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
@@ -7020,7 +7020,7 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
7020
7020
|
const manager = core.requireManager(indexName);
|
|
7021
7021
|
const scoped = scopedParams(params, options);
|
|
7022
7022
|
await core.pluginRegistry.runHook("beforeSearch", { indexName, params: scoped });
|
|
7023
|
-
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-
|
|
7023
|
+
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-AVUUCJWQ.mjs');
|
|
7024
7024
|
const resolvedParams = await resolveVectorText(
|
|
7025
7025
|
rerank === void 0 ? scoped : rerank.withRerankQueryText(scoped),
|
|
7026
7026
|
entry.embeddingAdapter,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-P36MUFEJ.mjs';
|
|
2
|
-
import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-
|
|
3
|
-
import { generateId, getLanguage } from './chunk-
|
|
2
|
+
import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-MKPE3VZF.mjs';
|
|
3
|
+
import { generateId, getLanguage } from './chunk-QALAFGF5.mjs';
|
|
4
4
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-LXWDQLTW.mjs';
|
|
5
5
|
import { decodeSynonymRules } from './chunk-7X5JST5L.mjs';
|
|
6
6
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
8
8
|
import { encode, decode } from '@msgpack/msgpack';
|
|
9
9
|
|
|
10
10
|
// src/narsil/write-blocks.ts
|
|
@@ -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-HMFNFVP7.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
4
4
|
|
|
5
5
|
// src/vector/vector-index/dead-bits.ts
|
|
6
6
|
var NO_LIVE_VECTOR_AT_POSITION = -1;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { vectorsPerFile } from './chunk-
|
|
2
|
-
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-
|
|
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-
|
|
1
|
+
import { vectorsPerFile } from './chunk-47PZE6CJ.mjs';
|
|
2
|
+
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-KNRU5CJ4.mjs';
|
|
3
|
+
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-PAWVKEVS.mjs';
|
|
4
|
+
import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-IGUTV3MX.mjs';
|
|
5
|
+
import { HEADER_SIZE } from './chunk-O372FZM4.mjs';
|
|
6
6
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-6JUOMMHQ.mjs';
|
|
8
8
|
|
|
9
9
|
// src/persistence/archive/memory-store.ts
|
|
10
10
|
function joined(chunks) {
|