From feeba5f0aad309f00574ef3905248e8165aa9502 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:49:43 +0900 Subject: [PATCH 1/8] fix(example): stabilize Darwin native Rust loading --- example/ios/Flutter/Debug.xcconfig | 2 ++ example/ios/Flutter/Release.xcconfig | 2 ++ example/ios/Runner.xcodeproj/project.pbxproj | 4 +++- .../macos/Runner.xcodeproj/project.pbxproj | 6 ++--- lib/services/embedding_service.dart | 24 +++++-------------- lib/services/mobile_rag_vector_store.dart | 13 ++-------- lib/services/rag_engine.dart | 11 ++------- lib/src/rust/rust_library_loader.dart | 22 +++++++++++++++++ test/native/rust_library_loader_test.dart | 17 +++++++++++++ 9 files changed, 59 insertions(+), 42 deletions(-) create mode 100644 lib/src/rust/rust_library_loader.dart create mode 100644 test/native/rust_library_loader_test.dart diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index ec97fc6..87585d5 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1,4 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" +DEAD_CODE_STRIPPING = NO +OTHER_LDFLAGS = $(inherited) -force_load $(PODS_CONFIGURATION_BUILD_DIR)/rag_engine_flutter/librag_engine_flutter.a diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index c4855bf..7673476 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1,2 +1,4 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" +DEAD_CODE_STRIPPING = NO +OTHER_LDFLAGS = $(inherited) -force_load $(PODS_CONFIGURATION_BUILD_DIR)/rag_engine_flutter/librag_engine_flutter.a diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 6753ead..eb82d0f 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -152,7 +152,6 @@ 6CE2DD7604F56C9352F4EDE0 /* Pods-RunnerTests.release.xcconfig */, EB4B04987EF9333FDE25C19D /* Pods-RunnerTests.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -653,6 +652,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 642H78FVQ6; ENABLE_BITCODE = NO; @@ -663,6 +664,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.example.mobileRagEngineExample; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 8bd8fa7..a24ff58 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -545,7 +545,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; + DEAD_CODE_STRIPPING = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -621,7 +621,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; + DEAD_CODE_STRIPPING = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -677,7 +677,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; + DEAD_CODE_STRIPPING = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/lib/services/embedding_service.dart b/lib/services/embedding_service.dart index 6ad82f7..4a7e27d 100644 --- a/lib/services/embedding_service.dart +++ b/lib/services/embedding_service.dart @@ -7,9 +7,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_onnxruntime/flutter_onnxruntime.dart'; import 'package:mobile_rag_engine/src/internal/embedding_dimension_state.dart'; import 'package:mobile_rag_engine/src/rust/api/tokenizer.dart'; -import 'package:mobile_rag_engine/src/rust/frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart' - as frb; +import 'package:mobile_rag_engine/src/rust/rust_library_loader.dart'; /// Dart-based embedding service backed by a dedicated background isolate. /// @@ -119,9 +117,8 @@ class EmbeddingService { throw Exception(result['error']); } - final embedding = (result as TransferableTypedData) - .materialize() - .asFloat32List(); + final embedding = + (result as TransferableTypedData).materialize().asFloat32List(); _dimensionState.validateAndRemember(embedding.length); return embedding; } @@ -215,16 +212,8 @@ Future _workerEntryPoint(SendPort mainSendPort) async { ); } - // Initialize Rust FFI (required for tokenizer) - if (Platform.isMacOS) { - await RustLib.init( - externalLibrary: frb.ExternalLibrary.process( - iKnowHowToUseIt: true, - ), - ); - } else { - await RustLib.init(); - } + // Initialize Rust FFI (required for tokenizer). + await initRustLibForPlatform(); final sessionOptions = OrtSessionOptions( intraOpNumThreads: msg['intraOpNumThreads'] as int?, @@ -330,8 +319,7 @@ Future _workerEntryPoint(SendPort mainSendPort) async { message.contains('Invalid Feed Input Name')) { final sortedNames = requiredInputNames.toList()..sort(); replyPort.send({ - 'error': - 'ONNX input signature mismatch: $message\n' + 'error': 'ONNX input signature mismatch: $message\n' 'Model input names: ${sortedNames.join(', ')}\n' 'mobile_rag_engine sends: input_ids, attention_mask, ' 'optional token_type_ids.', diff --git a/lib/services/mobile_rag_vector_store.dart b/lib/services/mobile_rag_vector_store.dart index 3983269..8de9549 100644 --- a/lib/services/mobile_rag_vector_store.dart +++ b/lib/services/mobile_rag_vector_store.dart @@ -1,12 +1,10 @@ import 'dart:io'; import 'dart:typed_data'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart' - show ExternalLibrary; - import '../src/rust/api/db_pool.dart' as db_pool; import '../src/rust/api/source_rag.dart' as source_rag; import '../src/rust/frb_generated.dart'; +import '../src/rust/rust_library_loader.dart'; /// LLM-agnostic vector-store facade backed by mobile_rag_engine's source/chunk /// storage. @@ -230,14 +228,7 @@ class MobileRagVectorStore { return; } - try { - await RustLib.init(); - } catch (_) { - if (!Platform.isMacOS || RustLib.instance.initialized) rethrow; - await RustLib.init( - externalLibrary: ExternalLibrary.process(iKnowHowToUseIt: true), - ); - } + await initRustLibForPlatform(); _rustInitialized = true; } } diff --git a/lib/services/rag_engine.dart b/lib/services/rag_engine.dart index a7275a7..25b5da2 100644 --- a/lib/services/rag_engine.dart +++ b/lib/services/rag_engine.dart @@ -73,8 +73,7 @@ import 'rag_config.dart'; import 'source_rag_service.dart'; import 'context_builder.dart'; import '../src/rust/api/hybrid_search.dart' as hybrid; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -import '../src/rust/frb_generated.dart'; +import '../src/rust/rust_library_loader.dart'; /// Unified RAG engine with simplified initialization. /// @@ -86,13 +85,7 @@ class RagEngine { static Future _ensureRustInitialized() async { if (_isRustInitialized) return; - if (Platform.isMacOS) { - await RustLib.init( - externalLibrary: ExternalLibrary.process(iKnowHowToUseIt: true), - ); - } else { - await RustLib.init(); - } + await initRustLibForPlatform(); _isRustInitialized = true; } diff --git a/lib/src/rust/rust_library_loader.dart b/lib/src/rust/rust_library_loader.dart new file mode 100644 index 0000000..f12c1e8 --- /dev/null +++ b/lib/src/rust/rust_library_loader.dart @@ -0,0 +1,22 @@ +import 'dart:io'; + +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +import 'frb_generated.dart'; + +bool shouldLoadRustFromCurrentProcess({String? operatingSystem}) { + final os = operatingSystem ?? Platform.operatingSystem; + return os == 'ios' || os == 'macos'; +} + +Future initRustLibForPlatform() async { + if (RustLib.instance.initialized) return; + + if (shouldLoadRustFromCurrentProcess()) { + await RustLib.init( + externalLibrary: ExternalLibrary.process(iKnowHowToUseIt: true), + ); + } else { + await RustLib.init(); + } +} diff --git a/test/native/rust_library_loader_test.dart b/test/native/rust_library_loader_test.dart new file mode 100644 index 0000000..d35df3d --- /dev/null +++ b/test/native/rust_library_loader_test.dart @@ -0,0 +1,17 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mobile_rag_engine/src/rust/rust_library_loader.dart'; + +void main() { + test('Darwin platforms use current-process Rust symbols', () { + expect(shouldLoadRustFromCurrentProcess(operatingSystem: 'ios'), isTrue); + expect(shouldLoadRustFromCurrentProcess(operatingSystem: 'macos'), isTrue); + }); + + test('non-Darwin platforms use the default dynamic loader', () { + expect( + shouldLoadRustFromCurrentProcess(operatingSystem: 'android'), isFalse); + expect(shouldLoadRustFromCurrentProcess(operatingSystem: 'linux'), isFalse); + expect( + shouldLoadRustFromCurrentProcess(operatingSystem: 'windows'), isFalse); + }); +} From a2ec52a0033a949501907413ec5140b8b8f999da Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:50:28 +0900 Subject: [PATCH 2/8] feat(native): add mimalloc validation harness --- .../allocator_indexing_measure_test.dart | 282 + .../query_profile_measure_test.dart | 66 +- .../native_runtime_expectations.dart | 23 + example/lib/profiling/query_profiler.dart | 41 +- example/lib/profiling/rss_sampler.dart | 55 + .../native_runtime_expectations_test.dart | 60 + example/test/profiling/rss_sampler_test.dart | 34 + lib/src/rust/api/activation_metrics.dart | 83 + lib/src/rust/api/bm25_search.dart | 22 +- lib/src/rust/api/compression_utils.dart | 32 +- lib/src/rust/api/db_pool.dart | 6 +- lib/src/rust/api/document_parser.dart | 49 +- lib/src/rust/api/error.dart | 35 +- lib/src/rust/api/error.freezed.dart | 1585 +-- lib/src/rust/api/hnsw_index.dart | 44 +- lib/src/rust/api/hybrid_search.dart | 71 +- lib/src/rust/api/incremental_index.dart | 38 +- lib/src/rust/api/ingest_metrics.dart | 4 +- lib/src/rust/api/ingest_session.dart | 111 +- lib/src/rust/api/migration_meta.dart | 44 +- lib/src/rust/api/migration_meta.freezed.dart | 608 +- lib/src/rust/api/query_metrics.dart | 16 +- lib/src/rust/api/runtime_info.dart | 34 + lib/src/rust/api/semantic_chunker.dart | 44 +- lib/src/rust/api/simple_rag.dart | 55 +- lib/src/rust/api/source_rag.dart | 339 +- lib/src/rust/api/tokenizer.dart | 7 +- lib/src/rust/api/user_intent.dart | 27 +- lib/src/rust/api/user_intent.freezed.dart | 853 +- lib/src/rust/frb_generated.dart | 8509 ++++++++--------- lib/src/rust/frb_generated.io.dart | 649 +- lib/src/rust/frb_generated.web.dart | 699 +- rust_builder/rust/Cargo.lock | 19 + rust_builder/rust/Cargo.toml | 2 + rust_builder/rust/cargokit.yaml | 4 + .../rust/src/api/activation_metrics.rs | 159 + rust_builder/rust/src/api/mod.rs | 2 + rust_builder/rust/src/api/runtime_info.rs | 67 + rust_builder/rust/src/api/source_rag.rs | 121 +- rust_builder/rust/src/frb_generated.rs | 518 +- rust_builder/rust/src/lib.rs | 7 + 41 files changed, 7731 insertions(+), 7693 deletions(-) create mode 100644 example/integration_test/allocator_indexing_measure_test.dart create mode 100644 example/lib/profiling/native_runtime_expectations.dart create mode 100644 example/lib/profiling/rss_sampler.dart create mode 100644 example/test/profiling/native_runtime_expectations_test.dart create mode 100644 example/test/profiling/rss_sampler_test.dart create mode 100644 lib/src/rust/api/activation_metrics.dart create mode 100644 lib/src/rust/api/runtime_info.dart create mode 100644 rust_builder/rust/src/api/activation_metrics.rs create mode 100644 rust_builder/rust/src/api/runtime_info.rs diff --git a/example/integration_test/allocator_indexing_measure_test.dart b/example/integration_test/allocator_indexing_measure_test.dart new file mode 100644 index 0000000..d946fb0 --- /dev/null +++ b/example/integration_test/allocator_indexing_measure_test.dart @@ -0,0 +1,282 @@ +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:flutter/foundation.dart' + show kDebugMode, kProfileMode, kReleaseMode; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:path_provider/path_provider.dart'; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/activation_metrics.dart' as am; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/db_pool.dart'; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/runtime_info.dart' + as runtime_info; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/source_rag.dart' as rust_rag; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/rust_library_loader.dart'; +import 'package:mobile_rag_engine_example/profiling/native_runtime_expectations.dart'; +import 'package:mobile_rag_engine_example/profiling/rss_sampler.dart'; + +// Allocator-sensitive indexing/reindexing macro for mimalloc A/B validation. +// +// This intentionally bypasses ONNX embedding and seeds deterministic stub +// embeddings through the low-level Rust API. Seed time is logged but excluded +// from the allocator decision; the measured cell is BM25/HNSW rebuild + save. +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + const expectedNativeAllocator = String.fromEnvironment( + 'EXPECTED_NATIVE_ALLOCATOR', + ); + const expectedRustFeatures = String.fromEnvironment('EXPECTED_RUST_FEATURES'); + const textMbCsv = String.fromEnvironment( + 'ALLOCATOR_INDEXING_TEXT_MB', + defaultValue: '5,10,25', + ); + final textCases = _parseTextMbCases(textMbCsv); + + tearDown(() async { + try { + await closeDbPool(); + } catch (_) {} + }); + + test( + 'allocator indexing macro: deterministic BM25/HNSW rebuild cells', + () async { + _assertProfileMode(); + + await initRustLibForPlatform(); + + final nativeInfo = runtime_info.nativeRuntimeInfo(); + verifyNativeRuntimeExpectations( + actualAllocator: nativeInfo.nativeAllocator, + actualRustFeatures: nativeInfo.rustFeatures, + expectedAllocator: expectedNativeAllocator, + expectedRustFeatures: expectedRustFeatures, + ); + + final docsDir = await getApplicationDocumentsDirectory(); + final dbStem = '${docsDir.path}/allocator_indexing.sqlite'; + final exportFile = File( + '${docsDir.path}/allocator_indexing_profile_latest.jsonl', + ); + if (await exportFile.exists()) await exportFile.delete(); + for (final p in [ + dbStem, + '$dbStem-wal', + '$dbStem-shm', + '$dbStem-journal', + ]) { + final f = File(p); + if (await f.exists()) await f.delete(); + } + + await initDbPool(dbPath: dbStem, maxSize: 4); + await rust_rag.initSourceDb(); + + for (final textCase in textCases) { + final collectionId = 'allocator_indexing_${textCase.id}'; + final basePath = '${dbStem}_hnsw_$collectionId'; + + final seedSw = Stopwatch()..start(); + final source = await rust_rag.addSourceInCollection( + collectionId: collectionId, + content: 'allocator indexing macro ${textCase.label}', + metadata: jsonEncode({ + 'kind': 'allocator_indexing_macro', + 'target_text_mb': textCase.targetTextMb, + 'target_text_bytes': textCase.targetTextBytes, + 'actual_text_bytes': textCase.actualTextBytes, + 'chunk_count': textCase.chunkCount, + 'chunk_text_chars': _chunkTextChars, + 'chunk_overlap_chars': _chunkOverlapChars, + 'embedding_dim': _embeddingDim, + }), + name: 'allocator_indexing_${textCase.id}', + ); + await rust_rag.updateSourceStatus( + sourceId: source.sourceId, + status: 'completed', + ); + await rust_rag.addChunks( + sourceId: source.sourceId, + chunks: _chunks(textCase.chunkCount), + ); + seedSw.stop(); + + am.resetActivationTimingStats(); + final rss = RssSampler().start(); + final rebuildSw = Stopwatch()..start(); + await rust_rag.rebuildChunkHnswIndexForCollection( + collectionId: collectionId, + ); + rss.sample(); + await rust_rag.saveCollectionHnswIndex( + collectionId: collectionId, + basePath: basePath, + ); + rss.sample(); + await rust_rag.rebuildChunkBm25IndexForCollection( + collectionId: collectionId, + ); + rebuildSw.stop(); + final stats = am.takeActivationTimingStats(); + final rssSummary = rss.finish(); + + final row = { + 'cell': 'indexing_rebuild', + 'profile_label': textCase.label, + 'text_unit': 'MB_decimal', + 'target_text_mb': textCase.targetTextMb, + 'target_text_bytes': textCase.targetTextBytes, + 'actual_text_mb': textCase.actualTextMb, + 'actual_text_bytes': textCase.actualTextBytes, + 'chunk_count': textCase.chunkCount, + 'chunk_text_chars': _chunkTextChars, + 'chunk_overlap_chars': _chunkOverlapChars, + 'embedding_dim': _embeddingDim, + 'embedding_bytes': textCase.embeddingBytes, + 'embedding_mib': textCase.embeddingMiB, + 'seed_ms': seedSw.elapsedMicroseconds / 1000.0, + 'rebuild_total_ms': rebuildSw.elapsedMicroseconds / 1000.0, + 'native_allocator': nativeInfo.nativeAllocator, + 'rust_features': nativeInfo.rustFeatures, + 'build_mode': kReleaseMode + ? 'release' + : (kProfileMode ? 'profile' : 'debug'), + 'hnsw_rebuild_nanos': stats.hnswRebuildNanos.toInt(), + 'hnsw_rebuild_count': stats.hnswRebuildCount.toInt(), + 'hnsw_save_nanos': stats.hnswSaveNanos.toInt(), + 'hnsw_save_count': stats.hnswSaveCount.toInt(), + 'bm25_rebuild_nanos': stats.bm25RebuildNanos.toInt(), + 'bm25_rebuild_count': stats.bm25RebuildCount.toInt(), + ...rssSummary.toJson(prefix: 'rss'), + }; + await exportFile.writeAsString( + '${jsonEncode(row)}\n', + mode: FileMode.append, + flush: true, + ); + // ignore: avoid_print + print('INDEXING_PROFILE ${jsonEncode(row)}'); + + expect(stats.hnswRebuildCount.toInt(), 1); + expect(stats.hnswSaveCount.toInt(), 1); + expect(stats.bm25RebuildCount.toInt(), 1); + } + // ignore: avoid_print + print('INDEXING_PROFILE_EXPORT ${exportFile.path}'); + }, + timeout: const Timeout(Duration(minutes: 20)), + skip: kDebugMode + ? 'Allocator indexing macro requires `flutter drive --profile`; ' + 'debug builds are not valid A/B evidence.' + : false, + ); +} + +const _bytesPerMb = 1000 * 1000; +const _bytesPerMiB = 1024 * 1024; +const _chunkTextChars = 500; +const _chunkOverlapChars = 30; +const _embeddingDim = 384; + +List<_IndexingTextCase> _parseTextMbCases(String csv) { + final sizes = csv + .split(',') + .map((part) => double.tryParse(part.trim())) + .whereType() + .where((value) => value > 0) + .toList(growable: false); + if (sizes.isEmpty) { + throw ArgumentError.value( + csv, + 'ALLOCATOR_INDEXING_TEXT_MB', + 'no positive text sizes', + ); + } + return sizes.map(_IndexingTextCase.fromTextMb).toList(growable: false); +} + +List _chunks(int count) => List.generate(count, (i) { + final startPos = i * (_chunkTextChars - _chunkOverlapChars); + return rust_rag.ChunkData( + content: _chunkText(i), + chunkIndex: i, + startPos: startPos, + endPos: startPos + _chunkTextChars, + chunkType: 'allocator-macro', + embedding: _embedding(i), + ); +}); + +String _chunkText(int seed) { + final prefix = + 'doc $seed allocator pressure bm25 hnsw rebuild token${seed % 997} '; + final buffer = StringBuffer(prefix); + while (buffer.length < _chunkTextChars) { + buffer + ..write('mobile rag indexing realistic chunk allocator memory ') + ..write('section${seed % 31} '); + } + return buffer.toString().substring(0, _chunkTextChars); +} + +Float32List _embedding(int seed) { + final values = Float32List(_embeddingDim); + for (var i = 0; i < values.length; i++) { + values[i] = (((seed + 1) * (i + 3)) % 23) / 23.0; + } + return values; +} + +void _assertProfileMode() { + if (kDebugMode) { + fail( + 'Allocator indexing macro must run in PROFILE/RELEASE via flutter drive.\n' + 'Run: cd example && flutter drive ' + '--driver=test_driver/integration_test.dart ' + '--target=integration_test/allocator_indexing_measure_test.dart ' + '--dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 ' + '--profile -d \n' + 'Detected: kDebugMode=$kDebugMode, kProfileMode=$kProfileMode, ' + 'kReleaseMode=$kReleaseMode', + ); + } +} + +class _IndexingTextCase { + _IndexingTextCase.fromTextMb(this.targetTextMb) + : targetTextBytes = (targetTextMb * _bytesPerMb).round(), + chunkCount = ((targetTextMb * _bytesPerMb) / _chunkTextChars).ceil(); + + final double targetTextMb; + final int targetTextBytes; + final int chunkCount; + + int get actualTextBytes => chunkCount * _chunkTextChars; + double get actualTextMb => actualTextBytes / _bytesPerMb; + int get embeddingBytes => chunkCount * _embeddingDim * 4; + double get embeddingMiB => embeddingBytes / _bytesPerMiB; + + String get id { + final rounded = targetTextMb.roundToDouble(); + final value = targetTextMb == rounded + ? rounded.toInt().toString() + : targetTextMb.toString().replaceAll('.', 'p'); + return 'text_${value}mb'; + } + + String get label { + final rounded = targetTextMb.roundToDouble(); + final value = targetTextMb == rounded + ? rounded.toInt().toString() + : targetTextMb.toString(); + return '${value}MB_text_500char_384d'; + } +} diff --git a/example/integration_test/query_profile_measure_test.dart b/example/integration_test/query_profile_measure_test.dart index 2de57d2..429045b 100644 --- a/example/integration_test/query_profile_measure_test.dart +++ b/example/integration_test/query_profile_measure_test.dart @@ -6,10 +6,15 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:path_provider/path_provider.dart'; import 'package:mobile_rag_engine/mobile_rag_engine.dart'; +// ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/runtime_info.dart' + as runtime_info; +import 'package:mobile_rag_engine_example/profiling/native_runtime_expectations.dart'; import 'package:mobile_rag_engine_example/profiling/query_fixture.dart'; import 'package:mobile_rag_engine_example/profiling/query_profiler.dart'; import 'package:mobile_rag_engine_example/profiling/query_profile_report.dart'; import 'package:mobile_rag_engine_example/profiling/profile_export.dart'; +import 'package:mobile_rag_engine_example/profiling/rss_sampler.dart'; // On-device RAG query profiler — P3 (LOC-68) measurement + P4 (LOC-69) export. // @@ -32,6 +37,9 @@ void main() { const warmup = 5; const measured = 30; const topK = 10; + const expectedNativeAllocator = + String.fromEnvironment('EXPECTED_NATIVE_ALLOCATOR'); + const expectedRustFeatures = String.fromEnvironment('EXPECTED_RUST_FEATURES'); test( 'profiler: pure_cold / pure_warm / switching_cold x 2 lanes', @@ -42,7 +50,12 @@ void main() { // initialize so the engine starts clean and nothing races the seed. final docsDir = await getApplicationDocumentsDirectory(); final dbStem = '${docsDir.path}/profile.sqlite'; - for (final p in [dbStem, '$dbStem-wal', '$dbStem-shm', '$dbStem-journal']) { + for (final p in [ + dbStem, + '$dbStem-wal', + '$dbStem-shm', + '$dbStem-journal' + ]) { final f = File(p); if (await f.exists()) await f.delete(); } @@ -54,6 +67,14 @@ void main() { deferIndexWarmup: true, ); + final nativeInfo = runtime_info.nativeRuntimeInfo(); + verifyNativeRuntimeExpectations( + actualAllocator: nativeInfo.nativeAllocator, + actualRustFeatures: nativeInfo.rustFeatures, + expectedAllocator: expectedNativeAllocator, + expectedRustFeatures: expectedRustFeatures, + ); + final ids = await QueryFixture.seed(docsPerCollection: measuredDocs); expect(ids[QueryFixture.collectionA]!.length, measuredDocs); expect(ids[QueryFixture.collectionB]!.length, measuredDocs); @@ -65,7 +86,10 @@ void main() { final meta = { 'build_mode': kReleaseMode ? 'release' : (kProfileMode ? 'profile' : 'debug'), - 'features': 'vector_faer,vector_quant_i8', // shipped in profile/release + 'features': nativeInfo.rustFeatures, + 'native_allocator': nativeInfo.nativeAllocator, + 'expected_native_allocator': expectedNativeAllocator, + 'expected_rust_features': expectedRustFeatures, 'os': Platform.operatingSystem, 'os_version': Platform.operatingSystemVersion, // Device model + charging state: document manually in PR-P4.md. @@ -85,7 +109,8 @@ void main() { // single global HNSW slot so pure_cold's activate is genuinely cold. await profiler.deleteOnDiskIndex(QueryFixture.collectionA); await profiler.deleteOnDiskIndex(QueryFixture.collectionB); - await profiler.activateOnly(QueryFixture.collectionB); // active := B (A evicted) + await profiler + .activateOnly(QueryFixture.collectionB); // active := B (A evicted) /// Run one (lane, category) cell. /// - [activateOnce]: single cold shot measures the activate segment (pure_cold). @@ -101,8 +126,12 @@ void main() { }) async { final measuresActivate = activateOnce || activatePerIter; final segs = { - for (final n in ['embed', 'search', 'hydrate', - if (measuresActivate) 'activate']) + for (final n in [ + 'embed', + 'search', + 'hydrate', + if (measuresActivate) 'activate' + ]) n: SegmentSamples(n), }; final allowed = sourceIds?.toSet(); @@ -121,6 +150,8 @@ void main() { } QueryProfiler.resetIo(); // I/O snapshot reflects measured iters only + final rss = RssSampler().start(); + final activation = {}; var minHits = -1; for (var i = 0; i < measuredN; i++) { if (activatePerIter) { @@ -135,6 +166,7 @@ void main() { activate: activateOnce || activatePerIter, ); r.ms.forEach((k, v) => segs[k]?.add(v)); + _addNumericMap(activation, r.activation); final hitCount = r.hitSourceIds.length; if (minHits < 0 || hitCount < minHits) minHits = hitCount; // Fail-closed (filtered lane): every hit must come from the requested @@ -145,12 +177,18 @@ void main() { reason: '$lane/$category returned a hit outside requested ' 'sourceIds — filter not applied'); } + rss.sample(); } - final io = profiler.snapshotIo(); + final io = { + ...profiler.snapshotIo(), + ...activation, + ...rss.finish().toJson(prefix: 'rss'), + }; // Fail-closed: a wrong index path or empty corpus would return 0 hits. expect(minHits, greaterThan(0), - reason: '$lane/$category returned 0 hits — wrong index path/corpus'); + reason: + '$lane/$category returned 0 hits — wrong index path/corpus'); return QueryProfileRun( lane: lane, category: category, segments: segs, io: io, meta: meta); } @@ -257,3 +295,17 @@ void _emitReport(QueryProfileReport report) { print('PROFILE_IO ${r.lane}/${r.category} ${r.io}'); } } + +void _addNumericMap(Map totals, Map values) { + for (final entry in values.entries) { + final value = entry.value; + if (value is int) { + totals.update(entry.key, (current) => current + value, + ifAbsent: () => value); + } else if (value is BigInt) { + final asInt = value.toInt(); + totals.update(entry.key, (current) => current + asInt, + ifAbsent: () => asInt); + } + } +} diff --git a/example/lib/profiling/native_runtime_expectations.dart b/example/lib/profiling/native_runtime_expectations.dart new file mode 100644 index 0000000..70c63b9 --- /dev/null +++ b/example/lib/profiling/native_runtime_expectations.dart @@ -0,0 +1,23 @@ +void verifyNativeRuntimeExpectations({ + required String actualAllocator, + required String actualRustFeatures, + required String expectedAllocator, + required String expectedRustFeatures, +}) { + if (expectedAllocator.isNotEmpty && actualAllocator != expectedAllocator) { + throw StateError( + 'Native allocator mismatch: ' + 'EXPECTED_NATIVE_ALLOCATOR=$expectedAllocator, ' + 'actual=$actualAllocator', + ); + } + + if (expectedRustFeatures.isNotEmpty && + actualRustFeatures != expectedRustFeatures) { + throw StateError( + 'Rust feature mismatch: ' + 'EXPECTED_RUST_FEATURES=$expectedRustFeatures, ' + 'actual=$actualRustFeatures', + ); + } +} diff --git a/example/lib/profiling/query_profiler.dart b/example/lib/profiling/query_profiler.dart index 83fce9b..f68c154 100644 --- a/example/lib/profiling/query_profiler.dart +++ b/example/lib/profiling/query_profiler.dart @@ -17,6 +17,8 @@ import 'dart:io'; import 'package:mobile_rag_engine/services/embedding_service.dart'; // ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/activation_metrics.dart' as am; +// ignore: implementation_imports import 'package:mobile_rag_engine/src/rust/api/source_rag.dart' as rust_rag; // ignore: implementation_imports import 'package:mobile_rag_engine/src/rust/api/query_metrics.dart' as qm; @@ -30,7 +32,11 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart' /// Result of a single measured query: per-segment milliseconds + the sourceIds /// of the returned hits (used for fail-closed hit-count + filter checks). -typedef MeasuredQuery = ({Map ms, List hitSourceIds}); +typedef MeasuredQuery = ({ + Map ms, + List hitSourceIds, + Map activation, +}); /// Per-segment timing driver. One instance per profiling run. class QueryProfiler { @@ -143,14 +149,17 @@ class QueryProfiler { int topK = 10, }) async { final ms = {}; + var activation = {}; if (activate) { + QueryProfiler.resetActivation(); ms['activate'] = await _timeMs( () => rust_rag.activateCollectionForHybridSearch( collectionId: collectionId, basePath: indexBasePath(collectionId), ), ); + activation = QueryProfiler.takeActivation(); } late final List embedding; // Float32List is-a List @@ -175,13 +184,19 @@ class QueryProfiler { }); final hits = await handle.hitMeta(); - final chunkIds = [for (final h in hits) h.chunkId]; // PlatformInt64==int (native) + final chunkIds = [ + for (final h in hits) h.chunkId + ]; // PlatformInt64==int (native) ms['hydrate'] = await _timeMs(() async { await handle.hydrateChunks(chunkIds: _toInt64List(chunkIds)); }); await handle.dispose(); - return (ms: ms, hitSourceIds: [for (final h in hits) h.sourceId]); + return ( + ms: ms, + hitSourceIds: [for (final h in hits) h.sourceId], + activation: activation, + ); } /// Snapshot (and reset) the rust-side query_metrics I/O counters into a @@ -202,4 +217,24 @@ class QueryProfiler { /// Reset the rust-side query_metrics counters (call after warmup, before the /// measured loop, so the I/O snapshot reflects measured iterations only). static void resetIo() => qm.resetQueryContentReadStats(); + + static void resetActivation() => am.resetActivationTimingStats(); + + static Map takeActivation() { + final s = am.takeActivationTimingStats(); + return { + 'activate_total_nanos': s.activateTotalNanos.toInt(), + 'activate_count': s.activateCount.toInt(), + 'bm25_rebuild_nanos': s.bm25RebuildNanos.toInt(), + 'bm25_rebuild_count': s.bm25RebuildCount.toInt(), + 'hnsw_load_nanos': s.hnswLoadNanos.toInt(), + 'hnsw_load_count': s.hnswLoadCount.toInt(), + 'hnsw_load_success_count': s.hnswLoadSuccessCount.toInt(), + 'hnsw_load_miss_count': s.hnswLoadMissCount.toInt(), + 'hnsw_rebuild_nanos': s.hnswRebuildNanos.toInt(), + 'hnsw_rebuild_count': s.hnswRebuildCount.toInt(), + 'hnsw_save_nanos': s.hnswSaveNanos.toInt(), + 'hnsw_save_count': s.hnswSaveCount.toInt(), + }; + } } diff --git a/example/lib/profiling/rss_sampler.dart b/example/lib/profiling/rss_sampler.dart new file mode 100644 index 0000000..3cd2da5 --- /dev/null +++ b/example/lib/profiling/rss_sampler.dart @@ -0,0 +1,55 @@ +import 'dart:io'; + +typedef RssReader = int Function(); + +class RssSampler { + final RssReader _readRssBytes; + + RssSampler({RssReader? readRssBytes}) + : _readRssBytes = readRssBytes ?? (() => ProcessInfo.currentRss); + + RssTracker start() { + final tracker = RssTracker._(_readRssBytes); + tracker.sample(); + return tracker; + } +} + +class RssTracker { + final RssReader _readRssBytes; + final List _samplesBytes = []; + + RssTracker._(this._readRssBytes); + + int sample() { + final value = _readRssBytes(); + _samplesBytes.add(value); + return value; + } + + RssSummary finish() { + if (_samplesBytes.isEmpty) { + sample(); + } + return RssSummary(samplesBytes: List.unmodifiable(_samplesBytes)); + } +} + +class RssSummary { + final List samplesBytes; + + const RssSummary({required this.samplesBytes}); + + int get startBytes => samplesBytes.first; + int get endBytes => samplesBytes.last; + int get peakBytes => samplesBytes.reduce((a, b) => a > b ? a : b); + int get deltaBytes => endBytes - startBytes; + + Map toJson({String prefix = 'rss'}) => { + '${prefix}_start_bytes': startBytes, + '${prefix}_end_bytes': endBytes, + '${prefix}_peak_bytes': peakBytes, + '${prefix}_delta_bytes': deltaBytes, + '${prefix}_samples_bytes': samplesBytes, + }; +} diff --git a/example/test/profiling/native_runtime_expectations_test.dart b/example/test/profiling/native_runtime_expectations_test.dart new file mode 100644 index 0000000..721e4d7 --- /dev/null +++ b/example/test/profiling/native_runtime_expectations_test.dart @@ -0,0 +1,60 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mobile_rag_engine_example/profiling/native_runtime_expectations.dart'; + +void main() { + test('passes when expected allocator and features match actual values', () { + expect( + () => verifyNativeRuntimeExpectations( + actualAllocator: 'system', + actualRustFeatures: 'vector_faer,vector_quant_i8', + expectedAllocator: 'system', + expectedRustFeatures: 'vector_faer,vector_quant_i8', + ), + returnsNormally, + ); + }); + + test('ignores an empty expectation', () { + expect( + () => verifyNativeRuntimeExpectations( + actualAllocator: 'system', + actualRustFeatures: 'default', + expectedAllocator: '', + expectedRustFeatures: '', + ), + returnsNormally, + ); + }); + + test('fails when allocator expectation does not match', () { + expect( + () => verifyNativeRuntimeExpectations( + actualAllocator: 'system', + actualRustFeatures: 'vector_faer,vector_quant_i8', + expectedAllocator: 'mimalloc', + expectedRustFeatures: 'vector_faer,vector_quant_i8', + ), + throwsA(isA().having( + (e) => e.message, + 'message', + contains('EXPECTED_NATIVE_ALLOCATOR=mimalloc'), + )), + ); + }); + + test('fails when feature expectation does not match', () { + expect( + () => verifyNativeRuntimeExpectations( + actualAllocator: 'mimalloc', + actualRustFeatures: 'vector_faer,vector_quant_i8,allocator_mimalloc', + expectedAllocator: 'mimalloc', + expectedRustFeatures: 'vector_faer,vector_quant_i8', + ), + throwsA(isA().having( + (e) => e.message, + 'message', + contains('EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8'), + )), + ); + }); +} diff --git a/example/test/profiling/rss_sampler_test.dart b/example/test/profiling/rss_sampler_test.dart new file mode 100644 index 0000000..a18ecb6 --- /dev/null +++ b/example/test/profiling/rss_sampler_test.dart @@ -0,0 +1,34 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mobile_rag_engine_example/profiling/rss_sampler.dart'; + +void main() { + test('tracker records start, end, peak, delta, and samples', () { + final values = [100, 130, 120]; + final sampler = RssSampler(readRssBytes: () => values.removeAt(0)); + + final tracker = sampler.start(); + tracker.sample(); + tracker.sample(); + final summary = tracker.finish(); + + expect(summary.startBytes, 100); + expect(summary.endBytes, 120); + expect(summary.peakBytes, 130); + expect(summary.deltaBytes, 20); + expect(summary.samplesBytes, [100, 130, 120]); + }); + + test('summary serializes with a stable prefix', () { + final sampler = RssSampler(readRssBytes: () => 2048); + + final summary = sampler.start().finish(); + + expect(summary.toJson(prefix: 'rss'), { + 'rss_start_bytes': 2048, + 'rss_end_bytes': 2048, + 'rss_peak_bytes': 2048, + 'rss_delta_bytes': 0, + 'rss_samples_bytes': [2048], + }); + }); +} diff --git a/lib/src/rust/api/activation_metrics.dart b/lib/src/rust/api/activation_metrics.dart new file mode 100644 index 0000000..0313254 --- /dev/null +++ b/lib/src/rust/api/activation_metrics.dart @@ -0,0 +1,83 @@ +// This file is automatically generated, so please do not edit it. +// @generated by `flutter_rust_bridge`@ 2.11.1. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// These functions are ignored because they are not marked as `pub`: `new`, `record_activate_total_nanos`, `record_bm25_rebuild_nanos`, `record_hnsw_load_nanos`, `record_hnsw_rebuild_nanos`, `record_hnsw_save_nanos`, `record`, `reset`, `snapshot` +// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `AtomicTimingCounter` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt` + +ActivationTimingStats activationTimingStats() => + RustLib.instance.api.crateApiActivationMetricsActivationTimingStats(); + +void resetActivationTimingStats() => + RustLib.instance.api.crateApiActivationMetricsResetActivationTimingStats(); + +ActivationTimingStats takeActivationTimingStats() => + RustLib.instance.api.crateApiActivationMetricsTakeActivationTimingStats(); + +class ActivationTimingStats { + final BigInt activateTotalNanos; + final BigInt activateCount; + final BigInt bm25RebuildNanos; + final BigInt bm25RebuildCount; + final BigInt hnswLoadNanos; + final BigInt hnswLoadCount; + final BigInt hnswLoadSuccessCount; + final BigInt hnswLoadMissCount; + final BigInt hnswRebuildNanos; + final BigInt hnswRebuildCount; + final BigInt hnswSaveNanos; + final BigInt hnswSaveCount; + + const ActivationTimingStats({ + required this.activateTotalNanos, + required this.activateCount, + required this.bm25RebuildNanos, + required this.bm25RebuildCount, + required this.hnswLoadNanos, + required this.hnswLoadCount, + required this.hnswLoadSuccessCount, + required this.hnswLoadMissCount, + required this.hnswRebuildNanos, + required this.hnswRebuildCount, + required this.hnswSaveNanos, + required this.hnswSaveCount, + }); + + @override + int get hashCode => + activateTotalNanos.hashCode ^ + activateCount.hashCode ^ + bm25RebuildNanos.hashCode ^ + bm25RebuildCount.hashCode ^ + hnswLoadNanos.hashCode ^ + hnswLoadCount.hashCode ^ + hnswLoadSuccessCount.hashCode ^ + hnswLoadMissCount.hashCode ^ + hnswRebuildNanos.hashCode ^ + hnswRebuildCount.hashCode ^ + hnswSaveNanos.hashCode ^ + hnswSaveCount.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ActivationTimingStats && + runtimeType == other.runtimeType && + activateTotalNanos == other.activateTotalNanos && + activateCount == other.activateCount && + bm25RebuildNanos == other.bm25RebuildNanos && + bm25RebuildCount == other.bm25RebuildCount && + hnswLoadNanos == other.hnswLoadNanos && + hnswLoadCount == other.hnswLoadCount && + hnswLoadSuccessCount == other.hnswLoadSuccessCount && + hnswLoadMissCount == other.hnswLoadMissCount && + hnswRebuildNanos == other.hnswRebuildNanos && + hnswRebuildCount == other.hnswRebuildCount && + hnswSaveNanos == other.hnswSaveNanos && + hnswSaveCount == other.hnswSaveCount; +} diff --git a/lib/src/rust/api/bm25_search.dart b/lib/src/rust/api/bm25_search.dart index c3a1165..bca3e41 100644 --- a/lib/src/rust/api/bm25_search.dart +++ b/lib/src/rust/api/bm25_search.dart @@ -12,13 +12,10 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; // These functions are ignored (category: IgnoreBecauseOwnerTyShouldIgnore): `add_document`, `clear`, `is_empty`, `len`, `new`, `remove_document`, `search_scoped_tokens`, `search` /// Add document to BM25 index. -Future bm25AddDocument({ - required PlatformInt64 docId, - required String content, -}) => RustLib.instance.api.crateApiBm25SearchBm25AddDocument( - docId: docId, - content: content, -); +Future bm25AddDocument( + {required PlatformInt64 docId, required String content}) => + RustLib.instance.api + .crateApiBm25SearchBm25AddDocument(docId: docId, content: content); /// Add multiple documents to BM25 index (batch). Future bm25AddDocuments({required List<(PlatformInt64, String)> docs}) => @@ -29,10 +26,8 @@ Future bm25RemoveDocument({required PlatformInt64 docId}) => RustLib.instance.api.crateApiBm25SearchBm25RemoveDocument(docId: docId); /// Search using BM25. -Future> bm25Search({ - required String query, - required int topK, -}) => +Future> bm25Search( + {required String query, required int topK}) => RustLib.instance.api.crateApiBm25SearchBm25Search(query: query, topK: topK); /// Clear BM25 index. @@ -51,7 +46,10 @@ class Bm25SearchResult { final PlatformInt64 docId; final double score; - const Bm25SearchResult({required this.docId, required this.score}); + const Bm25SearchResult({ + required this.docId, + required this.score, + }); @override int get hashCode => docId.hashCode ^ score.hashCode; diff --git a/lib/src/rust/api/compression_utils.dart b/lib/src/rust/api/compression_utils.dart index 923704f..296f9aa 100644 --- a/lib/src/rust/api/compression_utils.dart +++ b/lib/src/rust/api/compression_utils.dart @@ -17,31 +17,23 @@ Future sentenceHash({required String sentence}) => RustLib.instance.api .crateApiCompressionUtilsSentenceHash(sentence: sentence); /// Compress text with deduplication and truncation. -Future compressText({ - required String text, - required int maxChars, - required CompressionOptions options, -}) => RustLib.instance.api.crateApiCompressionUtilsCompressText( - text: text, - maxChars: maxChars, - options: options, -); +Future compressText( + {required String text, + required int maxChars, + required CompressionOptions options}) => + RustLib.instance.api.crateApiCompressionUtilsCompressText( + text: text, maxChars: maxChars, options: options); /// Quick compress with default options. Future compressTextSimple({required String text, required int level}) => - RustLib.instance.api.crateApiCompressionUtilsCompressTextSimple( - text: text, - level: level, - ); + RustLib.instance.api + .crateApiCompressionUtilsCompressTextSimple(text: text, level: level); /// Check if text needs compression based on token estimate. -Future shouldCompress({ - required String text, - required int tokenThreshold, -}) => RustLib.instance.api.crateApiCompressionUtilsShouldCompress( - text: text, - tokenThreshold: tokenThreshold, -); +Future shouldCompress( + {required String text, required int tokenThreshold}) => + RustLib.instance.api.crateApiCompressionUtilsShouldCompress( + text: text, tokenThreshold: tokenThreshold); class CompressedText { final String text; diff --git a/lib/src/rust/api/db_pool.dart b/lib/src/rust/api/db_pool.dart index 0a8b888..07cbee5 100644 --- a/lib/src/rust/api/db_pool.dart +++ b/lib/src/rust/api/db_pool.dart @@ -27,10 +27,8 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; /// init_db_pool("/path/to/rag.sqlite", 4)?; /// ``` Future initDbPool({required String dbPath, required int maxSize}) => - RustLib.instance.api.crateApiDbPoolInitDbPool( - dbPath: dbPath, - maxSize: maxSize, - ); + RustLib.instance.api + .crateApiDbPoolInitDbPool(dbPath: dbPath, maxSize: maxSize); /// Check if the connection pool is initialized. Future isPoolInitialized() => diff --git a/lib/src/rust/api/document_parser.dart b/lib/src/rust/api/document_parser.dart index db55f88..a20feb4 100644 --- a/lib/src/rust/api/document_parser.dart +++ b/lib/src/rust/api/document_parser.dart @@ -6,39 +6,46 @@ import '../frb_generated.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -// These functions are ignored because they are not marked as `pub`: `is_cjk`, `is_noncharacter_code_point`, `is_private_use_code_point`, `join_pages`, `normalize_extracted_text`, `remove_trailing_page_number` +// These functions are ignored because they are not marked as `pub`: `below_threshold_error_message`, `dedup_adjacent_repeats`, `extract_single_page`, `find_adjacent_repeats`, `is_cjk`, `is_extraction_effectively_empty`, `is_noncharacter_code_point`, `is_private_use_code_point`, `join_pages`, `normalize_extracted_text`, `remove_trailing_page_number`, `should_include_scanned_marker` /// Extract text content from a PDF file (bytes) -/// Uses page-by-page extraction for safe page number removal and hyphenation handling -Future extractTextFromPdf({required List fileBytes}) => RustLib - .instance - .api - .crateApiDocumentParserExtractTextFromPdf(fileBytes: fileBytes); +/// +/// Walks the document one page at a time so a single malformed/unsupported +/// page can be skipped without aborting the whole document. Failed pages +/// are replaced with an empty string and a warning so the rest of the PDF +/// still flows downstream; the skip count is included in the error message +/// if the overall extraction ends up below +/// [MIN_EXTRACTED_NON_WHITESPACE] characters. +/// +/// Returns `Err` when the joined output falls below +/// [MIN_EXTRACTED_NON_WHITESPACE] characters. pdf_extract reports +/// scanned/image-only PDFs as a vector of empty strings (no error), so +/// without this guard a 0-chunk source would be silently indexed and the +/// user would see an "ingested but unsearchable" mystery. +Future extractTextFromPdf({required List fileBytes}) => + RustLib.instance.api + .crateApiDocumentParserExtractTextFromPdf(fileBytes: fileBytes); /// Extract text content from a DOCX file (bytes) -Future extractTextFromDocx({required List fileBytes}) => RustLib - .instance - .api - .crateApiDocumentParserExtractTextFromDocx(fileBytes: fileBytes); +Future extractTextFromDocx({required List fileBytes}) => + RustLib.instance.api + .crateApiDocumentParserExtractTextFromDocx(fileBytes: fileBytes); /// Auto-detect document type and extract text /// Uses magic bytes to determine file format Future extractTextFromDocument({required List fileBytes}) => - RustLib.instance.api.crateApiDocumentParserExtractTextFromDocument( - fileBytes: fileBytes, - ); + RustLib.instance.api + .crateApiDocumentParserExtractTextFromDocument(fileBytes: fileBytes); /// Decode UTF-8 text bytes without altering content semantics. -Future extractTextFromUtf8({required List fileBytes}) => RustLib - .instance - .api - .crateApiDocumentParserExtractTextFromUtf8(fileBytes: fileBytes); +Future extractTextFromUtf8({required List fileBytes}) => + RustLib.instance.api + .crateApiDocumentParserExtractTextFromUtf8(fileBytes: fileBytes); /// Read a file and extract text according to extension / magic bytes. /// /// Text-like files (`.txt`, `.md`, `.markdown`) are decoded as UTF-8. /// Binary document types fall back to the existing document extractor. -Future extractTextFromFile({required String filePath}) => RustLib - .instance - .api - .crateApiDocumentParserExtractTextFromFile(filePath: filePath); +Future extractTextFromFile({required String filePath}) => + RustLib.instance.api + .crateApiDocumentParserExtractTextFromFile(filePath: filePath); diff --git a/lib/src/rust/api/error.dart b/lib/src/rust/api/error.dart index f767f28..c8ea27e 100644 --- a/lib/src/rust/api/error.dart +++ b/lib/src/rust/api/error.dart @@ -15,28 +15,39 @@ sealed class RagError with _$RagError implements FrbException { const RagError._(); /// Database related error (potential for retry). - const factory RagError.databaseError(String field0) = RagError_DatabaseError; + const factory RagError.databaseError( + String field0, + ) = RagError_DatabaseError; /// I/O error (file missing, permission issues, etc.). - const factory RagError.ioError(String field0) = RagError_IoError; + const factory RagError.ioError( + String field0, + ) = RagError_IoError; /// Failed to load embedding model. - const factory RagError.modelLoadError(String field0) = - RagError_ModelLoadError; + const factory RagError.modelLoadError( + String field0, + ) = RagError_ModelLoadError; /// User input error (invalid query, etc.). - const factory RagError.invalidInput(String field0) = RagError_InvalidInput; + const factory RagError.invalidInput( + String field0, + ) = RagError_InvalidInput; /// Search handle became stale because collection data changed. - const factory RagError.staleSearchHandle(String field0) = - RagError_StaleSearchHandle; + const factory RagError.staleSearchHandle( + String field0, + ) = RagError_StaleSearchHandle; /// Search metadata creation raced with a concurrent collection mutation. - const factory RagError.concurrentMutation(String field0) = - RagError_ConcurrentMutation; + const factory RagError.concurrentMutation( + String field0, + ) = RagError_ConcurrentMutation; /// Internal system error (HNSW, Logic, etc.). - const factory RagError.internalError(String field0) = RagError_InternalError; + const factory RagError.internalError( + String field0, + ) = RagError_InternalError; /// A persisted `migration_meta` axis is newer than this build can read. /// Field order: (axis_key, stored_version, supported_version). @@ -58,5 +69,7 @@ sealed class RagError with _$RagError implements FrbException { ) = RagError_EmbeddingFingerprintMismatch; /// Unknown error. - const factory RagError.unknown(String field0) = RagError_Unknown; + const factory RagError.unknown( + String field0, + ) = RagError_Unknown; } diff --git a/lib/src/rust/api/error.freezed.dart b/lib/src/rust/api/error.freezed.dart index e042979..035cebe 100644 --- a/lib/src/rust/api/error.freezed.dart +++ b/lib/src/rust/api/error.freezed.dart @@ -11,291 +11,457 @@ part of 'error.dart'; // dart format off T _$identity(T value) => value; + /// @nodoc mixin _$RagError { + String get field0; - String get field0; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagErrorCopyWith get copyWith => _$RagErrorCopyWithImpl(this as RagError, _$identity); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagErrorCopyWith get copyWith => + _$RagErrorCopyWithImpl(this as RagError, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError(field0: $field0)'; -} - - + @override + String toString() { + return 'RagError(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagErrorCopyWith<$Res> { - factory $RagErrorCopyWith(RagError value, $Res Function(RagError) _then) = _$RagErrorCopyWithImpl; -@useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagErrorCopyWith<$Res> { + factory $RagErrorCopyWith(RagError value, $Res Function(RagError) _then) = + _$RagErrorCopyWithImpl; + @useResult + $Res call({String field0}); } + /// @nodoc -class _$RagErrorCopyWithImpl<$Res> - implements $RagErrorCopyWith<$Res> { +class _$RagErrorCopyWithImpl<$Res> implements $RagErrorCopyWith<$Res> { _$RagErrorCopyWithImpl(this._self, this._then); final RagError _self; final $Res Function(RagError) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? field0 = null,}) { - return _then(_self.copyWith( -field0: null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_self.copyWith( + field0: null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } - /// Adds pattern-matching-related methods to [RagError]. extension RagErrorPatterns on RagError { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap({TResult Function( RagError_DatabaseError value)? databaseError,TResult Function( RagError_IoError value)? ioError,TResult Function( RagError_ModelLoadError value)? modelLoadError,TResult Function( RagError_InvalidInput value)? invalidInput,TResult Function( RagError_StaleSearchHandle value)? staleSearchHandle,TResult Function( RagError_ConcurrentMutation value)? concurrentMutation,TResult Function( RagError_InternalError value)? internalError,TResult Function( RagError_UnsupportedMigrationVersion value)? unsupportedMigrationVersion,TResult Function( RagError_EmbeddingFingerprintMismatch value)? embeddingFingerprintMismatch,TResult Function( RagError_Unknown value)? unknown,required TResult orElse(),}){ -final _that = this; -switch (_that) { -case RagError_DatabaseError() when databaseError != null: -return databaseError(_that);case RagError_IoError() when ioError != null: -return ioError(_that);case RagError_ModelLoadError() when modelLoadError != null: -return modelLoadError(_that);case RagError_InvalidInput() when invalidInput != null: -return invalidInput(_that);case RagError_StaleSearchHandle() when staleSearchHandle != null: -return staleSearchHandle(_that);case RagError_ConcurrentMutation() when concurrentMutation != null: -return concurrentMutation(_that);case RagError_InternalError() when internalError != null: -return internalError(_that);case RagError_UnsupportedMigrationVersion() when unsupportedMigrationVersion != null: -return unsupportedMigrationVersion(_that);case RagError_EmbeddingFingerprintMismatch() when embeddingFingerprintMismatch != null: -return embeddingFingerprintMismatch(_that);case RagError_Unknown() when unknown != null: -return unknown(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map({required TResult Function( RagError_DatabaseError value) databaseError,required TResult Function( RagError_IoError value) ioError,required TResult Function( RagError_ModelLoadError value) modelLoadError,required TResult Function( RagError_InvalidInput value) invalidInput,required TResult Function( RagError_StaleSearchHandle value) staleSearchHandle,required TResult Function( RagError_ConcurrentMutation value) concurrentMutation,required TResult Function( RagError_InternalError value) internalError,required TResult Function( RagError_UnsupportedMigrationVersion value) unsupportedMigrationVersion,required TResult Function( RagError_EmbeddingFingerprintMismatch value) embeddingFingerprintMismatch,required TResult Function( RagError_Unknown value) unknown,}){ -final _that = this; -switch (_that) { -case RagError_DatabaseError(): -return databaseError(_that);case RagError_IoError(): -return ioError(_that);case RagError_ModelLoadError(): -return modelLoadError(_that);case RagError_InvalidInput(): -return invalidInput(_that);case RagError_StaleSearchHandle(): -return staleSearchHandle(_that);case RagError_ConcurrentMutation(): -return concurrentMutation(_that);case RagError_InternalError(): -return internalError(_that);case RagError_UnsupportedMigrationVersion(): -return unsupportedMigrationVersion(_that);case RagError_EmbeddingFingerprintMismatch(): -return embeddingFingerprintMismatch(_that);case RagError_Unknown(): -return unknown(_that);} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull({TResult? Function( RagError_DatabaseError value)? databaseError,TResult? Function( RagError_IoError value)? ioError,TResult? Function( RagError_ModelLoadError value)? modelLoadError,TResult? Function( RagError_InvalidInput value)? invalidInput,TResult? Function( RagError_StaleSearchHandle value)? staleSearchHandle,TResult? Function( RagError_ConcurrentMutation value)? concurrentMutation,TResult? Function( RagError_InternalError value)? internalError,TResult? Function( RagError_UnsupportedMigrationVersion value)? unsupportedMigrationVersion,TResult? Function( RagError_EmbeddingFingerprintMismatch value)? embeddingFingerprintMismatch,TResult? Function( RagError_Unknown value)? unknown,}){ -final _that = this; -switch (_that) { -case RagError_DatabaseError() when databaseError != null: -return databaseError(_that);case RagError_IoError() when ioError != null: -return ioError(_that);case RagError_ModelLoadError() when modelLoadError != null: -return modelLoadError(_that);case RagError_InvalidInput() when invalidInput != null: -return invalidInput(_that);case RagError_StaleSearchHandle() when staleSearchHandle != null: -return staleSearchHandle(_that);case RagError_ConcurrentMutation() when concurrentMutation != null: -return concurrentMutation(_that);case RagError_InternalError() when internalError != null: -return internalError(_that);case RagError_UnsupportedMigrationVersion() when unsupportedMigrationVersion != null: -return unsupportedMigrationVersion(_that);case RagError_EmbeddingFingerprintMismatch() when embeddingFingerprintMismatch != null: -return embeddingFingerprintMismatch(_that);case RagError_Unknown() when unknown != null: -return unknown(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen({TResult Function( String field0)? databaseError,TResult Function( String field0)? ioError,TResult Function( String field0)? modelLoadError,TResult Function( String field0)? invalidInput,TResult Function( String field0)? staleSearchHandle,TResult Function( String field0)? concurrentMutation,TResult Function( String field0)? internalError,TResult Function( String field0, PlatformInt64 field1, PlatformInt64 field2)? unsupportedMigrationVersion,TResult Function( String field0, String field1, PlatformInt64 field2)? embeddingFingerprintMismatch,TResult Function( String field0)? unknown,required TResult orElse(),}) {final _that = this; -switch (_that) { -case RagError_DatabaseError() when databaseError != null: -return databaseError(_that.field0);case RagError_IoError() when ioError != null: -return ioError(_that.field0);case RagError_ModelLoadError() when modelLoadError != null: -return modelLoadError(_that.field0);case RagError_InvalidInput() when invalidInput != null: -return invalidInput(_that.field0);case RagError_StaleSearchHandle() when staleSearchHandle != null: -return staleSearchHandle(_that.field0);case RagError_ConcurrentMutation() when concurrentMutation != null: -return concurrentMutation(_that.field0);case RagError_InternalError() when internalError != null: -return internalError(_that.field0);case RagError_UnsupportedMigrationVersion() when unsupportedMigrationVersion != null: -return unsupportedMigrationVersion(_that.field0,_that.field1,_that.field2);case RagError_EmbeddingFingerprintMismatch() when embeddingFingerprintMismatch != null: -return embeddingFingerprintMismatch(_that.field0,_that.field1,_that.field2);case RagError_Unknown() when unknown != null: -return unknown(_that.field0);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when({required TResult Function( String field0) databaseError,required TResult Function( String field0) ioError,required TResult Function( String field0) modelLoadError,required TResult Function( String field0) invalidInput,required TResult Function( String field0) staleSearchHandle,required TResult Function( String field0) concurrentMutation,required TResult Function( String field0) internalError,required TResult Function( String field0, PlatformInt64 field1, PlatformInt64 field2) unsupportedMigrationVersion,required TResult Function( String field0, String field1, PlatformInt64 field2) embeddingFingerprintMismatch,required TResult Function( String field0) unknown,}) {final _that = this; -switch (_that) { -case RagError_DatabaseError(): -return databaseError(_that.field0);case RagError_IoError(): -return ioError(_that.field0);case RagError_ModelLoadError(): -return modelLoadError(_that.field0);case RagError_InvalidInput(): -return invalidInput(_that.field0);case RagError_StaleSearchHandle(): -return staleSearchHandle(_that.field0);case RagError_ConcurrentMutation(): -return concurrentMutation(_that.field0);case RagError_InternalError(): -return internalError(_that.field0);case RagError_UnsupportedMigrationVersion(): -return unsupportedMigrationVersion(_that.field0,_that.field1,_that.field2);case RagError_EmbeddingFingerprintMismatch(): -return embeddingFingerprintMismatch(_that.field0,_that.field1,_that.field2);case RagError_Unknown(): -return unknown(_that.field0);} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull({TResult? Function( String field0)? databaseError,TResult? Function( String field0)? ioError,TResult? Function( String field0)? modelLoadError,TResult? Function( String field0)? invalidInput,TResult? Function( String field0)? staleSearchHandle,TResult? Function( String field0)? concurrentMutation,TResult? Function( String field0)? internalError,TResult? Function( String field0, PlatformInt64 field1, PlatformInt64 field2)? unsupportedMigrationVersion,TResult? Function( String field0, String field1, PlatformInt64 field2)? embeddingFingerprintMismatch,TResult? Function( String field0)? unknown,}) {final _that = this; -switch (_that) { -case RagError_DatabaseError() when databaseError != null: -return databaseError(_that.field0);case RagError_IoError() when ioError != null: -return ioError(_that.field0);case RagError_ModelLoadError() when modelLoadError != null: -return modelLoadError(_that.field0);case RagError_InvalidInput() when invalidInput != null: -return invalidInput(_that.field0);case RagError_StaleSearchHandle() when staleSearchHandle != null: -return staleSearchHandle(_that.field0);case RagError_ConcurrentMutation() when concurrentMutation != null: -return concurrentMutation(_that.field0);case RagError_InternalError() when internalError != null: -return internalError(_that.field0);case RagError_UnsupportedMigrationVersion() when unsupportedMigrationVersion != null: -return unsupportedMigrationVersion(_that.field0,_that.field1,_that.field2);case RagError_EmbeddingFingerprintMismatch() when embeddingFingerprintMismatch != null: -return embeddingFingerprintMismatch(_that.field0,_that.field1,_that.field2);case RagError_Unknown() when unknown != null: -return unknown(_that.field0);case _: - return null; - -} -} - + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap({ + TResult Function(RagError_DatabaseError value)? databaseError, + TResult Function(RagError_IoError value)? ioError, + TResult Function(RagError_ModelLoadError value)? modelLoadError, + TResult Function(RagError_InvalidInput value)? invalidInput, + TResult Function(RagError_StaleSearchHandle value)? staleSearchHandle, + TResult Function(RagError_ConcurrentMutation value)? concurrentMutation, + TResult Function(RagError_InternalError value)? internalError, + TResult Function(RagError_UnsupportedMigrationVersion value)? + unsupportedMigrationVersion, + TResult Function(RagError_EmbeddingFingerprintMismatch value)? + embeddingFingerprintMismatch, + TResult Function(RagError_Unknown value)? unknown, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError() when databaseError != null: + return databaseError(_that); + case RagError_IoError() when ioError != null: + return ioError(_that); + case RagError_ModelLoadError() when modelLoadError != null: + return modelLoadError(_that); + case RagError_InvalidInput() when invalidInput != null: + return invalidInput(_that); + case RagError_StaleSearchHandle() when staleSearchHandle != null: + return staleSearchHandle(_that); + case RagError_ConcurrentMutation() when concurrentMutation != null: + return concurrentMutation(_that); + case RagError_InternalError() when internalError != null: + return internalError(_that); + case RagError_UnsupportedMigrationVersion() + when unsupportedMigrationVersion != null: + return unsupportedMigrationVersion(_that); + case RagError_EmbeddingFingerprintMismatch() + when embeddingFingerprintMismatch != null: + return embeddingFingerprintMismatch(_that); + case RagError_Unknown() when unknown != null: + return unknown(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map({ + required TResult Function(RagError_DatabaseError value) databaseError, + required TResult Function(RagError_IoError value) ioError, + required TResult Function(RagError_ModelLoadError value) modelLoadError, + required TResult Function(RagError_InvalidInput value) invalidInput, + required TResult Function(RagError_StaleSearchHandle value) + staleSearchHandle, + required TResult Function(RagError_ConcurrentMutation value) + concurrentMutation, + required TResult Function(RagError_InternalError value) internalError, + required TResult Function(RagError_UnsupportedMigrationVersion value) + unsupportedMigrationVersion, + required TResult Function(RagError_EmbeddingFingerprintMismatch value) + embeddingFingerprintMismatch, + required TResult Function(RagError_Unknown value) unknown, + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError(): + return databaseError(_that); + case RagError_IoError(): + return ioError(_that); + case RagError_ModelLoadError(): + return modelLoadError(_that); + case RagError_InvalidInput(): + return invalidInput(_that); + case RagError_StaleSearchHandle(): + return staleSearchHandle(_that); + case RagError_ConcurrentMutation(): + return concurrentMutation(_that); + case RagError_InternalError(): + return internalError(_that); + case RagError_UnsupportedMigrationVersion(): + return unsupportedMigrationVersion(_that); + case RagError_EmbeddingFingerprintMismatch(): + return embeddingFingerprintMismatch(_that); + case RagError_Unknown(): + return unknown(_that); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(RagError_DatabaseError value)? databaseError, + TResult? Function(RagError_IoError value)? ioError, + TResult? Function(RagError_ModelLoadError value)? modelLoadError, + TResult? Function(RagError_InvalidInput value)? invalidInput, + TResult? Function(RagError_StaleSearchHandle value)? staleSearchHandle, + TResult? Function(RagError_ConcurrentMutation value)? concurrentMutation, + TResult? Function(RagError_InternalError value)? internalError, + TResult? Function(RagError_UnsupportedMigrationVersion value)? + unsupportedMigrationVersion, + TResult? Function(RagError_EmbeddingFingerprintMismatch value)? + embeddingFingerprintMismatch, + TResult? Function(RagError_Unknown value)? unknown, + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError() when databaseError != null: + return databaseError(_that); + case RagError_IoError() when ioError != null: + return ioError(_that); + case RagError_ModelLoadError() when modelLoadError != null: + return modelLoadError(_that); + case RagError_InvalidInput() when invalidInput != null: + return invalidInput(_that); + case RagError_StaleSearchHandle() when staleSearchHandle != null: + return staleSearchHandle(_that); + case RagError_ConcurrentMutation() when concurrentMutation != null: + return concurrentMutation(_that); + case RagError_InternalError() when internalError != null: + return internalError(_that); + case RagError_UnsupportedMigrationVersion() + when unsupportedMigrationVersion != null: + return unsupportedMigrationVersion(_that); + case RagError_EmbeddingFingerprintMismatch() + when embeddingFingerprintMismatch != null: + return embeddingFingerprintMismatch(_that); + case RagError_Unknown() when unknown != null: + return unknown(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? databaseError, + TResult Function(String field0)? ioError, + TResult Function(String field0)? modelLoadError, + TResult Function(String field0)? invalidInput, + TResult Function(String field0)? staleSearchHandle, + TResult Function(String field0)? concurrentMutation, + TResult Function(String field0)? internalError, + TResult Function(String field0, PlatformInt64 field1, PlatformInt64 field2)? + unsupportedMigrationVersion, + TResult Function(String field0, String field1, PlatformInt64 field2)? + embeddingFingerprintMismatch, + TResult Function(String field0)? unknown, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError() when databaseError != null: + return databaseError(_that.field0); + case RagError_IoError() when ioError != null: + return ioError(_that.field0); + case RagError_ModelLoadError() when modelLoadError != null: + return modelLoadError(_that.field0); + case RagError_InvalidInput() when invalidInput != null: + return invalidInput(_that.field0); + case RagError_StaleSearchHandle() when staleSearchHandle != null: + return staleSearchHandle(_that.field0); + case RagError_ConcurrentMutation() when concurrentMutation != null: + return concurrentMutation(_that.field0); + case RagError_InternalError() when internalError != null: + return internalError(_that.field0); + case RagError_UnsupportedMigrationVersion() + when unsupportedMigrationVersion != null: + return unsupportedMigrationVersion( + _that.field0, _that.field1, _that.field2); + case RagError_EmbeddingFingerprintMismatch() + when embeddingFingerprintMismatch != null: + return embeddingFingerprintMismatch( + _that.field0, _that.field1, _that.field2); + case RagError_Unknown() when unknown != null: + return unknown(_that.field0); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when({ + required TResult Function(String field0) databaseError, + required TResult Function(String field0) ioError, + required TResult Function(String field0) modelLoadError, + required TResult Function(String field0) invalidInput, + required TResult Function(String field0) staleSearchHandle, + required TResult Function(String field0) concurrentMutation, + required TResult Function(String field0) internalError, + required TResult Function( + String field0, PlatformInt64 field1, PlatformInt64 field2) + unsupportedMigrationVersion, + required TResult Function( + String field0, String field1, PlatformInt64 field2) + embeddingFingerprintMismatch, + required TResult Function(String field0) unknown, + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError(): + return databaseError(_that.field0); + case RagError_IoError(): + return ioError(_that.field0); + case RagError_ModelLoadError(): + return modelLoadError(_that.field0); + case RagError_InvalidInput(): + return invalidInput(_that.field0); + case RagError_StaleSearchHandle(): + return staleSearchHandle(_that.field0); + case RagError_ConcurrentMutation(): + return concurrentMutation(_that.field0); + case RagError_InternalError(): + return internalError(_that.field0); + case RagError_UnsupportedMigrationVersion(): + return unsupportedMigrationVersion( + _that.field0, _that.field1, _that.field2); + case RagError_EmbeddingFingerprintMismatch(): + return embeddingFingerprintMismatch( + _that.field0, _that.field1, _that.field2); + case RagError_Unknown(): + return unknown(_that.field0); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? databaseError, + TResult? Function(String field0)? ioError, + TResult? Function(String field0)? modelLoadError, + TResult? Function(String field0)? invalidInput, + TResult? Function(String field0)? staleSearchHandle, + TResult? Function(String field0)? concurrentMutation, + TResult? Function(String field0)? internalError, + TResult? Function( + String field0, PlatformInt64 field1, PlatformInt64 field2)? + unsupportedMigrationVersion, + TResult? Function(String field0, String field1, PlatformInt64 field2)? + embeddingFingerprintMismatch, + TResult? Function(String field0)? unknown, + }) { + final _that = this; + switch (_that) { + case RagError_DatabaseError() when databaseError != null: + return databaseError(_that.field0); + case RagError_IoError() when ioError != null: + return ioError(_that.field0); + case RagError_ModelLoadError() when modelLoadError != null: + return modelLoadError(_that.field0); + case RagError_InvalidInput() when invalidInput != null: + return invalidInput(_that.field0); + case RagError_StaleSearchHandle() when staleSearchHandle != null: + return staleSearchHandle(_that.field0); + case RagError_ConcurrentMutation() when concurrentMutation != null: + return concurrentMutation(_that.field0); + case RagError_InternalError() when internalError != null: + return internalError(_that.field0); + case RagError_UnsupportedMigrationVersion() + when unsupportedMigrationVersion != null: + return unsupportedMigrationVersion( + _that.field0, _that.field1, _that.field2); + case RagError_EmbeddingFingerprintMismatch() + when embeddingFingerprintMismatch != null: + return embeddingFingerprintMismatch( + _that.field0, _that.field1, _that.field2); + case RagError_Unknown() when unknown != null: + return unknown(_that.field0); + case _: + return null; + } + } } /// @nodoc - class RagError_DatabaseError extends RagError { - const RagError_DatabaseError(this.field0): super._(); - - -@override final String field0; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_DatabaseErrorCopyWith get copyWith => _$RagError_DatabaseErrorCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_DatabaseError&&(identical(other.field0, field0) || other.field0 == field0)); -} + const RagError_DatabaseError(this.field0) : super._(); + @override + final String field0; -@override -int get hashCode => Object.hash(runtimeType,field0); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_DatabaseErrorCopyWith get copyWith => + _$RagError_DatabaseErrorCopyWithImpl( + this, _$identity); -@override -String toString() { - return 'RagError.databaseError(field0: $field0)'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_DatabaseError && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); + @override + String toString() { + return 'RagError.databaseError(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_DatabaseErrorCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_DatabaseErrorCopyWith(RagError_DatabaseError value, $Res Function(RagError_DatabaseError) _then) = _$RagError_DatabaseErrorCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_DatabaseErrorCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_DatabaseErrorCopyWith(RagError_DatabaseError value, + $Res Function(RagError_DatabaseError) _then) = + _$RagError_DatabaseErrorCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_DatabaseErrorCopyWithImpl<$Res> implements $RagError_DatabaseErrorCopyWith<$Res> { @@ -304,64 +470,66 @@ class _$RagError_DatabaseErrorCopyWithImpl<$Res> final RagError_DatabaseError _self; final $Res Function(RagError_DatabaseError) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_DatabaseError( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_DatabaseError( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_IoError extends RagError { - const RagError_IoError(this.field0): super._(); - + const RagError_IoError(this.field0) : super._(); -@override final String field0; + @override + final String field0; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_IoErrorCopyWith get copyWith => _$RagError_IoErrorCopyWithImpl(this, _$identity); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_IoErrorCopyWith get copyWith => + _$RagError_IoErrorCopyWithImpl(this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_IoError && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_IoError&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.ioError(field0: $field0)'; -} - - + @override + String toString() { + return 'RagError.ioError(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_IoErrorCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_IoErrorCopyWith(RagError_IoError value, $Res Function(RagError_IoError) _then) = _$RagError_IoErrorCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_IoErrorCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_IoErrorCopyWith( + RagError_IoError value, $Res Function(RagError_IoError) _then) = + _$RagError_IoErrorCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_IoErrorCopyWithImpl<$Res> implements $RagError_IoErrorCopyWith<$Res> { @@ -370,64 +538,67 @@ class _$RagError_IoErrorCopyWithImpl<$Res> final RagError_IoError _self; final $Res Function(RagError_IoError) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_IoError( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_IoError( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_ModelLoadError extends RagError { - const RagError_ModelLoadError(this.field0): super._(); - + const RagError_ModelLoadError(this.field0) : super._(); -@override final String field0; + @override + final String field0; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_ModelLoadErrorCopyWith get copyWith => _$RagError_ModelLoadErrorCopyWithImpl(this, _$identity); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_ModelLoadErrorCopyWith get copyWith => + _$RagError_ModelLoadErrorCopyWithImpl( + this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_ModelLoadError && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_ModelLoadError&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.modelLoadError(field0: $field0)'; -} - - + @override + String toString() { + return 'RagError.modelLoadError(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_ModelLoadErrorCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_ModelLoadErrorCopyWith(RagError_ModelLoadError value, $Res Function(RagError_ModelLoadError) _then) = _$RagError_ModelLoadErrorCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_ModelLoadErrorCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_ModelLoadErrorCopyWith(RagError_ModelLoadError value, + $Res Function(RagError_ModelLoadError) _then) = + _$RagError_ModelLoadErrorCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_ModelLoadErrorCopyWithImpl<$Res> implements $RagError_ModelLoadErrorCopyWith<$Res> { @@ -436,64 +607,67 @@ class _$RagError_ModelLoadErrorCopyWithImpl<$Res> final RagError_ModelLoadError _self; final $Res Function(RagError_ModelLoadError) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_ModelLoadError( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_ModelLoadError( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_InvalidInput extends RagError { - const RagError_InvalidInput(this.field0): super._(); - - -@override final String field0; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_InvalidInputCopyWith get copyWith => _$RagError_InvalidInputCopyWithImpl(this, _$identity); + const RagError_InvalidInput(this.field0) : super._(); + @override + final String field0; + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_InvalidInputCopyWith get copyWith => + _$RagError_InvalidInputCopyWithImpl( + this, _$identity); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_InvalidInput&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.invalidInput(field0: $field0)'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_InvalidInput && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); + @override + String toString() { + return 'RagError.invalidInput(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_InvalidInputCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_InvalidInputCopyWith(RagError_InvalidInput value, $Res Function(RagError_InvalidInput) _then) = _$RagError_InvalidInputCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_InvalidInputCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_InvalidInputCopyWith(RagError_InvalidInput value, + $Res Function(RagError_InvalidInput) _then) = + _$RagError_InvalidInputCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_InvalidInputCopyWithImpl<$Res> implements $RagError_InvalidInputCopyWith<$Res> { @@ -502,64 +676,68 @@ class _$RagError_InvalidInputCopyWithImpl<$Res> final RagError_InvalidInput _self; final $Res Function(RagError_InvalidInput) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_InvalidInput( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_InvalidInput( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_StaleSearchHandle extends RagError { - const RagError_StaleSearchHandle(this.field0): super._(); - - -@override final String field0; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_StaleSearchHandleCopyWith get copyWith => _$RagError_StaleSearchHandleCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_StaleSearchHandle&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.staleSearchHandle(field0: $field0)'; -} - - + const RagError_StaleSearchHandle(this.field0) : super._(); + + @override + final String field0; + + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_StaleSearchHandleCopyWith + get copyWith => + _$RagError_StaleSearchHandleCopyWithImpl( + this, _$identity); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_StaleSearchHandle && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @override + String toString() { + return 'RagError.staleSearchHandle(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_StaleSearchHandleCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_StaleSearchHandleCopyWith(RagError_StaleSearchHandle value, $Res Function(RagError_StaleSearchHandle) _then) = _$RagError_StaleSearchHandleCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_StaleSearchHandleCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_StaleSearchHandleCopyWith(RagError_StaleSearchHandle value, + $Res Function(RagError_StaleSearchHandle) _then) = + _$RagError_StaleSearchHandleCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_StaleSearchHandleCopyWithImpl<$Res> implements $RagError_StaleSearchHandleCopyWith<$Res> { @@ -568,64 +746,68 @@ class _$RagError_StaleSearchHandleCopyWithImpl<$Res> final RagError_StaleSearchHandle _self; final $Res Function(RagError_StaleSearchHandle) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_StaleSearchHandle( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_StaleSearchHandle( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_ConcurrentMutation extends RagError { - const RagError_ConcurrentMutation(this.field0): super._(); - - -@override final String field0; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_ConcurrentMutationCopyWith get copyWith => _$RagError_ConcurrentMutationCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_ConcurrentMutation&&(identical(other.field0, field0) || other.field0 == field0)); -} + const RagError_ConcurrentMutation(this.field0) : super._(); + @override + final String field0; -@override -int get hashCode => Object.hash(runtimeType,field0); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_ConcurrentMutationCopyWith + get copyWith => _$RagError_ConcurrentMutationCopyWithImpl< + RagError_ConcurrentMutation>(this, _$identity); -@override -String toString() { - return 'RagError.concurrentMutation(field0: $field0)'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_ConcurrentMutation && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); + @override + String toString() { + return 'RagError.concurrentMutation(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_ConcurrentMutationCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_ConcurrentMutationCopyWith(RagError_ConcurrentMutation value, $Res Function(RagError_ConcurrentMutation) _then) = _$RagError_ConcurrentMutationCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_ConcurrentMutationCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_ConcurrentMutationCopyWith( + RagError_ConcurrentMutation value, + $Res Function(RagError_ConcurrentMutation) _then) = + _$RagError_ConcurrentMutationCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_ConcurrentMutationCopyWithImpl<$Res> implements $RagError_ConcurrentMutationCopyWith<$Res> { @@ -634,64 +816,67 @@ class _$RagError_ConcurrentMutationCopyWithImpl<$Res> final RagError_ConcurrentMutation _self; final $Res Function(RagError_ConcurrentMutation) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_ConcurrentMutation( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_ConcurrentMutation( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_InternalError extends RagError { - const RagError_InternalError(this.field0): super._(); - + const RagError_InternalError(this.field0) : super._(); -@override final String field0; + @override + final String field0; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_InternalErrorCopyWith get copyWith => _$RagError_InternalErrorCopyWithImpl(this, _$identity); + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_InternalErrorCopyWith get copyWith => + _$RagError_InternalErrorCopyWithImpl( + this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_InternalError && + (identical(other.field0, field0) || other.field0 == field0)); + } + @override + int get hashCode => Object.hash(runtimeType, field0); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_InternalError&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.internalError(field0: $field0)'; -} - - + @override + String toString() { + return 'RagError.internalError(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_InternalErrorCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_InternalErrorCopyWith(RagError_InternalError value, $Res Function(RagError_InternalError) _then) = _$RagError_InternalErrorCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_InternalErrorCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_InternalErrorCopyWith(RagError_InternalError value, + $Res Function(RagError_InternalError) _then) = + _$RagError_InternalErrorCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_InternalErrorCopyWithImpl<$Res> implements $RagError_InternalErrorCopyWith<$Res> { @@ -700,66 +885,75 @@ class _$RagError_InternalErrorCopyWithImpl<$Res> final RagError_InternalError _self; final $Res Function(RagError_InternalError) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_InternalError( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_InternalError( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class RagError_UnsupportedMigrationVersion extends RagError { - const RagError_UnsupportedMigrationVersion(this.field0, this.field1, this.field2): super._(); - - -@override final String field0; - final PlatformInt64 field1; - final PlatformInt64 field2; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_UnsupportedMigrationVersionCopyWith get copyWith => _$RagError_UnsupportedMigrationVersionCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_UnsupportedMigrationVersion&&(identical(other.field0, field0) || other.field0 == field0)&&(identical(other.field1, field1) || other.field1 == field1)&&(identical(other.field2, field2) || other.field2 == field2)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0,field1,field2); - -@override -String toString() { - return 'RagError.unsupportedMigrationVersion(field0: $field0, field1: $field1, field2: $field2)'; -} - - + const RagError_UnsupportedMigrationVersion( + this.field0, this.field1, this.field2) + : super._(); + + @override + final String field0; + final PlatformInt64 field1; + final PlatformInt64 field2; + + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_UnsupportedMigrationVersionCopyWith< + RagError_UnsupportedMigrationVersion> + get copyWith => _$RagError_UnsupportedMigrationVersionCopyWithImpl< + RagError_UnsupportedMigrationVersion>(this, _$identity); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_UnsupportedMigrationVersion && + (identical(other.field0, field0) || other.field0 == field0) && + (identical(other.field1, field1) || other.field1 == field1) && + (identical(other.field2, field2) || other.field2 == field2)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0, field1, field2); + + @override + String toString() { + return 'RagError.unsupportedMigrationVersion(field0: $field0, field1: $field1, field2: $field2)'; + } } /// @nodoc -abstract mixin class $RagError_UnsupportedMigrationVersionCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_UnsupportedMigrationVersionCopyWith(RagError_UnsupportedMigrationVersion value, $Res Function(RagError_UnsupportedMigrationVersion) _then) = _$RagError_UnsupportedMigrationVersionCopyWithImpl; -@override @useResult -$Res call({ - String field0, PlatformInt64 field1, PlatformInt64 field2 -}); - - - - +abstract mixin class $RagError_UnsupportedMigrationVersionCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_UnsupportedMigrationVersionCopyWith( + RagError_UnsupportedMigrationVersion value, + $Res Function(RagError_UnsupportedMigrationVersion) _then) = + _$RagError_UnsupportedMigrationVersionCopyWithImpl; + @override + @useResult + $Res call({String field0, PlatformInt64 field1, PlatformInt64 field2}); } + /// @nodoc class _$RagError_UnsupportedMigrationVersionCopyWithImpl<$Res> implements $RagError_UnsupportedMigrationVersionCopyWith<$Res> { @@ -768,68 +962,85 @@ class _$RagError_UnsupportedMigrationVersionCopyWithImpl<$Res> final RagError_UnsupportedMigrationVersion _self; final $Res Function(RagError_UnsupportedMigrationVersion) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,Object? field1 = null,Object? field2 = null,}) { - return _then(RagError_UnsupportedMigrationVersion( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String,null == field1 ? _self.field1 : field1 // ignore: cast_nullable_to_non_nullable -as PlatformInt64,null == field2 ? _self.field2 : field2 // ignore: cast_nullable_to_non_nullable -as PlatformInt64, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + Object? field1 = null, + Object? field2 = null, + }) { + return _then(RagError_UnsupportedMigrationVersion( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + null == field1 + ? _self.field1 + : field1 // ignore: cast_nullable_to_non_nullable + as PlatformInt64, + null == field2 + ? _self.field2 + : field2 // ignore: cast_nullable_to_non_nullable + as PlatformInt64, + )); + } } /// @nodoc - class RagError_EmbeddingFingerprintMismatch extends RagError { - const RagError_EmbeddingFingerprintMismatch(this.field0, this.field1, this.field2): super._(); - - -@override final String field0; - final String field1; - final PlatformInt64 field2; - -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_EmbeddingFingerprintMismatchCopyWith get copyWith => _$RagError_EmbeddingFingerprintMismatchCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_EmbeddingFingerprintMismatch&&(identical(other.field0, field0) || other.field0 == field0)&&(identical(other.field1, field1) || other.field1 == field1)&&(identical(other.field2, field2) || other.field2 == field2)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0,field1,field2); - -@override -String toString() { - return 'RagError.embeddingFingerprintMismatch(field0: $field0, field1: $field1, field2: $field2)'; -} - - + const RagError_EmbeddingFingerprintMismatch( + this.field0, this.field1, this.field2) + : super._(); + + @override + final String field0; + final String field1; + final PlatformInt64 field2; + + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_EmbeddingFingerprintMismatchCopyWith< + RagError_EmbeddingFingerprintMismatch> + get copyWith => _$RagError_EmbeddingFingerprintMismatchCopyWithImpl< + RagError_EmbeddingFingerprintMismatch>(this, _$identity); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_EmbeddingFingerprintMismatch && + (identical(other.field0, field0) || other.field0 == field0) && + (identical(other.field1, field1) || other.field1 == field1) && + (identical(other.field2, field2) || other.field2 == field2)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0, field1, field2); + + @override + String toString() { + return 'RagError.embeddingFingerprintMismatch(field0: $field0, field1: $field1, field2: $field2)'; + } } /// @nodoc -abstract mixin class $RagError_EmbeddingFingerprintMismatchCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_EmbeddingFingerprintMismatchCopyWith(RagError_EmbeddingFingerprintMismatch value, $Res Function(RagError_EmbeddingFingerprintMismatch) _then) = _$RagError_EmbeddingFingerprintMismatchCopyWithImpl; -@override @useResult -$Res call({ - String field0, String field1, PlatformInt64 field2 -}); - - - - +abstract mixin class $RagError_EmbeddingFingerprintMismatchCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_EmbeddingFingerprintMismatchCopyWith( + RagError_EmbeddingFingerprintMismatch value, + $Res Function(RagError_EmbeddingFingerprintMismatch) _then) = + _$RagError_EmbeddingFingerprintMismatchCopyWithImpl; + @override + @useResult + $Res call({String field0, String field1, PlatformInt64 field2}); } + /// @nodoc class _$RagError_EmbeddingFingerprintMismatchCopyWithImpl<$Res> implements $RagError_EmbeddingFingerprintMismatchCopyWith<$Res> { @@ -838,66 +1049,76 @@ class _$RagError_EmbeddingFingerprintMismatchCopyWithImpl<$Res> final RagError_EmbeddingFingerprintMismatch _self; final $Res Function(RagError_EmbeddingFingerprintMismatch) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,Object? field1 = null,Object? field2 = null,}) { - return _then(RagError_EmbeddingFingerprintMismatch( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String,null == field1 ? _self.field1 : field1 // ignore: cast_nullable_to_non_nullable -as String,null == field2 ? _self.field2 : field2 // ignore: cast_nullable_to_non_nullable -as PlatformInt64, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + Object? field1 = null, + Object? field2 = null, + }) { + return _then(RagError_EmbeddingFingerprintMismatch( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + null == field1 + ? _self.field1 + : field1 // ignore: cast_nullable_to_non_nullable + as String, + null == field2 + ? _self.field2 + : field2 // ignore: cast_nullable_to_non_nullable + as PlatformInt64, + )); + } } /// @nodoc - class RagError_Unknown extends RagError { - const RagError_Unknown(this.field0): super._(); - - -@override final String field0; + const RagError_Unknown(this.field0) : super._(); -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$RagError_UnknownCopyWith get copyWith => _$RagError_UnknownCopyWithImpl(this, _$identity); + @override + final String field0; + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RagError_UnknownCopyWith get copyWith => + _$RagError_UnknownCopyWithImpl(this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RagError_Unknown && + (identical(other.field0, field0) || other.field0 == field0)); + } -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RagError_Unknown&&(identical(other.field0, field0) || other.field0 == field0)); -} - - -@override -int get hashCode => Object.hash(runtimeType,field0); - -@override -String toString() { - return 'RagError.unknown(field0: $field0)'; -} - + @override + int get hashCode => Object.hash(runtimeType, field0); + @override + String toString() { + return 'RagError.unknown(field0: $field0)'; + } } /// @nodoc -abstract mixin class $RagError_UnknownCopyWith<$Res> implements $RagErrorCopyWith<$Res> { - factory $RagError_UnknownCopyWith(RagError_Unknown value, $Res Function(RagError_Unknown) _then) = _$RagError_UnknownCopyWithImpl; -@override @useResult -$Res call({ - String field0 -}); - - - - +abstract mixin class $RagError_UnknownCopyWith<$Res> + implements $RagErrorCopyWith<$Res> { + factory $RagError_UnknownCopyWith( + RagError_Unknown value, $Res Function(RagError_Unknown) _then) = + _$RagError_UnknownCopyWithImpl; + @override + @useResult + $Res call({String field0}); } + /// @nodoc class _$RagError_UnknownCopyWithImpl<$Res> implements $RagError_UnknownCopyWith<$Res> { @@ -906,16 +1127,20 @@ class _$RagError_UnknownCopyWithImpl<$Res> final RagError_Unknown _self; final $Res Function(RagError_Unknown) _then; -/// Create a copy of RagError -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? field0 = null,}) { - return _then(RagError_Unknown( -null == field0 ? _self.field0 : field0 // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of RagError + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? field0 = null, + }) { + return _then(RagError_Unknown( + null == field0 + ? _self.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } } // dart format on diff --git a/lib/src/rust/api/hnsw_index.dart b/lib/src/rust/api/hnsw_index.dart index facdacb..7952ec8 100644 --- a/lib/src/rust/api/hnsw_index.dart +++ b/lib/src/rust/api/hnsw_index.dart @@ -14,9 +14,9 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; /// - M (max connections per node): 16-24 based on dataset size /// - M0 (layer 0 connections): 2*M for better recall /// - efConstruction: 100-200 based on dataset size -Future buildHnswIndex({ - required List<(PlatformInt64, Float32List)> points, -}) => RustLib.instance.api.crateApiHnswIndexBuildHnswIndex(points: points); +Future buildHnswIndex( + {required List<(PlatformInt64, Float32List)> points}) => + RustLib.instance.api.crateApiHnswIndexBuildHnswIndex(points: points); /// Save HNSW index to disk using hnsw_rs persistence. /// @@ -41,25 +41,19 @@ Future loadHnswIndex({required String basePath}) => /// - Lower ef_search = faster but may miss relevant results /// /// Current tuning targets ~95% recall for most use cases. -Future> searchHnsw({ - required List queryEmbedding, - required BigInt topK, -}) => RustLib.instance.api.crateApiHnswIndexSearchHnsw( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchHnsw( + {required List queryEmbedding, required BigInt topK}) => + RustLib.instance.api.crateApiHnswIndexSearchHnsw( + queryEmbedding: queryEmbedding, topK: topK); /// Slice-based variant of [`search_hnsw`]. Internal Rust callers should /// prefer this entrypoint when the query embedding is already held by /// reference (e.g. inside `std::thread::scope` closures or retry loops) /// so the vector does not need to be cloned per call. -Future> searchHnswSlice({ - required List queryEmbedding, - required BigInt topK, -}) => RustLib.instance.api.crateApiHnswIndexSearchHnswSlice( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchHnswSlice( + {required List queryEmbedding, required BigInt topK}) => + RustLib.instance.api.crateApiHnswIndexSearchHnswSlice( + queryEmbedding: queryEmbedding, topK: topK); /// Check if HNSW index is loaded. Future isHnswIndexLoaded() => @@ -82,13 +76,10 @@ class EmbeddingPoint { }); // HINT: Make it `#[frb(sync)]` to let it become the default constructor of Dart class. - static Future newInstance({ - required PlatformInt64 id, - required List embedding, - }) => RustLib.instance.api.crateApiHnswIndexEmbeddingPointNew( - id: id, - embedding: embedding, - ); + static Future newInstance( + {required PlatformInt64 id, required List embedding}) => + RustLib.instance.api + .crateApiHnswIndexEmbeddingPointNew(id: id, embedding: embedding); @override int get hashCode => id.hashCode ^ embedding.hashCode ^ norm.hashCode; @@ -108,7 +99,10 @@ class HnswSearchResult { final PlatformInt64 id; final double distance; - const HnswSearchResult({required this.id, required this.distance}); + const HnswSearchResult({ + required this.id, + required this.distance, + }); @override int get hashCode => id.hashCode ^ distance.hashCode; diff --git a/lib/src/rust/api/hybrid_search.dart b/lib/src/rust/api/hybrid_search.dart index 0f8a137..afa355f 100644 --- a/lib/src/rust/api/hybrid_search.dart +++ b/lib/src/rust/api/hybrid_search.dart @@ -18,45 +18,40 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; /// (content-hydrating) or [`search_hybrid_meta_inner`] (meta-only) to /// avoid cloning the query embedding when it is already held by /// reference (e.g. inside `search_meta_hybrid`'s retry loop). -Future> searchHybrid({ - required String queryText, - required List queryEmbedding, - required int topK, - RrfConfig? config, - SearchFilter? filter, -}) => RustLib.instance.api.crateApiHybridSearchSearchHybrid( - queryText: queryText, - queryEmbedding: queryEmbedding, - topK: topK, - config: config, - filter: filter, -); +Future> searchHybrid( + {required String queryText, + required List queryEmbedding, + required int topK, + RrfConfig? config, + SearchFilter? filter}) => + RustLib.instance.api.crateApiHybridSearchSearchHybrid( + queryText: queryText, + queryEmbedding: queryEmbedding, + topK: topK, + config: config, + filter: filter); /// Simplified hybrid search returning content strings only. -Future> searchHybridSimple({ - required String queryText, - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api.crateApiHybridSearchSearchHybridSimple( - queryText: queryText, - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchHybridSimple( + {required String queryText, + required List queryEmbedding, + required int topK}) => + RustLib.instance.api.crateApiHybridSearchSearchHybridSimple( + queryText: queryText, queryEmbedding: queryEmbedding, topK: topK); /// Search with custom weights (vector_weight + bm25_weight = 1.0 recommended). -Future> searchHybridWeighted({ - required String queryText, - required List queryEmbedding, - required int topK, - required double vectorWeight, - required double bm25Weight, -}) => RustLib.instance.api.crateApiHybridSearchSearchHybridWeighted( - queryText: queryText, - queryEmbedding: queryEmbedding, - topK: topK, - vectorWeight: vectorWeight, - bm25Weight: bm25Weight, -); +Future> searchHybridWeighted( + {required String queryText, + required List queryEmbedding, + required int topK, + required double vectorWeight, + required double bm25Weight}) => + RustLib.instance.api.crateApiHybridSearchSearchHybridWeighted( + queryText: queryText, + queryEmbedding: queryEmbedding, + topK: topK, + vectorWeight: vectorWeight, + bm25Weight: bm25Weight); class HybridSearchResult { final PlatformInt64 docId; @@ -137,7 +132,11 @@ class SearchFilter { final String? metadataLike; final String? collectionId; - const SearchFilter({this.sourceIds, this.metadataLike, this.collectionId}); + const SearchFilter({ + this.sourceIds, + this.metadataLike, + this.collectionId, + }); @override int get hashCode => diff --git a/lib/src/rust/api/incremental_index.dart b/lib/src/rust/api/incremental_index.dart index 9fe8557..14b595a 100644 --- a/lib/src/rust/api/incremental_index.dart +++ b/lib/src/rust/api/incremental_index.dart @@ -11,35 +11,27 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; // These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt` /// Add a single vector to buffer (immediately searchable). -Future incrementalAdd({ - required PlatformInt64 docId, - required List embedding, -}) => RustLib.instance.api.crateApiIncrementalIndexIncrementalAdd( - docId: docId, - embedding: embedding, -); +Future incrementalAdd( + {required PlatformInt64 docId, required List embedding}) => + RustLib.instance.api.crateApiIncrementalIndexIncrementalAdd( + docId: docId, embedding: embedding); /// Add multiple vectors to buffer. -Future incrementalAddBatch({ - required List<(PlatformInt64, Float32List)> docs, -}) => RustLib.instance.api.crateApiIncrementalIndexIncrementalAddBatch( - docs: docs, -); +Future incrementalAddBatch( + {required List<(PlatformInt64, Float32List)> docs}) => + RustLib.instance.api + .crateApiIncrementalIndexIncrementalAddBatch(docs: docs); /// Remove a document from buffer. -Future incrementalRemove({required PlatformInt64 docId}) => RustLib - .instance - .api - .crateApiIncrementalIndexIncrementalRemove(docId: docId); +Future incrementalRemove({required PlatformInt64 docId}) => + RustLib.instance.api + .crateApiIncrementalIndexIncrementalRemove(docId: docId); /// Search both buffer and HNSW. -Future> incrementalSearch({ - required List queryEmbedding, - required BigInt topK, -}) => RustLib.instance.api.crateApiIncrementalIndexIncrementalSearch( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> incrementalSearch( + {required List queryEmbedding, required BigInt topK}) => + RustLib.instance.api.crateApiIncrementalIndexIncrementalSearch( + queryEmbedding: queryEmbedding, topK: topK); Future getBufferStats() => RustLib.instance.api.crateApiIncrementalIndexGetBufferStats(); diff --git a/lib/src/rust/api/ingest_metrics.dart b/lib/src/rust/api/ingest_metrics.dart index e40bbbf..0eeaea7 100644 --- a/lib/src/rust/api/ingest_metrics.dart +++ b/lib/src/rust/api/ingest_metrics.dart @@ -55,7 +55,7 @@ class IngestTrafficStats { /// Sum of text-body bytes that crossed FFI on the legacy chain. Future legacyTextTrafficTotal() => RustLib.instance.api - .crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal( + .crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal( that: this, ); @@ -63,7 +63,7 @@ class IngestTrafficStats { /// Excludes embedding vector bytes (vectors are not text and are tracked /// separately for transparency). Future sessionTextTrafficTotal() => RustLib.instance.api - .crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal( + .crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal( that: this, ); diff --git a/lib/src/rust/api/ingest_session.dart b/lib/src/rust/api/ingest_session.dart index 57c6556..5f0c8da 100644 --- a/lib/src/rust/api/ingest_session.dart +++ b/lib/src/rust/api/ingest_session.dart @@ -14,45 +14,43 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; /// Combined entrypoint: insert/find source row, claim it, run the chunker, and /// return an `IngestSession` carrying the chunked content. Dart drives the /// per-batch embedding loop on the returned session. -Future prepareSourceIngestion({ - required String collectionId, - required String content, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, -}) => RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestion( - collectionId: collectionId, - content: content, - metadata: metadata, - name: name, - strategy: strategy, - maxChars: maxChars, - overlapChars: overlapChars, -); +Future prepareSourceIngestion( + {required String collectionId, + required String content, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}) => + RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestion( + collectionId: collectionId, + content: content, + metadata: metadata, + name: name, + strategy: strategy, + maxChars: maxChars, + overlapChars: overlapChars); /// UTF-8 bytes variant: skips the Dart `String` materialization step. The /// caller hands raw bytes (typically a `Uint8List` from a file/network read); /// the Rust side performs UTF-8 decoding once. Identical staging behavior to /// `prepare_source_ingestion` once the bytes are decoded. -Future prepareSourceIngestionFromUtf8({ - required String collectionId, - required List contentBytes, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, -}) => RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestionFromUtf8( - collectionId: collectionId, - contentBytes: contentBytes, - metadata: metadata, - name: name, - strategy: strategy, - maxChars: maxChars, - overlapChars: overlapChars, -); +Future prepareSourceIngestionFromUtf8( + {required String collectionId, + required List contentBytes, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}) => + RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestionFromUtf8( + collectionId: collectionId, + contentBytes: contentBytes, + metadata: metadata, + name: name, + strategy: strategy, + maxChars: maxChars, + overlapChars: overlapChars); /// File-path variant: Rust reads the file and never round-trips its body /// through Dart. Only the path string crosses FFI (Dart→Rust). When @@ -61,23 +59,22 @@ Future prepareSourceIngestionFromUtf8({ /// extensions (`.txt`, `.md`, `.markdown`) are decoded as UTF-8; everything /// else falls through to `document_parser::extract_text_from_document` (PDF / /// DOCX magic-byte routing). -Future prepareSourceIngestionFromFile({ - required String collectionId, - required String filePath, - String? metadata, - String? name, - IngestStrategy? strategyHint, - required int maxChars, - required int overlapChars, -}) => RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestionFromFile( - collectionId: collectionId, - filePath: filePath, - metadata: metadata, - name: name, - strategyHint: strategyHint, - maxChars: maxChars, - overlapChars: overlapChars, -); +Future prepareSourceIngestionFromFile( + {required String collectionId, + required String filePath, + String? metadata, + String? name, + IngestStrategy? strategyHint, + required int maxChars, + required int overlapChars}) => + RustLib.instance.api.crateApiIngestSessionPrepareSourceIngestionFromFile( + collectionId: collectionId, + filePath: filePath, + metadata: metadata, + name: name, + strategyHint: strategyHint, + maxChars: maxChars, + overlapChars: overlapChars); // Rust type: RustOpaqueMoi> abstract class IngestSession implements RustOpaqueInterface { @@ -124,7 +121,10 @@ class ChunkEmbedding { final int chunkIndex; final Float32List embedding; - const ChunkEmbedding({required this.chunkIndex, required this.embedding}); + const ChunkEmbedding({ + required this.chunkIndex, + required this.embedding, + }); @override int get hashCode => chunkIndex.hashCode ^ embedding.hashCode; @@ -161,7 +161,11 @@ class EmbeddingRequest { } /// Chunking strategy selector for `prepare_source_ingestion`. -enum IngestStrategy { recursive, markdown } +enum IngestStrategy { + recursive, + markdown, + ; +} /// Result of `prepare_source_ingestion`. /// @@ -231,4 +235,5 @@ enum PreparedSourceState { /// Existing source in `pending` or `processing` — owned by another worker. duplicateInProgress, + ; } diff --git a/lib/src/rust/api/migration_meta.dart b/lib/src/rust/api/migration_meta.dart index 3c104bd..c47a9a2 100644 --- a/lib/src/rust/api/migration_meta.dart +++ b/lib/src/rust/api/migration_meta.dart @@ -25,11 +25,10 @@ Future readMigrationAxes() => /// nor deletes embeddings. The caller is responsible for routing the gate /// state to the user (Apply, Rebuild, Invalidate decisions per the data /// migration plan). -Future detectEmbeddingFingerprintGate({ - required String currentFingerprint, -}) => RustLib.instance.api.crateApiMigrationMetaDetectEmbeddingFingerprintGate( - currentFingerprint: currentFingerprint, -); +Future detectEmbeddingFingerprintGate( + {required String currentFingerprint}) => + RustLib.instance.api.crateApiMigrationMetaDetectEmbeddingFingerprintGate( + currentFingerprint: currentFingerprint); /// Record the engine's current model fingerprint as the persisted baseline. /// @@ -42,8 +41,7 @@ Future detectEmbeddingFingerprintGate({ /// Refuses to overwrite a non-empty baseline. Use the reembed/clear flows /// to rotate an existing fingerprint instead. Future writeEmbeddingFingerprint({required String fingerprint}) => RustLib - .instance - .api + .instance.api .crateApiMigrationMetaWriteEmbeddingFingerprint(fingerprint: fingerprint); /// Begin a reembed-to-`target_fingerprint` flow. @@ -52,20 +50,18 @@ Future writeEmbeddingFingerprint({required String fingerprint}) => RustLib /// reboots, so the flow is resumable) and returns the number of chunks that /// still need re-embedding. Idempotent — calling it again with the same /// target is safe. -Future beginEmbeddingReembed({ - required String targetFingerprint, -}) => RustLib.instance.api.crateApiMigrationMetaBeginEmbeddingReembed( - targetFingerprint: targetFingerprint, -); +Future beginEmbeddingReembed( + {required String targetFingerprint}) => + RustLib.instance.api.crateApiMigrationMetaBeginEmbeddingReembed( + targetFingerprint: targetFingerprint); /// Count chunks still tagged with anything other than `target_fingerprint`. /// /// Reads only — safe to call during progress polling. -Future countChunksNeedingReembed({ - required String targetFingerprint, -}) => RustLib.instance.api.crateApiMigrationMetaCountChunksNeedingReembed( - targetFingerprint: targetFingerprint, -); +Future countChunksNeedingReembed( + {required String targetFingerprint}) => + RustLib.instance.api.crateApiMigrationMetaCountChunksNeedingReembed( + targetFingerprint: targetFingerprint); /// Commit a completed reembed atomically. /// @@ -75,8 +71,7 @@ Future countChunksNeedingReembed({ /// `embedding_fingerprint_pending = ""`. Future finalizeEmbeddingReembed({required String targetFingerprint}) => RustLib.instance.api.crateApiMigrationMetaFinalizeEmbeddingReembed( - targetFingerprint: targetFingerprint, - ); + targetFingerprint: targetFingerprint); /// Discard every chunk row (and therefore every embedding BLOB) for sources /// the user has accepted as lost, then reset the fingerprint axes. @@ -88,13 +83,10 @@ Future finalizeEmbeddingReembed({required String targetFingerprint}) => /// The `sources` rows are kept so the user can re-ingest them through the /// normal ingestion path; only `chunks` (which hold the embeddings) are /// removed. -Future acknowledgeAndClearEmbeddings({ - required String confirmation, - required String newFingerprint, -}) => RustLib.instance.api.crateApiMigrationMetaAcknowledgeAndClearEmbeddings( - confirmation: confirmation, - newFingerprint: newFingerprint, -); +Future acknowledgeAndClearEmbeddings( + {required String confirmation, required String newFingerprint}) => + RustLib.instance.api.crateApiMigrationMetaAcknowledgeAndClearEmbeddings( + confirmation: confirmation, newFingerprint: newFingerprint); @freezed sealed class EmbeddingFingerprintGate with _$EmbeddingFingerprintGate { diff --git a/lib/src/rust/api/migration_meta.freezed.dart b/lib/src/rust/api/migration_meta.freezed.dart index ed7d76c..29d067a 100644 --- a/lib/src/rust/api/migration_meta.freezed.dart +++ b/lib/src/rust/api/migration_meta.freezed.dart @@ -11,291 +11,348 @@ part of 'migration_meta.dart'; // dart format off T _$identity(T value) => value; + /// @nodoc mixin _$EmbeddingFingerprintGate { - - - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is EmbeddingFingerprintGate); -} - - -@override -int get hashCode => runtimeType.hashCode; - -@override -String toString() { - return 'EmbeddingFingerprintGate()'; -} - - + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is EmbeddingFingerprintGate); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + String toString() { + return 'EmbeddingFingerprintGate()'; + } } /// @nodoc -class $EmbeddingFingerprintGateCopyWith<$Res> { -$EmbeddingFingerprintGateCopyWith(EmbeddingFingerprintGate _, $Res Function(EmbeddingFingerprintGate) __); +class $EmbeddingFingerprintGateCopyWith<$Res> { + $EmbeddingFingerprintGateCopyWith( + EmbeddingFingerprintGate _, $Res Function(EmbeddingFingerprintGate) __); } - /// Adds pattern-matching-related methods to [EmbeddingFingerprintGate]. extension EmbeddingFingerprintGatePatterns on EmbeddingFingerprintGate { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap({TResult Function( EmbeddingFingerprintGate_RequiresInitialBaseline value)? requiresInitialBaseline,TResult Function( EmbeddingFingerprintGate_Ok value)? ok,TResult Function( EmbeddingFingerprintGate_Mismatch value)? mismatch,required TResult orElse(),}){ -final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline() when requiresInitialBaseline != null: -return requiresInitialBaseline(_that);case EmbeddingFingerprintGate_Ok() when ok != null: -return ok(_that);case EmbeddingFingerprintGate_Mismatch() when mismatch != null: -return mismatch(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map({required TResult Function( EmbeddingFingerprintGate_RequiresInitialBaseline value) requiresInitialBaseline,required TResult Function( EmbeddingFingerprintGate_Ok value) ok,required TResult Function( EmbeddingFingerprintGate_Mismatch value) mismatch,}){ -final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline(): -return requiresInitialBaseline(_that);case EmbeddingFingerprintGate_Ok(): -return ok(_that);case EmbeddingFingerprintGate_Mismatch(): -return mismatch(_that);} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull({TResult? Function( EmbeddingFingerprintGate_RequiresInitialBaseline value)? requiresInitialBaseline,TResult? Function( EmbeddingFingerprintGate_Ok value)? ok,TResult? Function( EmbeddingFingerprintGate_Mismatch value)? mismatch,}){ -final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline() when requiresInitialBaseline != null: -return requiresInitialBaseline(_that);case EmbeddingFingerprintGate_Ok() when ok != null: -return ok(_that);case EmbeddingFingerprintGate_Mismatch() when mismatch != null: -return mismatch(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen({TResult Function()? requiresInitialBaseline,TResult Function()? ok,TResult Function( String stored, String current, PlatformInt64 remainingChunks, bool resumeInProgress)? mismatch,required TResult orElse(),}) {final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline() when requiresInitialBaseline != null: -return requiresInitialBaseline();case EmbeddingFingerprintGate_Ok() when ok != null: -return ok();case EmbeddingFingerprintGate_Mismatch() when mismatch != null: -return mismatch(_that.stored,_that.current,_that.remainingChunks,_that.resumeInProgress);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when({required TResult Function() requiresInitialBaseline,required TResult Function() ok,required TResult Function( String stored, String current, PlatformInt64 remainingChunks, bool resumeInProgress) mismatch,}) {final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline(): -return requiresInitialBaseline();case EmbeddingFingerprintGate_Ok(): -return ok();case EmbeddingFingerprintGate_Mismatch(): -return mismatch(_that.stored,_that.current,_that.remainingChunks,_that.resumeInProgress);} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull({TResult? Function()? requiresInitialBaseline,TResult? Function()? ok,TResult? Function( String stored, String current, PlatformInt64 remainingChunks, bool resumeInProgress)? mismatch,}) {final _that = this; -switch (_that) { -case EmbeddingFingerprintGate_RequiresInitialBaseline() when requiresInitialBaseline != null: -return requiresInitialBaseline();case EmbeddingFingerprintGate_Ok() when ok != null: -return ok();case EmbeddingFingerprintGate_Mismatch() when mismatch != null: -return mismatch(_that.stored,_that.current,_that.remainingChunks,_that.resumeInProgress);case _: - return null; - -} -} - + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap({ + TResult Function(EmbeddingFingerprintGate_RequiresInitialBaseline value)? + requiresInitialBaseline, + TResult Function(EmbeddingFingerprintGate_Ok value)? ok, + TResult Function(EmbeddingFingerprintGate_Mismatch value)? mismatch, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline() + when requiresInitialBaseline != null: + return requiresInitialBaseline(_that); + case EmbeddingFingerprintGate_Ok() when ok != null: + return ok(_that); + case EmbeddingFingerprintGate_Mismatch() when mismatch != null: + return mismatch(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map({ + required TResult Function( + EmbeddingFingerprintGate_RequiresInitialBaseline value) + requiresInitialBaseline, + required TResult Function(EmbeddingFingerprintGate_Ok value) ok, + required TResult Function(EmbeddingFingerprintGate_Mismatch value) mismatch, + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline(): + return requiresInitialBaseline(_that); + case EmbeddingFingerprintGate_Ok(): + return ok(_that); + case EmbeddingFingerprintGate_Mismatch(): + return mismatch(_that); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(EmbeddingFingerprintGate_RequiresInitialBaseline value)? + requiresInitialBaseline, + TResult? Function(EmbeddingFingerprintGate_Ok value)? ok, + TResult? Function(EmbeddingFingerprintGate_Mismatch value)? mismatch, + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline() + when requiresInitialBaseline != null: + return requiresInitialBaseline(_that); + case EmbeddingFingerprintGate_Ok() when ok != null: + return ok(_that); + case EmbeddingFingerprintGate_Mismatch() when mismatch != null: + return mismatch(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? requiresInitialBaseline, + TResult Function()? ok, + TResult Function(String stored, String current, + PlatformInt64 remainingChunks, bool resumeInProgress)? + mismatch, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline() + when requiresInitialBaseline != null: + return requiresInitialBaseline(); + case EmbeddingFingerprintGate_Ok() when ok != null: + return ok(); + case EmbeddingFingerprintGate_Mismatch() when mismatch != null: + return mismatch(_that.stored, _that.current, _that.remainingChunks, + _that.resumeInProgress); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when({ + required TResult Function() requiresInitialBaseline, + required TResult Function() ok, + required TResult Function(String stored, String current, + PlatformInt64 remainingChunks, bool resumeInProgress) + mismatch, + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline(): + return requiresInitialBaseline(); + case EmbeddingFingerprintGate_Ok(): + return ok(); + case EmbeddingFingerprintGate_Mismatch(): + return mismatch(_that.stored, _that.current, _that.remainingChunks, + _that.resumeInProgress); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? requiresInitialBaseline, + TResult? Function()? ok, + TResult? Function(String stored, String current, + PlatformInt64 remainingChunks, bool resumeInProgress)? + mismatch, + }) { + final _that = this; + switch (_that) { + case EmbeddingFingerprintGate_RequiresInitialBaseline() + when requiresInitialBaseline != null: + return requiresInitialBaseline(); + case EmbeddingFingerprintGate_Ok() when ok != null: + return ok(); + case EmbeddingFingerprintGate_Mismatch() when mismatch != null: + return mismatch(_that.stored, _that.current, _that.remainingChunks, + _that.resumeInProgress); + case _: + return null; + } + } } /// @nodoc +class EmbeddingFingerprintGate_RequiresInitialBaseline + extends EmbeddingFingerprintGate { + const EmbeddingFingerprintGate_RequiresInitialBaseline() : super._(); -class EmbeddingFingerprintGate_RequiresInitialBaseline extends EmbeddingFingerprintGate { - const EmbeddingFingerprintGate_RequiresInitialBaseline(): super._(); - - - - - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is EmbeddingFingerprintGate_RequiresInitialBaseline); -} - - -@override -int get hashCode => runtimeType.hashCode; - -@override -String toString() { - return 'EmbeddingFingerprintGate.requiresInitialBaseline()'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is EmbeddingFingerprintGate_RequiresInitialBaseline); + } + @override + int get hashCode => runtimeType.hashCode; + @override + String toString() { + return 'EmbeddingFingerprintGate.requiresInitialBaseline()'; + } } - - - /// @nodoc - class EmbeddingFingerprintGate_Ok extends EmbeddingFingerprintGate { - const EmbeddingFingerprintGate_Ok(): super._(); - - - - - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is EmbeddingFingerprintGate_Ok); -} - - -@override -int get hashCode => runtimeType.hashCode; - -@override -String toString() { - return 'EmbeddingFingerprintGate.ok()'; -} - - + const EmbeddingFingerprintGate_Ok() : super._(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is EmbeddingFingerprintGate_Ok); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + String toString() { + return 'EmbeddingFingerprintGate.ok()'; + } } - - - /// @nodoc - class EmbeddingFingerprintGate_Mismatch extends EmbeddingFingerprintGate { - const EmbeddingFingerprintGate_Mismatch({required this.stored, required this.current, required this.remainingChunks, required this.resumeInProgress}): super._(); - - - final String stored; - final String current; -/// Number of chunk rows still tagged with a non-current fingerprint. -/// Useful for surfacing a "resume from N%" UI without an extra -/// round-trip to count chunks. - final PlatformInt64 remainingChunks; -/// True when `embedding_fingerprint_pending` already equals -/// `current_fingerprint` — i.e. a reembed was previously started and -/// can simply continue without a fresh user confirmation. - final bool resumeInProgress; - -/// Create a copy of EmbeddingFingerprintGate -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$EmbeddingFingerprintGate_MismatchCopyWith get copyWith => _$EmbeddingFingerprintGate_MismatchCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is EmbeddingFingerprintGate_Mismatch&&(identical(other.stored, stored) || other.stored == stored)&&(identical(other.current, current) || other.current == current)&&(identical(other.remainingChunks, remainingChunks) || other.remainingChunks == remainingChunks)&&(identical(other.resumeInProgress, resumeInProgress) || other.resumeInProgress == resumeInProgress)); -} - - -@override -int get hashCode => Object.hash(runtimeType,stored,current,remainingChunks,resumeInProgress); - -@override -String toString() { - return 'EmbeddingFingerprintGate.mismatch(stored: $stored, current: $current, remainingChunks: $remainingChunks, resumeInProgress: $resumeInProgress)'; -} - - + const EmbeddingFingerprintGate_Mismatch( + {required this.stored, + required this.current, + required this.remainingChunks, + required this.resumeInProgress}) + : super._(); + + final String stored; + final String current; + + /// Number of chunk rows still tagged with a non-current fingerprint. + /// Useful for surfacing a "resume from N%" UI without an extra + /// round-trip to count chunks. + final PlatformInt64 remainingChunks; + + /// True when `embedding_fingerprint_pending` already equals + /// `current_fingerprint` — i.e. a reembed was previously started and + /// can simply continue without a fresh user confirmation. + final bool resumeInProgress; + + /// Create a copy of EmbeddingFingerprintGate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $EmbeddingFingerprintGate_MismatchCopyWith + get copyWith => _$EmbeddingFingerprintGate_MismatchCopyWithImpl< + EmbeddingFingerprintGate_Mismatch>(this, _$identity); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is EmbeddingFingerprintGate_Mismatch && + (identical(other.stored, stored) || other.stored == stored) && + (identical(other.current, current) || other.current == current) && + (identical(other.remainingChunks, remainingChunks) || + other.remainingChunks == remainingChunks) && + (identical(other.resumeInProgress, resumeInProgress) || + other.resumeInProgress == resumeInProgress)); + } + + @override + int get hashCode => Object.hash( + runtimeType, stored, current, remainingChunks, resumeInProgress); + + @override + String toString() { + return 'EmbeddingFingerprintGate.mismatch(stored: $stored, current: $current, remainingChunks: $remainingChunks, resumeInProgress: $resumeInProgress)'; + } } /// @nodoc -abstract mixin class $EmbeddingFingerprintGate_MismatchCopyWith<$Res> implements $EmbeddingFingerprintGateCopyWith<$Res> { - factory $EmbeddingFingerprintGate_MismatchCopyWith(EmbeddingFingerprintGate_Mismatch value, $Res Function(EmbeddingFingerprintGate_Mismatch) _then) = _$EmbeddingFingerprintGate_MismatchCopyWithImpl; -@useResult -$Res call({ - String stored, String current, PlatformInt64 remainingChunks, bool resumeInProgress -}); - - - - +abstract mixin class $EmbeddingFingerprintGate_MismatchCopyWith<$Res> + implements $EmbeddingFingerprintGateCopyWith<$Res> { + factory $EmbeddingFingerprintGate_MismatchCopyWith( + EmbeddingFingerprintGate_Mismatch value, + $Res Function(EmbeddingFingerprintGate_Mismatch) _then) = + _$EmbeddingFingerprintGate_MismatchCopyWithImpl; + @useResult + $Res call( + {String stored, + String current, + PlatformInt64 remainingChunks, + bool resumeInProgress}); } + /// @nodoc class _$EmbeddingFingerprintGate_MismatchCopyWithImpl<$Res> implements $EmbeddingFingerprintGate_MismatchCopyWith<$Res> { @@ -304,19 +361,34 @@ class _$EmbeddingFingerprintGate_MismatchCopyWithImpl<$Res> final EmbeddingFingerprintGate_Mismatch _self; final $Res Function(EmbeddingFingerprintGate_Mismatch) _then; -/// Create a copy of EmbeddingFingerprintGate -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? stored = null,Object? current = null,Object? remainingChunks = null,Object? resumeInProgress = null,}) { - return _then(EmbeddingFingerprintGate_Mismatch( -stored: null == stored ? _self.stored : stored // ignore: cast_nullable_to_non_nullable -as String,current: null == current ? _self.current : current // ignore: cast_nullable_to_non_nullable -as String,remainingChunks: null == remainingChunks ? _self.remainingChunks : remainingChunks // ignore: cast_nullable_to_non_nullable -as PlatformInt64,resumeInProgress: null == resumeInProgress ? _self.resumeInProgress : resumeInProgress // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - - + /// Create a copy of EmbeddingFingerprintGate + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? stored = null, + Object? current = null, + Object? remainingChunks = null, + Object? resumeInProgress = null, + }) { + return _then(EmbeddingFingerprintGate_Mismatch( + stored: null == stored + ? _self.stored + : stored // ignore: cast_nullable_to_non_nullable + as String, + current: null == current + ? _self.current + : current // ignore: cast_nullable_to_non_nullable + as String, + remainingChunks: null == remainingChunks + ? _self.remainingChunks + : remainingChunks // ignore: cast_nullable_to_non_nullable + as PlatformInt64, + resumeInProgress: null == resumeInProgress + ? _self.resumeInProgress + : resumeInProgress // ignore: cast_nullable_to_non_nullable + as bool, + )); + } } // dart format on diff --git a/lib/src/rust/api/query_metrics.dart b/lib/src/rust/api/query_metrics.dart index 1f4a844..3bf7f02 100644 --- a/lib/src/rust/api/query_metrics.dart +++ b/lib/src/rust/api/query_metrics.dart @@ -58,21 +58,27 @@ class QueryContentReadStats { /// Materialized result bytes only — see [`Self::rows_total`]. Future contentBytesTotal() => RustLib.instance.api - .crateApiQueryMetricsQueryContentReadStatsContentBytesTotal(that: this); + .crateApiQueryMetricsQueryContentReadStatsContentBytesTotal( + that: this, + ); Future hydrationContentBytesTotal() => RustLib.instance.api - .crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal( + .crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal( that: this, ); Future hydrationRowsTotal() => RustLib.instance.api - .crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal(that: this); + .crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal( + that: this, + ); /// Materialized result reads only — does NOT include the scoped exact-scan /// backend counter, which measures rows scanned during search rather than /// rows surfaced as results. - Future rowsTotal() => RustLib.instance.api - .crateApiQueryMetricsQueryContentReadStatsRowsTotal(that: this); + Future rowsTotal() => + RustLib.instance.api.crateApiQueryMetricsQueryContentReadStatsRowsTotal( + that: this, + ); @override int get hashCode => diff --git a/lib/src/rust/api/runtime_info.dart b/lib/src/rust/api/runtime_info.dart new file mode 100644 index 0000000..0e2ca28 --- /dev/null +++ b/lib/src/rust/api/runtime_info.dart @@ -0,0 +1,34 @@ +// This file is automatically generated, so please do not edit it. +// @generated by `flutter_rust_bridge`@ 2.11.1. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// These functions are ignored because they are not marked as `pub`: `native_allocator_label`, `rust_features_label` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt` + +NativeRuntimeInfo nativeRuntimeInfo() => + RustLib.instance.api.crateApiRuntimeInfoNativeRuntimeInfo(); + +class NativeRuntimeInfo { + final String nativeAllocator; + final String rustFeatures; + + const NativeRuntimeInfo({ + required this.nativeAllocator, + required this.rustFeatures, + }); + + @override + int get hashCode => nativeAllocator.hashCode ^ rustFeatures.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NativeRuntimeInfo && + runtimeType == other.runtimeType && + nativeAllocator == other.nativeAllocator && + rustFeatures == other.rustFeatures; +} diff --git a/lib/src/rust/api/semantic_chunker.dart b/lib/src/rust/api/semantic_chunker.dart index 9faa889..419fe9a 100644 --- a/lib/src/rust/api/semantic_chunker.dart +++ b/lib/src/rust/api/semantic_chunker.dart @@ -15,24 +15,18 @@ ChunkType classifyChunk({required String text}) => RustLib.instance.api.crateApiSemanticChunkerClassifyChunk(text: text); /// Split text into semantic chunks using paragraph-first strategy. -List semanticChunk({ - required String text, - required int maxChars, -}) => RustLib.instance.api.crateApiSemanticChunkerSemanticChunk( - text: text, - maxChars: maxChars, -); +List semanticChunk( + {required String text, required int maxChars}) => + RustLib.instance.api + .crateApiSemanticChunkerSemanticChunk(text: text, maxChars: maxChars); /// Split text with overlap (API compatibility wrapper). -List semanticChunkWithOverlap({ - required String text, - required int maxChars, - required int overlapChars, -}) => RustLib.instance.api.crateApiSemanticChunkerSemanticChunkWithOverlap( - text: text, - maxChars: maxChars, - overlapChars: overlapChars, -); +List semanticChunkWithOverlap( + {required String text, + required int maxChars, + required int overlapChars}) => + RustLib.instance.api.crateApiSemanticChunkerSemanticChunkWithOverlap( + text: text, maxChars: maxChars, overlapChars: overlapChars); /// Markdown chunk with structure preservation and metadata inheritance. /// @@ -40,13 +34,10 @@ List semanticChunkWithOverlap({ /// - Preserves code blocks (```) as single units /// - Preserves tables (|---|) as single units /// - Inherits header path as metadata -List markdownChunk({ - required String text, - required int maxChars, -}) => RustLib.instance.api.crateApiSemanticChunkerMarkdownChunk( - text: text, - maxChars: maxChars, -); +List markdownChunk( + {required String text, required int maxChars}) => + RustLib.instance.api + .crateApiSemanticChunkerMarkdownChunk(text: text, maxChars: maxChars); /// Chunk type classification. enum ChunkType { @@ -55,10 +46,13 @@ enum ChunkType { list, procedure, comparison, - general; + general, + ; Future asStr() => - RustLib.instance.api.crateApiSemanticChunkerChunkTypeAsStr(that: this); + RustLib.instance.api.crateApiSemanticChunkerChunkTypeAsStr( + that: this, + ); static Future fromStr({required String s}) => RustLib.instance.api.crateApiSemanticChunkerChunkTypeFromStr(s: s); diff --git a/lib/src/rust/api/simple_rag.dart b/lib/src/rust/api/simple_rag.dart index 2620560..0f88b90 100644 --- a/lib/src/rust/api/simple_rag.dart +++ b/lib/src/rust/api/simple_rag.dart @@ -10,13 +10,10 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; // These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt` /// Calculate cosine similarity between two vectors. -double calculateCosineSimilarity({ - required List vecA, - required List vecB, -}) => RustLib.instance.api.crateApiSimpleRagCalculateCosineSimilarity( - vecA: vecA, - vecB: vecB, -); +double calculateCosineSimilarity( + {required List vecA, required List vecB}) => + RustLib.instance.api + .crateApiSimpleRagCalculateCosineSimilarity(vecA: vecA, vecB: vecB); /// Initialize database with docs table. Future initDb() => RustLib.instance.api.crateApiSimpleRagInitDb(); @@ -30,43 +27,31 @@ Future rebuildBm25Index() => RustLib.instance.api.crateApiSimpleRagRebuildBm25Index(); /// Add document with embedding vector (with deduplication). -Future addDocument({ - required String content, - required List embedding, -}) => RustLib.instance.api.crateApiSimpleRagAddDocument( - content: content, - embedding: embedding, -); +Future addDocument( + {required String content, required List embedding}) => + RustLib.instance.api + .crateApiSimpleRagAddDocument(content: content, embedding: embedding); /// Legacy add_document for backward compatibility. -Future addDocumentSimple({ - required String content, - required List embedding, -}) => RustLib.instance.api.crateApiSimpleRagAddDocumentSimple( - content: content, - embedding: embedding, -); +Future addDocumentSimple( + {required String content, required List embedding}) => + RustLib.instance.api.crateApiSimpleRagAddDocumentSimple( + content: content, embedding: embedding); /// Similarity-based search (uses HNSW). -Future> searchSimilar({ - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api.crateApiSimpleRagSearchSimilar( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchSimilar( + {required List queryEmbedding, required int topK}) => + RustLib.instance.api.crateApiSimpleRagSearchSimilar( + queryEmbedding: queryEmbedding, topK: topK); /// Benchmark-only entrypoint for deterministic linear scan measurement. /// /// Unlike `search_similar`, this function bypasses HNSW and executes /// the linear scan path directly. -Future> benchmarkSearchLinearScan({ - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api.crateApiSimpleRagBenchmarkSearchLinearScan( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> benchmarkSearchLinearScan( + {required List queryEmbedding, required int topK}) => + RustLib.instance.api.crateApiSimpleRagBenchmarkSearchLinearScan( + queryEmbedding: queryEmbedding, topK: topK); /// Get document count. Future getDocumentCount() => diff --git a/lib/src/rust/api/source_rag.dart b/lib/src/rust/api/source_rag.dart index 4f5ebde..63a0058 100644 --- a/lib/src/rust/api/source_rag.dart +++ b/lib/src/rust/api/source_rag.dart @@ -7,7 +7,7 @@ import '../frb_generated.dart'; import 'error.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -// These functions are ignored because they are not marked as `pub`: `accept_chunk`, `allowed_chunk_ids`, `assemble_context_internal`, `build_prompt_text`, `build_search_hit_meta`, `count_tokens`, `decode_structured_chunk_type`, `diversify_sources`, `ensure_collection_row`, `ensure_fresh_with_conn`, `ensure_generation_unchanged_with_conn`, `extract_significant_query_terms`, `fetch_adjacent_hit_meta`, `fetch_stored_chunk_types`, `filter_to_most_relevant_source`, `get_collection_data_generation`, `hash_content`, `hydrate_chunk_previews`, `hydrate_chunk_search_results`, `hydrate_rows_for_assembly`, `is_active_bm25_collection`, `is_active_hnsw_collection`, `mark_collection_bm25_clean`, `mark_collection_data_changed`, `mark_collection_dirty`, `mark_collection_hnsw_clean`, `new`, `normalize_collection_id`, `order_chronologically`, `partition_by_cache`, `populate_cache`, `render_candidate_with_headers`, `render_candidate_without_headers`, `render_chunk`, `render_context_text`, `render_source_block`, `resolve_system_instruction`, `resolved_chunk_ids`, `run_handle_assemble_test_hook`, `run_handle_hydration_test_hook`, `run_search_meta_test_hook`, `search_chunks_linear_in_collection`, `search_chunks_linear`, `search_meta_hybrid_once`, `set_active_bm25_collection`, `set_active_hnsw_collection`, `truncate_utf8_bytes`, `try_add_chunk`, `utf8_string_from_blob_prefix`, `validate_requested_chunk_ids` +// These functions are ignored because they are not marked as `pub`: `accept_chunk`, `activate_collection_for_hybrid_search_inner`, `allowed_chunk_ids`, `assemble_context_internal`, `build_prompt_text`, `build_search_hit_meta`, `count_tokens`, `decode_structured_chunk_type`, `diversify_sources`, `elapsed_nanos_u64`, `ensure_collection_row`, `ensure_fresh_with_conn`, `ensure_generation_unchanged_with_conn`, `extract_significant_query_terms`, `fetch_adjacent_hit_meta`, `fetch_stored_chunk_types`, `filter_to_most_relevant_source`, `get_collection_data_generation`, `hash_content`, `hydrate_chunk_previews`, `hydrate_chunk_search_results`, `hydrate_rows_for_assembly`, `is_active_bm25_collection`, `is_active_hnsw_collection`, `mark_collection_bm25_clean`, `mark_collection_data_changed`, `mark_collection_dirty`, `mark_collection_hnsw_clean`, `new`, `normalize_collection_id`, `order_chronologically`, `partition_by_cache`, `populate_cache`, `rebuild_chunk_bm25_index_for_collection_inner`, `rebuild_chunk_hnsw_index_for_collection_inner`, `render_candidate_with_headers`, `render_candidate_without_headers`, `render_chunk`, `render_context_text`, `render_source_block`, `resolve_system_instruction`, `resolved_chunk_ids`, `run_handle_assemble_test_hook`, `run_handle_hydration_test_hook`, `run_search_meta_test_hook`, `search_chunks_linear_in_collection`, `search_meta_hybrid_once`, `set_active_bm25_collection`, `set_active_hnsw_collection`, `truncate_utf8_bytes`, `try_add_chunk`, `utf8_string_from_blob_prefix`, `validate_requested_chunk_ids` // These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `AssemblyBuildResult`, `HydratedChunkRow`, `RenderedSelectionState` // These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt` @@ -16,46 +16,36 @@ Future initSourceDb() => RustLib.instance.api.crateApiSourceRagInitSourceDb(); /// Add a source document (chunks added separately via add_chunks). -Future addSource({ - required String content, - String? metadata, - String? name, -}) => RustLib.instance.api.crateApiSourceRagAddSource( - content: content, - metadata: metadata, - name: name, -); +Future addSource( + {required String content, String? metadata, String? name}) => + RustLib.instance.api.crateApiSourceRagAddSource( + content: content, metadata: metadata, name: name); /// Add a source document to a specific collection (chunks added separately via add_chunks). -Future addSourceInCollection({ - required String collectionId, - required String content, - String? metadata, - String? name, -}) => RustLib.instance.api.crateApiSourceRagAddSourceInCollection( - collectionId: collectionId, - content: content, - metadata: metadata, - name: name, -); +Future addSourceInCollection( + {required String collectionId, + required String content, + String? metadata, + String? name}) => + RustLib.instance.api.crateApiSourceRagAddSourceInCollection( + collectionId: collectionId, + content: content, + metadata: metadata, + name: name); /// Update processing status of a source (e.g., 'pending', 'processing', 'completed', 'failed'). -Future updateSourceStatus({ - required PlatformInt64 sourceId, - required String status, -}) => RustLib.instance.api.crateApiSourceRagUpdateSourceStatus( - sourceId: sourceId, - status: status, -); +Future updateSourceStatus( + {required PlatformInt64 sourceId, required String status}) => + RustLib.instance.api.crateApiSourceRagUpdateSourceStatus( + sourceId: sourceId, status: status); /// Claim a source for ingestion by atomically transitioning status to `processing`. /// /// Returns true when claimed successfully. Only `pending` and `failed` sources /// can be claimed. Sources already in `processing`/`completed` return false. Future claimSourceForIngestion({required PlatformInt64 sourceId}) => - RustLib.instance.api.crateApiSourceRagClaimSourceForIngestion( - sourceId: sourceId, - ); + RustLib.instance.api + .crateApiSourceRagClaimSourceForIngestion(sourceId: sourceId); /// Get status of a source. /// @@ -72,139 +62,115 @@ Future clearSourceChunks({required PlatformInt64 sourceId}) => Future> listSources() => RustLib.instance.api.crateApiSourceRagListSources(); -Future> listSourcesInCollection({ - required String collectionId, -}) => RustLib.instance.api.crateApiSourceRagListSourcesInCollection( - collectionId: collectionId, -); +Future> listSourcesInCollection( + {required String collectionId}) => + RustLib.instance.api + .crateApiSourceRagListSourcesInCollection(collectionId: collectionId); /// Add chunks for a source (uses transaction for atomicity). -Future addChunks({ - required PlatformInt64 sourceId, - required List chunks, -}) => RustLib.instance.api.crateApiSourceRagAddChunks( - sourceId: sourceId, - chunks: chunks, -); +Future addChunks( + {required PlatformInt64 sourceId, required List chunks}) => + RustLib.instance.api + .crateApiSourceRagAddChunks(sourceId: sourceId, chunks: chunks); /// Rebuild HNSW index from chunks table. Future rebuildChunkHnswIndex() => RustLib.instance.api.crateApiSourceRagRebuildChunkHnswIndex(); /// Rebuild HNSW index from chunks table for a specific collection. -Future rebuildChunkHnswIndexForCollection({ - required String collectionId, -}) => RustLib.instance.api.crateApiSourceRagRebuildChunkHnswIndexForCollection( - collectionId: collectionId, -); +Future rebuildChunkHnswIndexForCollection( + {required String collectionId}) => + RustLib.instance.api.crateApiSourceRagRebuildChunkHnswIndexForCollection( + collectionId: collectionId); /// Rebuild BM25 index from chunks table. Future rebuildChunkBm25Index() => RustLib.instance.api.crateApiSourceRagRebuildChunkBm25Index(); /// Rebuild BM25 index from chunks table for a specific collection. -Future rebuildChunkBm25IndexForCollection({ - required String collectionId, -}) => RustLib.instance.api.crateApiSourceRagRebuildChunkBm25IndexForCollection( - collectionId: collectionId, -); +Future rebuildChunkBm25IndexForCollection( + {required String collectionId}) => + RustLib.instance.api.crateApiSourceRagRebuildChunkBm25IndexForCollection( + collectionId: collectionId); /// Check if BM25 index is loaded for chunks. Future isChunkBm25IndexLoaded() => RustLib.instance.api.crateApiSourceRagIsChunkBm25IndexLoaded(); /// Save currently loaded HNSW index for a collection. -Future saveCollectionHnswIndex({ - required String collectionId, - required String basePath, -}) => RustLib.instance.api.crateApiSourceRagSaveCollectionHnswIndex( - collectionId: collectionId, - basePath: basePath, -); +Future saveCollectionHnswIndex( + {required String collectionId, required String basePath}) => + RustLib.instance.api.crateApiSourceRagSaveCollectionHnswIndex( + collectionId: collectionId, basePath: basePath); /// Load HNSW index from disk and mark the collection as active. -Future loadCollectionHnswIndex({ - required String collectionId, - required String basePath, -}) => RustLib.instance.api.crateApiSourceRagLoadCollectionHnswIndex( - collectionId: collectionId, - basePath: basePath, -); +Future loadCollectionHnswIndex( + {required String collectionId, required String basePath}) => + RustLib.instance.api.crateApiSourceRagLoadCollectionHnswIndex( + collectionId: collectionId, basePath: basePath); /// Ensure the in-memory hybrid search indexes are switched to the target collection. /// /// BM25 is rebuilt for the collection when not active, and HNSW is loaded (or rebuilt) /// from the collection-specific path as needed. -Future activateCollectionForHybridSearch({ - required String collectionId, - required String basePath, -}) => RustLib.instance.api.crateApiSourceRagActivateCollectionForHybridSearch( - collectionId: collectionId, - basePath: basePath, -); - -Future searchMetaHybrid({ - required String collectionId, - required String queryText, - required List queryEmbedding, - required SearchMetaHybridOptions options, -}) => RustLib.instance.api.crateApiSourceRagSearchMetaHybrid( - collectionId: collectionId, - queryText: queryText, - queryEmbedding: queryEmbedding, - options: options, -); - -Future deriveContextBudgetForPromptV2({ - required int fullPromptBudget, - required String query, - String? systemInstruction, - required bool useStrictMode, - required int safetyMarginTokens, - int? fixedPromptOverheadTokens, -}) => RustLib.instance.api.crateApiSourceRagDeriveContextBudgetForPromptV2( - fullPromptBudget: fullPromptBudget, - query: query, - systemInstruction: systemInstruction, - useStrictMode: useStrictMode, - safetyMarginTokens: safetyMarginTokens, - fixedPromptOverheadTokens: fixedPromptOverheadTokens, -); +Future activateCollectionForHybridSearch( + {required String collectionId, required String basePath}) => + RustLib.instance.api.crateApiSourceRagActivateCollectionForHybridSearch( + collectionId: collectionId, basePath: basePath); + +Future searchMetaHybrid( + {required String collectionId, + required String queryText, + required List queryEmbedding, + required SearchMetaHybridOptions options}) => + RustLib.instance.api.crateApiSourceRagSearchMetaHybrid( + collectionId: collectionId, + queryText: queryText, + queryEmbedding: queryEmbedding, + options: options); + +Future deriveContextBudgetForPromptV2( + {required int fullPromptBudget, + required String query, + String? systemInstruction, + required bool useStrictMode, + required int safetyMarginTokens, + int? fixedPromptOverheadTokens}) => + RustLib.instance.api.crateApiSourceRagDeriveContextBudgetForPromptV2( + fullPromptBudget: fullPromptBudget, + query: query, + systemInstruction: systemInstruction, + useStrictMode: useStrictMode, + safetyMarginTokens: safetyMarginTokens, + fixedPromptOverheadTokens: fixedPromptOverheadTokens); /// Search chunks by embedding similarity. -Future> searchChunks({ - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api.crateApiSourceRagSearchChunks( - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchChunks( + {required List queryEmbedding, required int topK}) => + RustLib.instance.api.crateApiSourceRagSearchChunks( + queryEmbedding: queryEmbedding, topK: topK); /// Search chunks by embedding similarity in a specific collection. -Future> searchChunksInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api.crateApiSourceRagSearchChunksInCollection( - collectionId: collectionId, - queryEmbedding: queryEmbedding, - topK: topK, -); +Future> searchChunksInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}) => + RustLib.instance.api.crateApiSourceRagSearchChunksInCollection( + collectionId: collectionId, queryEmbedding: queryEmbedding, topK: topK); /// Benchmark-only entrypoint for deterministic linear scan measurement. /// /// This bypasses HNSW activation/rebuild and executes the exact /// chunk linear-scan path directly for the given collection. -Future> benchmarkSearchChunksLinearInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, -}) => RustLib.instance.api - .crateApiSourceRagBenchmarkSearchChunksLinearInCollection( - collectionId: collectionId, - queryEmbedding: queryEmbedding, - topK: topK, - ); +Future> benchmarkSearchChunksLinearInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}) => + RustLib.instance.api + .crateApiSourceRagBenchmarkSearchChunksLinearInCollection( + collectionId: collectionId, + queryEmbedding: queryEmbedding, + topK: topK); /// Get source document by ID. Future getSource({required PlatformInt64 sourceId}) => @@ -215,76 +181,60 @@ Future> getSourceChunks({required PlatformInt64 sourceId}) => RustLib.instance.api.crateApiSourceRagGetSourceChunks(sourceId: sourceId); /// Get adjacent chunks by source_id and chunk_index range. -Future> getAdjacentChunks({ - required PlatformInt64 sourceId, - required int minIndex, - required int maxIndex, -}) => RustLib.instance.api.crateApiSourceRagGetAdjacentChunks( - sourceId: sourceId, - minIndex: minIndex, - maxIndex: maxIndex, -); +Future> getAdjacentChunks( + {required PlatformInt64 sourceId, + required int minIndex, + required int maxIndex}) => + RustLib.instance.api.crateApiSourceRagGetAdjacentChunks( + sourceId: sourceId, minIndex: minIndex, maxIndex: maxIndex); /// Delete a source and all its chunks. Future deleteSource({required PlatformInt64 sourceId}) => RustLib.instance.api.crateApiSourceRagDeleteSource(sourceId: sourceId); /// Delete a source and all its chunks in a specific collection. -Future deleteSourceInCollection({ - required String collectionId, - required PlatformInt64 sourceId, -}) => RustLib.instance.api.crateApiSourceRagDeleteSourceInCollection( - collectionId: collectionId, - sourceId: sourceId, -); +Future deleteSourceInCollection( + {required String collectionId, required PlatformInt64 sourceId}) => + RustLib.instance.api.crateApiSourceRagDeleteSourceInCollection( + collectionId: collectionId, sourceId: sourceId); /// Get the number of chunks for a specific source. -Future getSourceChunkCount({required PlatformInt64 sourceId}) => RustLib - .instance - .api - .crateApiSourceRagGetSourceChunkCount(sourceId: sourceId); +Future getSourceChunkCount({required PlatformInt64 sourceId}) => + RustLib.instance.api + .crateApiSourceRagGetSourceChunkCount(sourceId: sourceId); Future getSourceStats() => RustLib.instance.api.crateApiSourceRagGetSourceStats(); -Future getSourceStatsInCollection({ - required String collectionId, -}) => RustLib.instance.api.crateApiSourceRagGetSourceStatsInCollection( - collectionId: collectionId, -); +Future getSourceStatsInCollection( + {required String collectionId}) => + RustLib.instance.api.crateApiSourceRagGetSourceStatsInCollection( + collectionId: collectionId); /// Get all chunk IDs and contents for re-embedding. Future> getAllChunkIdsAndContents() => RustLib.instance.api.crateApiSourceRagGetAllChunkIdsAndContents(); -Future> getAllChunkIdsAndContentsInCollection({ - required String collectionId, -}) => +Future> getAllChunkIdsAndContentsInCollection( + {required String collectionId}) => RustLib.instance.api.crateApiSourceRagGetAllChunkIdsAndContentsInCollection( - collectionId: collectionId, - ); + collectionId: collectionId); /// Update embedding for a single chunk. -Future updateChunkEmbedding({ - required PlatformInt64 chunkId, - required List embedding, -}) => RustLib.instance.api.crateApiSourceRagUpdateChunkEmbedding( - chunkId: chunkId, - embedding: embedding, -); +Future updateChunkEmbedding( + {required PlatformInt64 chunkId, required List embedding}) => + RustLib.instance.api.crateApiSourceRagUpdateChunkEmbedding( + chunkId: chunkId, embedding: embedding); /// Stream the next batch of chunks that still carry a non-matching fingerprint. /// /// Used by the reembed flow to walk the corpus incrementally without holding /// the entire chunk set in Dart memory. The batch is ordered by `id` so a /// caller that crashes between batches can resume deterministically. -Future> listChunksNeedingReembed({ - required String targetFingerprint, - required PlatformInt64 limit, -}) => RustLib.instance.api.crateApiSourceRagListChunksNeedingReembed( - targetFingerprint: targetFingerprint, - limit: limit, -); +Future> listChunksNeedingReembed( + {required String targetFingerprint, required PlatformInt64 limit}) => + RustLib.instance.api.crateApiSourceRagListChunksNeedingReembed( + targetFingerprint: targetFingerprint, limit: limit); /// Atomically replace a chunk's embedding and tag it with `target_fingerprint`. /// @@ -292,29 +242,25 @@ Future> listChunksNeedingReembed({ /// new embedding bytes but the old fingerprint marker (or vice versa). Marks /// the chunk's collection as dirty so the next HNSW rebuild picks up the new /// vector. -Future updateChunkReembedded({ - required PlatformInt64 chunkId, - required List embedding, - required String targetFingerprint, -}) => RustLib.instance.api.crateApiSourceRagUpdateChunkReembedded( - chunkId: chunkId, - embedding: embedding, - targetFingerprint: targetFingerprint, -); +Future updateChunkReembedded( + {required PlatformInt64 chunkId, + required List embedding, + required String targetFingerprint}) => + RustLib.instance.api.crateApiSourceRagUpdateChunkReembedded( + chunkId: chunkId, + embedding: embedding, + targetFingerprint: targetFingerprint); // Rust type: RustOpaqueMoi> abstract class SearchHandle implements RustOpaqueInterface { - Future assembleContext({ - required AssembleContextOptions options, - }); + Future assembleContext( + {required AssembleContextOptions options}); @override Future dispose(); - Future> getChunkExcerpts({ - required Int64List chunkIds, - required int maxBytes, - }); + Future> getChunkExcerpts( + {required Int64List chunkIds, required int maxBytes}); Future> hitMeta(); @@ -500,7 +446,10 @@ class ChunkForReembedding { final PlatformInt64 chunkId; final String content; - const ChunkForReembedding({required this.chunkId, required this.content}); + const ChunkForReembedding({ + required this.chunkId, + required this.content, + }); @override int get hashCode => chunkId.hashCode ^ content.hashCode; @@ -557,7 +506,12 @@ class ChunkSearchResult { metadata == other.metadata; } -enum ContextAssemblyStrategy { relevanceFirst, diverseSources, chronological } +enum ContextAssemblyStrategy { + relevanceFirst, + diverseSources, + chronological, + ; +} class SearchHitMeta { final PlatformInt64 chunkId; @@ -676,7 +630,10 @@ class SourceStats { final PlatformInt64 sourceCount; final PlatformInt64 chunkCount; - const SourceStats({required this.sourceCount, required this.chunkCount}); + const SourceStats({ + required this.sourceCount, + required this.chunkCount, + }); @override int get hashCode => sourceCount.hashCode ^ chunkCount.hashCode; diff --git a/lib/src/rust/api/tokenizer.dart b/lib/src/rust/api/tokenizer.dart index c345e48..7ac797b 100644 --- a/lib/src/rust/api/tokenizer.dart +++ b/lib/src/rust/api/tokenizer.dart @@ -9,10 +9,9 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; // These functions are ignored because they are not marked as `pub`: `count_plain_text_tokens_untruncated`, `count_tokens_untruncated`, `encode_internal`, `encode_without_truncation`, `resolve_truncation_max_length`, `with_tokenizer` /// Initialize tokenizer with tokenizer.json file path. -Future initTokenizer({required String tokenizerPath}) => RustLib - .instance - .api - .crateApiTokenizerInitTokenizer(tokenizerPath: tokenizerPath); +Future initTokenizer({required String tokenizerPath}) => + RustLib.instance.api + .crateApiTokenizerInitTokenizer(tokenizerPath: tokenizerPath); /// Tokenize text (returns token IDs with CLS/SEP tokens). Uint32List tokenize({required String text}) => diff --git a/lib/src/rust/api/user_intent.dart b/lib/src/rust/api/user_intent.dart index a0788ee..e431799 100644 --- a/lib/src/rust/api/user_intent.dart +++ b/lib/src/rust/api/user_intent.dart @@ -53,21 +53,30 @@ class ParsedIntent { sealed class UserIntent with _$UserIntent { const UserIntent._(); - const factory UserIntent.summary({required String query}) = - UserIntent_Summary; - const factory UserIntent.define({required String term}) = UserIntent_Define; - const factory UserIntent.expandKnowledge({required String query}) = - UserIntent_ExpandKnowledge; - const factory UserIntent.general({required String query}) = - UserIntent_General; + const factory UserIntent.summary({ + required String query, + }) = UserIntent_Summary; + const factory UserIntent.define({ + required String term, + }) = UserIntent_Define; + const factory UserIntent.expandKnowledge({ + required String query, + }) = UserIntent_ExpandKnowledge; + const factory UserIntent.general({ + required String query, + }) = UserIntent_General; const factory UserIntent.invalidCommand({ required String command, required String reason, }) = UserIntent_InvalidCommand; Future getQuery() => - RustLib.instance.api.crateApiUserIntentUserIntentGetQuery(that: this); + RustLib.instance.api.crateApiUserIntentUserIntentGetQuery( + that: this, + ); Future intentType() => - RustLib.instance.api.crateApiUserIntentUserIntentIntentType(that: this); + RustLib.instance.api.crateApiUserIntentUserIntentIntentType( + that: this, + ); } diff --git a/lib/src/rust/api/user_intent.freezed.dart b/lib/src/rust/api/user_intent.freezed.dart index fa8c74b..04d10eb 100644 --- a/lib/src/rust/api/user_intent.freezed.dart +++ b/lib/src/rust/api/user_intent.freezed.dart @@ -11,230 +11,295 @@ part of 'user_intent.dart'; // dart format off T _$identity(T value) => value; + /// @nodoc mixin _$UserIntent { + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is UserIntent); + } + @override + int get hashCode => runtimeType.hashCode; - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent); -} - - -@override -int get hashCode => runtimeType.hashCode; - -@override -String toString() { - return 'UserIntent()'; -} - - + @override + String toString() { + return 'UserIntent()'; + } } /// @nodoc -class $UserIntentCopyWith<$Res> { -$UserIntentCopyWith(UserIntent _, $Res Function(UserIntent) __); +class $UserIntentCopyWith<$Res> { + $UserIntentCopyWith(UserIntent _, $Res Function(UserIntent) __); } - /// Adds pattern-matching-related methods to [UserIntent]. extension UserIntentPatterns on UserIntent { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap({TResult Function( UserIntent_Summary value)? summary,TResult Function( UserIntent_Define value)? define,TResult Function( UserIntent_ExpandKnowledge value)? expandKnowledge,TResult Function( UserIntent_General value)? general,TResult Function( UserIntent_InvalidCommand value)? invalidCommand,required TResult orElse(),}){ -final _that = this; -switch (_that) { -case UserIntent_Summary() when summary != null: -return summary(_that);case UserIntent_Define() when define != null: -return define(_that);case UserIntent_ExpandKnowledge() when expandKnowledge != null: -return expandKnowledge(_that);case UserIntent_General() when general != null: -return general(_that);case UserIntent_InvalidCommand() when invalidCommand != null: -return invalidCommand(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map({required TResult Function( UserIntent_Summary value) summary,required TResult Function( UserIntent_Define value) define,required TResult Function( UserIntent_ExpandKnowledge value) expandKnowledge,required TResult Function( UserIntent_General value) general,required TResult Function( UserIntent_InvalidCommand value) invalidCommand,}){ -final _that = this; -switch (_that) { -case UserIntent_Summary(): -return summary(_that);case UserIntent_Define(): -return define(_that);case UserIntent_ExpandKnowledge(): -return expandKnowledge(_that);case UserIntent_General(): -return general(_that);case UserIntent_InvalidCommand(): -return invalidCommand(_that);} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull({TResult? Function( UserIntent_Summary value)? summary,TResult? Function( UserIntent_Define value)? define,TResult? Function( UserIntent_ExpandKnowledge value)? expandKnowledge,TResult? Function( UserIntent_General value)? general,TResult? Function( UserIntent_InvalidCommand value)? invalidCommand,}){ -final _that = this; -switch (_that) { -case UserIntent_Summary() when summary != null: -return summary(_that);case UserIntent_Define() when define != null: -return define(_that);case UserIntent_ExpandKnowledge() when expandKnowledge != null: -return expandKnowledge(_that);case UserIntent_General() when general != null: -return general(_that);case UserIntent_InvalidCommand() when invalidCommand != null: -return invalidCommand(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen({TResult Function( String query)? summary,TResult Function( String term)? define,TResult Function( String query)? expandKnowledge,TResult Function( String query)? general,TResult Function( String command, String reason)? invalidCommand,required TResult orElse(),}) {final _that = this; -switch (_that) { -case UserIntent_Summary() when summary != null: -return summary(_that.query);case UserIntent_Define() when define != null: -return define(_that.term);case UserIntent_ExpandKnowledge() when expandKnowledge != null: -return expandKnowledge(_that.query);case UserIntent_General() when general != null: -return general(_that.query);case UserIntent_InvalidCommand() when invalidCommand != null: -return invalidCommand(_that.command,_that.reason);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when({required TResult Function( String query) summary,required TResult Function( String term) define,required TResult Function( String query) expandKnowledge,required TResult Function( String query) general,required TResult Function( String command, String reason) invalidCommand,}) {final _that = this; -switch (_that) { -case UserIntent_Summary(): -return summary(_that.query);case UserIntent_Define(): -return define(_that.term);case UserIntent_ExpandKnowledge(): -return expandKnowledge(_that.query);case UserIntent_General(): -return general(_that.query);case UserIntent_InvalidCommand(): -return invalidCommand(_that.command,_that.reason);} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull({TResult? Function( String query)? summary,TResult? Function( String term)? define,TResult? Function( String query)? expandKnowledge,TResult? Function( String query)? general,TResult? Function( String command, String reason)? invalidCommand,}) {final _that = this; -switch (_that) { -case UserIntent_Summary() when summary != null: -return summary(_that.query);case UserIntent_Define() when define != null: -return define(_that.term);case UserIntent_ExpandKnowledge() when expandKnowledge != null: -return expandKnowledge(_that.query);case UserIntent_General() when general != null: -return general(_that.query);case UserIntent_InvalidCommand() when invalidCommand != null: -return invalidCommand(_that.command,_that.reason);case _: - return null; - -} -} - + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap({ + TResult Function(UserIntent_Summary value)? summary, + TResult Function(UserIntent_Define value)? define, + TResult Function(UserIntent_ExpandKnowledge value)? expandKnowledge, + TResult Function(UserIntent_General value)? general, + TResult Function(UserIntent_InvalidCommand value)? invalidCommand, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary() when summary != null: + return summary(_that); + case UserIntent_Define() when define != null: + return define(_that); + case UserIntent_ExpandKnowledge() when expandKnowledge != null: + return expandKnowledge(_that); + case UserIntent_General() when general != null: + return general(_that); + case UserIntent_InvalidCommand() when invalidCommand != null: + return invalidCommand(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map({ + required TResult Function(UserIntent_Summary value) summary, + required TResult Function(UserIntent_Define value) define, + required TResult Function(UserIntent_ExpandKnowledge value) expandKnowledge, + required TResult Function(UserIntent_General value) general, + required TResult Function(UserIntent_InvalidCommand value) invalidCommand, + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary(): + return summary(_that); + case UserIntent_Define(): + return define(_that); + case UserIntent_ExpandKnowledge(): + return expandKnowledge(_that); + case UserIntent_General(): + return general(_that); + case UserIntent_InvalidCommand(): + return invalidCommand(_that); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(UserIntent_Summary value)? summary, + TResult? Function(UserIntent_Define value)? define, + TResult? Function(UserIntent_ExpandKnowledge value)? expandKnowledge, + TResult? Function(UserIntent_General value)? general, + TResult? Function(UserIntent_InvalidCommand value)? invalidCommand, + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary() when summary != null: + return summary(_that); + case UserIntent_Define() when define != null: + return define(_that); + case UserIntent_ExpandKnowledge() when expandKnowledge != null: + return expandKnowledge(_that); + case UserIntent_General() when general != null: + return general(_that); + case UserIntent_InvalidCommand() when invalidCommand != null: + return invalidCommand(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String query)? summary, + TResult Function(String term)? define, + TResult Function(String query)? expandKnowledge, + TResult Function(String query)? general, + TResult Function(String command, String reason)? invalidCommand, + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary() when summary != null: + return summary(_that.query); + case UserIntent_Define() when define != null: + return define(_that.term); + case UserIntent_ExpandKnowledge() when expandKnowledge != null: + return expandKnowledge(_that.query); + case UserIntent_General() when general != null: + return general(_that.query); + case UserIntent_InvalidCommand() when invalidCommand != null: + return invalidCommand(_that.command, _that.reason); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when({ + required TResult Function(String query) summary, + required TResult Function(String term) define, + required TResult Function(String query) expandKnowledge, + required TResult Function(String query) general, + required TResult Function(String command, String reason) invalidCommand, + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary(): + return summary(_that.query); + case UserIntent_Define(): + return define(_that.term); + case UserIntent_ExpandKnowledge(): + return expandKnowledge(_that.query); + case UserIntent_General(): + return general(_that.query); + case UserIntent_InvalidCommand(): + return invalidCommand(_that.command, _that.reason); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String query)? summary, + TResult? Function(String term)? define, + TResult? Function(String query)? expandKnowledge, + TResult? Function(String query)? general, + TResult? Function(String command, String reason)? invalidCommand, + }) { + final _that = this; + switch (_that) { + case UserIntent_Summary() when summary != null: + return summary(_that.query); + case UserIntent_Define() when define != null: + return define(_that.term); + case UserIntent_ExpandKnowledge() when expandKnowledge != null: + return expandKnowledge(_that.query); + case UserIntent_General() when general != null: + return general(_that.query); + case UserIntent_InvalidCommand() when invalidCommand != null: + return invalidCommand(_that.command, _that.reason); + case _: + return null; + } + } } /// @nodoc - class UserIntent_Summary extends UserIntent { - const UserIntent_Summary({required this.query}): super._(); - + const UserIntent_Summary({required this.query}) : super._(); - final String query; + final String query; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$UserIntent_SummaryCopyWith get copyWith => _$UserIntent_SummaryCopyWithImpl(this, _$identity); + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $UserIntent_SummaryCopyWith get copyWith => + _$UserIntent_SummaryCopyWithImpl(this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is UserIntent_Summary && + (identical(other.query, query) || other.query == query)); + } + @override + int get hashCode => Object.hash(runtimeType, query); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent_Summary&&(identical(other.query, query) || other.query == query)); -} - - -@override -int get hashCode => Object.hash(runtimeType,query); - -@override -String toString() { - return 'UserIntent.summary(query: $query)'; -} - - + @override + String toString() { + return 'UserIntent.summary(query: $query)'; + } } /// @nodoc -abstract mixin class $UserIntent_SummaryCopyWith<$Res> implements $UserIntentCopyWith<$Res> { - factory $UserIntent_SummaryCopyWith(UserIntent_Summary value, $Res Function(UserIntent_Summary) _then) = _$UserIntent_SummaryCopyWithImpl; -@useResult -$Res call({ - String query -}); - - - - +abstract mixin class $UserIntent_SummaryCopyWith<$Res> + implements $UserIntentCopyWith<$Res> { + factory $UserIntent_SummaryCopyWith( + UserIntent_Summary value, $Res Function(UserIntent_Summary) _then) = + _$UserIntent_SummaryCopyWithImpl; + @useResult + $Res call({String query}); } + /// @nodoc class _$UserIntent_SummaryCopyWithImpl<$Res> implements $UserIntent_SummaryCopyWith<$Res> { @@ -243,64 +308,62 @@ class _$UserIntent_SummaryCopyWithImpl<$Res> final UserIntent_Summary _self; final $Res Function(UserIntent_Summary) _then; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? query = null,}) { - return _then(UserIntent_Summary( -query: null == query ? _self.query : query // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? query = null, + }) { + return _then(UserIntent_Summary( + query: null == query + ? _self.query + : query // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class UserIntent_Define extends UserIntent { - const UserIntent_Define({required this.term}): super._(); - - - final String term; - -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$UserIntent_DefineCopyWith get copyWith => _$UserIntent_DefineCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent_Define&&(identical(other.term, term) || other.term == term)); -} + const UserIntent_Define({required this.term}) : super._(); + final String term; -@override -int get hashCode => Object.hash(runtimeType,term); + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $UserIntent_DefineCopyWith get copyWith => + _$UserIntent_DefineCopyWithImpl(this, _$identity); -@override -String toString() { - return 'UserIntent.define(term: $term)'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is UserIntent_Define && + (identical(other.term, term) || other.term == term)); + } + @override + int get hashCode => Object.hash(runtimeType, term); + @override + String toString() { + return 'UserIntent.define(term: $term)'; + } } /// @nodoc -abstract mixin class $UserIntent_DefineCopyWith<$Res> implements $UserIntentCopyWith<$Res> { - factory $UserIntent_DefineCopyWith(UserIntent_Define value, $Res Function(UserIntent_Define) _then) = _$UserIntent_DefineCopyWithImpl; -@useResult -$Res call({ - String term -}); - - - - +abstract mixin class $UserIntent_DefineCopyWith<$Res> + implements $UserIntentCopyWith<$Res> { + factory $UserIntent_DefineCopyWith( + UserIntent_Define value, $Res Function(UserIntent_Define) _then) = + _$UserIntent_DefineCopyWithImpl; + @useResult + $Res call({String term}); } + /// @nodoc class _$UserIntent_DefineCopyWithImpl<$Res> implements $UserIntent_DefineCopyWith<$Res> { @@ -309,64 +372,64 @@ class _$UserIntent_DefineCopyWithImpl<$Res> final UserIntent_Define _self; final $Res Function(UserIntent_Define) _then; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? term = null,}) { - return _then(UserIntent_Define( -term: null == term ? _self.term : term // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? term = null, + }) { + return _then(UserIntent_Define( + term: null == term + ? _self.term + : term // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class UserIntent_ExpandKnowledge extends UserIntent { - const UserIntent_ExpandKnowledge({required this.query}): super._(); - - - final String query; - -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$UserIntent_ExpandKnowledgeCopyWith get copyWith => _$UserIntent_ExpandKnowledgeCopyWithImpl(this, _$identity); - + const UserIntent_ExpandKnowledge({required this.query}) : super._(); + final String query; -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent_ExpandKnowledge&&(identical(other.query, query) || other.query == query)); -} - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $UserIntent_ExpandKnowledgeCopyWith + get copyWith => + _$UserIntent_ExpandKnowledgeCopyWithImpl( + this, _$identity); -@override -int get hashCode => Object.hash(runtimeType,query); - -@override -String toString() { - return 'UserIntent.expandKnowledge(query: $query)'; -} + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is UserIntent_ExpandKnowledge && + (identical(other.query, query) || other.query == query)); + } + @override + int get hashCode => Object.hash(runtimeType, query); + @override + String toString() { + return 'UserIntent.expandKnowledge(query: $query)'; + } } /// @nodoc -abstract mixin class $UserIntent_ExpandKnowledgeCopyWith<$Res> implements $UserIntentCopyWith<$Res> { - factory $UserIntent_ExpandKnowledgeCopyWith(UserIntent_ExpandKnowledge value, $Res Function(UserIntent_ExpandKnowledge) _then) = _$UserIntent_ExpandKnowledgeCopyWithImpl; -@useResult -$Res call({ - String query -}); - - - - +abstract mixin class $UserIntent_ExpandKnowledgeCopyWith<$Res> + implements $UserIntentCopyWith<$Res> { + factory $UserIntent_ExpandKnowledgeCopyWith(UserIntent_ExpandKnowledge value, + $Res Function(UserIntent_ExpandKnowledge) _then) = + _$UserIntent_ExpandKnowledgeCopyWithImpl; + @useResult + $Res call({String query}); } + /// @nodoc class _$UserIntent_ExpandKnowledgeCopyWithImpl<$Res> implements $UserIntent_ExpandKnowledgeCopyWith<$Res> { @@ -375,64 +438,62 @@ class _$UserIntent_ExpandKnowledgeCopyWithImpl<$Res> final UserIntent_ExpandKnowledge _self; final $Res Function(UserIntent_ExpandKnowledge) _then; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? query = null,}) { - return _then(UserIntent_ExpandKnowledge( -query: null == query ? _self.query : query // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? query = null, + }) { + return _then(UserIntent_ExpandKnowledge( + query: null == query + ? _self.query + : query // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class UserIntent_General extends UserIntent { - const UserIntent_General({required this.query}): super._(); - - - final String query; + const UserIntent_General({required this.query}) : super._(); -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$UserIntent_GeneralCopyWith get copyWith => _$UserIntent_GeneralCopyWithImpl(this, _$identity); + final String query; + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $UserIntent_GeneralCopyWith get copyWith => + _$UserIntent_GeneralCopyWithImpl(this, _$identity); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is UserIntent_General && + (identical(other.query, query) || other.query == query)); + } -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent_General&&(identical(other.query, query) || other.query == query)); -} - - -@override -int get hashCode => Object.hash(runtimeType,query); - -@override -String toString() { - return 'UserIntent.general(query: $query)'; -} - + @override + int get hashCode => Object.hash(runtimeType, query); + @override + String toString() { + return 'UserIntent.general(query: $query)'; + } } /// @nodoc -abstract mixin class $UserIntent_GeneralCopyWith<$Res> implements $UserIntentCopyWith<$Res> { - factory $UserIntent_GeneralCopyWith(UserIntent_General value, $Res Function(UserIntent_General) _then) = _$UserIntent_GeneralCopyWithImpl; -@useResult -$Res call({ - String query -}); - - - - +abstract mixin class $UserIntent_GeneralCopyWith<$Res> + implements $UserIntentCopyWith<$Res> { + factory $UserIntent_GeneralCopyWith( + UserIntent_General value, $Res Function(UserIntent_General) _then) = + _$UserIntent_GeneralCopyWithImpl; + @useResult + $Res call({String query}); } + /// @nodoc class _$UserIntent_GeneralCopyWithImpl<$Res> implements $UserIntent_GeneralCopyWith<$Res> { @@ -441,65 +502,66 @@ class _$UserIntent_GeneralCopyWithImpl<$Res> final UserIntent_General _self; final $Res Function(UserIntent_General) _then; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? query = null,}) { - return _then(UserIntent_General( -query: null == query ? _self.query : query // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? query = null, + }) { + return _then(UserIntent_General( + query: null == query + ? _self.query + : query // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc - class UserIntent_InvalidCommand extends UserIntent { - const UserIntent_InvalidCommand({required this.command, required this.reason}): super._(); - - - final String command; - final String reason; - -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$UserIntent_InvalidCommandCopyWith get copyWith => _$UserIntent_InvalidCommandCopyWithImpl(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is UserIntent_InvalidCommand&&(identical(other.command, command) || other.command == command)&&(identical(other.reason, reason) || other.reason == reason)); -} - - -@override -int get hashCode => Object.hash(runtimeType,command,reason); - -@override -String toString() { - return 'UserIntent.invalidCommand(command: $command, reason: $reason)'; -} - - + const UserIntent_InvalidCommand({required this.command, required this.reason}) + : super._(); + + final String command; + final String reason; + + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $UserIntent_InvalidCommandCopyWith get copyWith => + _$UserIntent_InvalidCommandCopyWithImpl( + this, _$identity); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is UserIntent_InvalidCommand && + (identical(other.command, command) || other.command == command) && + (identical(other.reason, reason) || other.reason == reason)); + } + + @override + int get hashCode => Object.hash(runtimeType, command, reason); + + @override + String toString() { + return 'UserIntent.invalidCommand(command: $command, reason: $reason)'; + } } /// @nodoc -abstract mixin class $UserIntent_InvalidCommandCopyWith<$Res> implements $UserIntentCopyWith<$Res> { - factory $UserIntent_InvalidCommandCopyWith(UserIntent_InvalidCommand value, $Res Function(UserIntent_InvalidCommand) _then) = _$UserIntent_InvalidCommandCopyWithImpl; -@useResult -$Res call({ - String command, String reason -}); - - - - +abstract mixin class $UserIntent_InvalidCommandCopyWith<$Res> + implements $UserIntentCopyWith<$Res> { + factory $UserIntent_InvalidCommandCopyWith(UserIntent_InvalidCommand value, + $Res Function(UserIntent_InvalidCommand) _then) = + _$UserIntent_InvalidCommandCopyWithImpl; + @useResult + $Res call({String command, String reason}); } + /// @nodoc class _$UserIntent_InvalidCommandCopyWithImpl<$Res> implements $UserIntent_InvalidCommandCopyWith<$Res> { @@ -508,17 +570,24 @@ class _$UserIntent_InvalidCommandCopyWithImpl<$Res> final UserIntent_InvalidCommand _self; final $Res Function(UserIntent_InvalidCommand) _then; -/// Create a copy of UserIntent -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') $Res call({Object? command = null,Object? reason = null,}) { - return _then(UserIntent_InvalidCommand( -command: null == command ? _self.command : command // ignore: cast_nullable_to_non_nullable -as String,reason: null == reason ? _self.reason : reason // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - + /// Create a copy of UserIntent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? command = null, + Object? reason = null, + }) { + return _then(UserIntent_InvalidCommand( + command: null == command + ? _self.command + : command // ignore: cast_nullable_to_non_nullable + as String, + reason: null == reason + ? _self.reason + : reason // ignore: cast_nullable_to_non_nullable + as String, + )); + } } // dart format on diff --git a/lib/src/rust/frb_generated.dart b/lib/src/rust/frb_generated.dart index c88025f..1a0a5a0 100644 --- a/lib/src/rust/frb_generated.dart +++ b/lib/src/rust/frb_generated.dart @@ -3,6 +3,7 @@ // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field +import 'api/activation_metrics.dart'; import 'api/bm25_search.dart'; import 'api/compression_utils.dart'; import 'api/db_pool.dart'; @@ -16,6 +17,7 @@ import 'api/ingest_session.dart'; import 'api/logger.dart'; import 'api/migration_meta.dart'; import 'api/query_metrics.dart'; +import 'api/runtime_info.dart'; import 'api/semantic_chunker.dart'; import 'api/simple.dart'; import 'api/simple_rag.dart'; @@ -53,8 +55,12 @@ class RustLib extends BaseEntrypoint { /// Initialize flutter_rust_bridge in mock mode. /// No libraries for FFI are loaded. - static void initMock({required RustLibApi api}) { - instance.initMockImpl(api: api); + static void initMock({ + required RustLibApi api, + }) { + instance.initMockImpl( + api: api, + ); } /// Dispose flutter_rust_bridge @@ -84,179 +90,133 @@ class RustLib extends BaseEntrypoint { String get codegenVersion => '2.11.1'; @override - int get rustContentHash => 907237406; + int get rustContentHash => -1086205755; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( - stem: 'rag_engine_flutter', - ioDirectory: 'rust_builder/rust/target/release/', - webPrefix: 'pkg/', - ); + stem: 'rag_engine_flutter', + ioDirectory: 'rust_builder/rust/target/release/', + webPrefix: 'pkg/', + ); } abstract class RustLibApi extends BaseApi { - Future crateApiIngestSessionIngestSessionAbort({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionAbort( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionCommitEmbeddings({ - required IngestSession that, - required List embeddings, - }); + Future crateApiIngestSessionIngestSessionCommitEmbeddings( + {required IngestSession that, required List embeddings}); - Future crateApiIngestSessionIngestSessionCommittedCount({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionCommittedCount( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionDispose({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionDispose( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionFinalize({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionFinalize( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionInFlightCount({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionInFlightCount( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionPendingDispatchCount({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionPendingDispatchCount( + {required IngestSession that}); - Future crateApiIngestSessionIngestSessionSourceId({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionSourceId( + {required IngestSession that}); Future> - crateApiIngestSessionIngestSessionTakeEmbeddingBatch({ - required IngestSession that, - required int batchSize, - }); + crateApiIngestSessionIngestSessionTakeEmbeddingBatch( + {required IngestSession that, required int batchSize}); - Future crateApiIngestSessionIngestSessionTotal({ - required IngestSession that, - }); + Future crateApiIngestSessionIngestSessionTotal( + {required IngestSession that}); - Future crateApiSourceRagSearchHandleAssembleContext({ - required SearchHandle that, - required AssembleContextOptions options, - }); + Future crateApiSourceRagSearchHandleAssembleContext( + {required SearchHandle that, required AssembleContextOptions options}); - Future crateApiSourceRagSearchHandleDispose({ - required SearchHandle that, - }); + Future crateApiSourceRagSearchHandleDispose( + {required SearchHandle that}); Future> - crateApiSourceRagSearchHandleGetChunkExcerpts({ - required SearchHandle that, - required Int64List chunkIds, - required int maxBytes, - }); + crateApiSourceRagSearchHandleGetChunkExcerpts( + {required SearchHandle that, + required Int64List chunkIds, + required int maxBytes}); - Future> crateApiSourceRagSearchHandleHitMeta({ - required SearchHandle that, - }); + Future> crateApiSourceRagSearchHandleHitMeta( + {required SearchHandle that}); - Future> crateApiSourceRagSearchHandleHydrateChunks({ - required SearchHandle that, - required Int64List chunkIds, - }); + Future> crateApiSourceRagSearchHandleHydrateChunks( + {required SearchHandle that, required Int64List chunkIds}); - Future crateApiMigrationMetaAcknowledgeAndClearEmbeddings({ - required String confirmation, - required String newFingerprint, - }); + Future crateApiMigrationMetaAcknowledgeAndClearEmbeddings( + {required String confirmation, required String newFingerprint}); - Future crateApiSourceRagActivateCollectionForHybridSearch({ - required String collectionId, - required String basePath, - }); + Future crateApiSourceRagActivateCollectionForHybridSearch( + {required String collectionId, required String basePath}); - Future crateApiSourceRagAddChunks({ - required PlatformInt64 sourceId, - required List chunks, - }); + ActivationTimingStats crateApiActivationMetricsActivationTimingStats(); - Future crateApiSimpleRagAddDocument({ - required String content, - required List embedding, - }); + Future crateApiSourceRagAddChunks( + {required PlatformInt64 sourceId, required List chunks}); - Future crateApiSimpleRagAddDocumentSimple({ - required String content, - required List embedding, - }); + Future crateApiSimpleRagAddDocument( + {required String content, required List embedding}); - Future crateApiSourceRagAddSource({ - required String content, - String? metadata, - String? name, - }); + Future crateApiSimpleRagAddDocumentSimple( + {required String content, required List embedding}); - Future crateApiSourceRagAddSourceInCollection({ - required String collectionId, - required String content, - String? metadata, - String? name, - }); + Future crateApiSourceRagAddSource( + {required String content, String? metadata, String? name}); - Future crateApiMigrationMetaBeginEmbeddingReembed({ - required String targetFingerprint, - }); + Future crateApiSourceRagAddSourceInCollection( + {required String collectionId, + required String content, + String? metadata, + String? name}); + + Future crateApiMigrationMetaBeginEmbeddingReembed( + {required String targetFingerprint}); Future> - crateApiSourceRagBenchmarkSearchChunksLinearInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, - }); + crateApiSourceRagBenchmarkSearchChunksLinearInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}); - Future> crateApiSimpleRagBenchmarkSearchLinearScan({ - required List queryEmbedding, - required int topK, - }); + Future> crateApiSimpleRagBenchmarkSearchLinearScan( + {required List queryEmbedding, required int topK}); - Future crateApiBm25SearchBm25AddDocument({ - required PlatformInt64 docId, - required String content, - }); + Future crateApiBm25SearchBm25AddDocument( + {required PlatformInt64 docId, required String content}); - Future crateApiBm25SearchBm25AddDocuments({ - required List<(PlatformInt64, String)> docs, - }); + Future crateApiBm25SearchBm25AddDocuments( + {required List<(PlatformInt64, String)> docs}); Future crateApiBm25SearchBm25ClearIndex(); Future crateApiBm25SearchBm25GetDocumentCount(); - Future crateApiBm25SearchBm25RemoveDocument({ - required PlatformInt64 docId, - }); + Future crateApiBm25SearchBm25RemoveDocument( + {required PlatformInt64 docId}); - Future> crateApiBm25SearchBm25Search({ - required String query, - required int topK, - }); + Future> crateApiBm25SearchBm25Search( + {required String query, required int topK}); - Future crateApiHnswIndexBuildHnswIndex({ - required List<(PlatformInt64, Float32List)> points, - }); + Future crateApiHnswIndexBuildHnswIndex( + {required List<(PlatformInt64, Float32List)> points}); - double crateApiSimpleRagCalculateCosineSimilarity({ - required List vecA, - required List vecB, - }); + double crateApiSimpleRagCalculateCosineSimilarity( + {required List vecA, required List vecB}); Future crateApiSemanticChunkerChunkTypeAsStr({required ChunkType that}); - Future crateApiSemanticChunkerChunkTypeFromStr({ - required String s, - }); + Future crateApiSemanticChunkerChunkTypeFromStr( + {required String s}); - Future crateApiSourceRagClaimSourceForIngestion({ - required PlatformInt64 sourceId, - }); + Future crateApiSourceRagClaimSourceForIngestion( + {required PlatformInt64 sourceId}); ChunkType crateApiSemanticChunkerClassifyChunk({required String text}); @@ -266,31 +226,26 @@ abstract class RustLibApi extends BaseApi { Future crateApiHnswIndexClearHnswIndex(); - Future crateApiSourceRagClearSourceChunks({ - required PlatformInt64 sourceId, - }); + Future crateApiSourceRagClearSourceChunks( + {required PlatformInt64 sourceId}); Future crateApiDbPoolCloseDbPool(); void crateApiLoggerCloseLogStream(); - Future crateApiCompressionUtilsCompressText({ - required String text, - required int maxChars, - required CompressionOptions options, - }); + Future crateApiCompressionUtilsCompressText( + {required String text, + required int maxChars, + required CompressionOptions options}); - Future crateApiCompressionUtilsCompressTextSimple({ - required String text, - required int level, - }); + Future crateApiCompressionUtilsCompressTextSimple( + {required String text, required int level}); Future - crateApiCompressionUtilsCompressionOptionsDefault(); + crateApiCompressionUtilsCompressionOptionsDefault(); - Future crateApiMigrationMetaCountChunksNeedingReembed({ - required String targetFingerprint, - }); + Future crateApiMigrationMetaCountChunksNeedingReembed( + {required String targetFingerprint}); int crateApiTokenizerCountTokens({required String text}); @@ -298,70 +253,56 @@ abstract class RustLibApi extends BaseApi { Future crateApiSourceRagDeleteSource({required PlatformInt64 sourceId}); - Future crateApiSourceRagDeleteSourceInCollection({ - required String collectionId, - required PlatformInt64 sourceId, - }); + Future crateApiSourceRagDeleteSourceInCollection( + {required String collectionId, required PlatformInt64 sourceId}); - Future crateApiSourceRagDeriveContextBudgetForPromptV2({ - required int fullPromptBudget, - required String query, - String? systemInstruction, - required bool useStrictMode, - required int safetyMarginTokens, - int? fixedPromptOverheadTokens, - }); + Future crateApiSourceRagDeriveContextBudgetForPromptV2( + {required int fullPromptBudget, + required String query, + String? systemInstruction, + required bool useStrictMode, + required int safetyMarginTokens, + int? fixedPromptOverheadTokens}); Future - crateApiMigrationMetaDetectEmbeddingFingerprintGate({ - required String currentFingerprint, - }); + crateApiMigrationMetaDetectEmbeddingFingerprintGate( + {required String currentFingerprint}); - Future crateApiHnswIndexEmbeddingPointNew({ - required PlatformInt64 id, - required List embedding, - }); + Future crateApiHnswIndexEmbeddingPointNew( + {required PlatformInt64 id, required List embedding}); - Future crateApiDocumentParserExtractTextFromDocument({ - required List fileBytes, - }); + Future crateApiDocumentParserExtractTextFromDocument( + {required List fileBytes}); - Future crateApiDocumentParserExtractTextFromDocx({ - required List fileBytes, - }); + Future crateApiDocumentParserExtractTextFromDocx( + {required List fileBytes}); - Future crateApiDocumentParserExtractTextFromFile({ - required String filePath, - }); + Future crateApiDocumentParserExtractTextFromFile( + {required String filePath}); - Future crateApiDocumentParserExtractTextFromPdf({ - required List fileBytes, - }); + Future crateApiDocumentParserExtractTextFromPdf( + {required List fileBytes}); - Future crateApiDocumentParserExtractTextFromUtf8({ - required List fileBytes, - }); + Future crateApiDocumentParserExtractTextFromUtf8( + {required List fileBytes}); - Future crateApiMigrationMetaFinalizeEmbeddingReembed({ - required String targetFingerprint, - }); + Future crateApiMigrationMetaFinalizeEmbeddingReembed( + {required String targetFingerprint}); - Future> crateApiSourceRagGetAdjacentChunks({ - required PlatformInt64 sourceId, - required int minIndex, - required int maxIndex, - }); + Future> crateApiSourceRagGetAdjacentChunks( + {required PlatformInt64 sourceId, + required int minIndex, + required int maxIndex}); Future> - crateApiSourceRagGetAllChunkIdsAndContents(); + crateApiSourceRagGetAllChunkIdsAndContents(); Future> - crateApiSourceRagGetAllChunkIdsAndContentsInCollection({ - required String collectionId, - }); + crateApiSourceRagGetAllChunkIdsAndContentsInCollection( + {required String collectionId}); Future> - crateApiIncrementalIndexGetBufferForMerge(); + crateApiIncrementalIndexGetBufferForMerge(); Future crateApiIncrementalIndexGetBufferStats(); @@ -371,66 +312,51 @@ abstract class RustLibApi extends BaseApi { Future crateApiSourceRagGetSource({required PlatformInt64 sourceId}); - Future crateApiSourceRagGetSourceChunkCount({ - required PlatformInt64 sourceId, - }); + Future crateApiSourceRagGetSourceChunkCount( + {required PlatformInt64 sourceId}); - Future> crateApiSourceRagGetSourceChunks({ - required PlatformInt64 sourceId, - }); + Future> crateApiSourceRagGetSourceChunks( + {required PlatformInt64 sourceId}); Future crateApiSourceRagGetSourceStats(); - Future crateApiSourceRagGetSourceStatsInCollection({ - required String collectionId, - }); + Future crateApiSourceRagGetSourceStatsInCollection( + {required String collectionId}); - Future crateApiSourceRagGetSourceStatus({ - required PlatformInt64 sourceId, - }); + Future crateApiSourceRagGetSourceStatus( + {required PlatformInt64 sourceId}); int crateApiTokenizerGetVocabSize(); String crateApiSimpleGreet({required String name}); - Future crateApiIncrementalIndexIncrementalAdd({ - required PlatformInt64 docId, - required List embedding, - }); + Future crateApiIncrementalIndexIncrementalAdd( + {required PlatformInt64 docId, required List embedding}); - Future crateApiIncrementalIndexIncrementalAddBatch({ - required List<(PlatformInt64, Float32List)> docs, - }); + Future crateApiIncrementalIndexIncrementalAddBatch( + {required List<(PlatformInt64, Float32List)> docs}); - Future crateApiIncrementalIndexIncrementalRemove({ - required PlatformInt64 docId, - }); + Future crateApiIncrementalIndexIncrementalRemove( + {required PlatformInt64 docId}); Future> - crateApiIncrementalIndexIncrementalSearch({ - required List queryEmbedding, - required BigInt topK, - }); + crateApiIncrementalIndexIncrementalSearch( + {required List queryEmbedding, required BigInt topK}); IngestTrafficStats crateApiIngestMetricsIngestTrafficStats(); - Future crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal({ - required IngestTrafficStats that, - }); + Future crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal( + {required IngestTrafficStats that}); - Future - crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal({ - required IngestTrafficStats that, - }); + Future crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal( + {required IngestTrafficStats that}); Future crateApiSimpleInitApp(); Future crateApiSimpleRagInitDb(); - Future crateApiDbPoolInitDbPool({ - required String dbPath, - required int maxSize, - }); + Future crateApiDbPoolInitDbPool( + {required String dbPath, required int maxSize}); Stream crateApiLoggerInitLogStream(); @@ -448,28 +374,23 @@ abstract class RustLibApi extends BaseApi { Future crateApiDbPoolIsPoolInitialized(); - Future> crateApiSourceRagListChunksNeedingReembed({ - required String targetFingerprint, - required PlatformInt64 limit, - }); + Future> crateApiSourceRagListChunksNeedingReembed( + {required String targetFingerprint, required PlatformInt64 limit}); Future> crateApiSourceRagListSources(); - Future> crateApiSourceRagListSourcesInCollection({ - required String collectionId, - }); + Future> crateApiSourceRagListSourcesInCollection( + {required String collectionId}); - Future crateApiSourceRagLoadCollectionHnswIndex({ - required String collectionId, - required String basePath, - }); + Future crateApiSourceRagLoadCollectionHnswIndex( + {required String collectionId, required String basePath}); Future crateApiHnswIndexLoadHnswIndex({required String basePath}); - List crateApiSemanticChunkerMarkdownChunk({ - required String text, - required int maxChars, - }); + List crateApiSemanticChunkerMarkdownChunk( + {required String text, required int maxChars}); + + NativeRuntimeInfo crateApiRuntimeInfoNativeRuntimeInfo(); Future crateApiIncrementalIndexNeedsMerge(); @@ -477,56 +398,47 @@ abstract class RustLibApi extends BaseApi { UserIntent crateApiUserIntentParseUserIntent({required String input}); - Future crateApiIngestSessionPrepareSourceIngestion({ - required String collectionId, - required String content, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, - }); - - Future - crateApiIngestSessionPrepareSourceIngestionFromFile({ - required String collectionId, - required String filePath, - String? metadata, - String? name, - IngestStrategy? strategyHint, - required int maxChars, - required int overlapChars, - }); - - Future - crateApiIngestSessionPrepareSourceIngestionFromUtf8({ - required String collectionId, - required List contentBytes, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, - }); + Future crateApiIngestSessionPrepareSourceIngestion( + {required String collectionId, + required String content, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}); + + Future crateApiIngestSessionPrepareSourceIngestionFromFile( + {required String collectionId, + required String filePath, + String? metadata, + String? name, + IngestStrategy? strategyHint, + required int maxChars, + required int overlapChars}); + + Future crateApiIngestSessionPrepareSourceIngestionFromUtf8( + {required String collectionId, + required List contentBytes, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}); QueryContentReadStats crateApiQueryMetricsQueryContentReadStats(); - Future crateApiQueryMetricsQueryContentReadStatsContentBytesTotal({ - required QueryContentReadStats that, - }); + Future crateApiQueryMetricsQueryContentReadStatsContentBytesTotal( + {required QueryContentReadStats that}); Future - crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal({ - required QueryContentReadStats that, - }); + crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal( + {required QueryContentReadStats that}); - Future crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal({ - required QueryContentReadStats that, - }); + Future crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal( + {required QueryContentReadStats that}); - Future crateApiQueryMetricsQueryContentReadStatsRowsTotal({ - required QueryContentReadStats that, - }); + Future crateApiQueryMetricsQueryContentReadStatsRowsTotal( + {required QueryContentReadStats that}); Future crateApiMigrationMetaReadMigrationAxes(); @@ -534,154 +446,125 @@ abstract class RustLibApi extends BaseApi { Future crateApiSourceRagRebuildChunkBm25Index(); - Future crateApiSourceRagRebuildChunkBm25IndexForCollection({ - required String collectionId, - }); + Future crateApiSourceRagRebuildChunkBm25IndexForCollection( + {required String collectionId}); Future crateApiSourceRagRebuildChunkHnswIndex(); - Future crateApiSourceRagRebuildChunkHnswIndexForCollection({ - required String collectionId, - }); + Future crateApiSourceRagRebuildChunkHnswIndexForCollection( + {required String collectionId}); Future crateApiSimpleRagRebuildHnswIndex(); + void crateApiActivationMetricsResetActivationTimingStats(); + void crateApiIngestMetricsResetIngestTrafficStats(); void crateApiQueryMetricsResetQueryContentReadStats(); Future crateApiHybridSearchRrfConfigDefault(); - Future crateApiSourceRagSaveCollectionHnswIndex({ - required String collectionId, - required String basePath, - }); + Future crateApiSourceRagSaveCollectionHnswIndex( + {required String collectionId, required String basePath}); Future crateApiHnswIndexSaveHnswIndex({required String basePath}); - Future> crateApiSourceRagSearchChunks({ - required List queryEmbedding, - required int topK, - }); + Future> crateApiSourceRagSearchChunks( + {required List queryEmbedding, required int topK}); - Future> crateApiSourceRagSearchChunksInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, - }); + Future> crateApiSourceRagSearchChunksInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}); - Future> crateApiHnswIndexSearchHnsw({ - required List queryEmbedding, - required BigInt topK, - }); + Future> crateApiHnswIndexSearchHnsw( + {required List queryEmbedding, required BigInt topK}); - Future> crateApiHnswIndexSearchHnswSlice({ - required List queryEmbedding, - required BigInt topK, - }); + Future> crateApiHnswIndexSearchHnswSlice( + {required List queryEmbedding, required BigInt topK}); - Future> crateApiHybridSearchSearchHybrid({ - required String queryText, - required List queryEmbedding, - required int topK, - RrfConfig? config, - SearchFilter? filter, - }); + Future> crateApiHybridSearchSearchHybrid( + {required String queryText, + required List queryEmbedding, + required int topK, + RrfConfig? config, + SearchFilter? filter}); - Future> crateApiHybridSearchSearchHybridSimple({ - required String queryText, - required List queryEmbedding, - required int topK, - }); + Future> crateApiHybridSearchSearchHybridSimple( + {required String queryText, + required List queryEmbedding, + required int topK}); - Future> crateApiHybridSearchSearchHybridWeighted({ - required String queryText, - required List queryEmbedding, - required int topK, - required double vectorWeight, - required double bm25Weight, - }); + Future> crateApiHybridSearchSearchHybridWeighted( + {required String queryText, + required List queryEmbedding, + required int topK, + required double vectorWeight, + required double bm25Weight}); - Future crateApiSourceRagSearchMetaHybrid({ - required String collectionId, - required String queryText, - required List queryEmbedding, - required SearchMetaHybridOptions options, - }); + Future crateApiSourceRagSearchMetaHybrid( + {required String collectionId, + required String queryText, + required List queryEmbedding, + required SearchMetaHybridOptions options}); - Future> crateApiSimpleRagSearchSimilar({ - required List queryEmbedding, - required int topK, - }); + Future> crateApiSimpleRagSearchSimilar( + {required List queryEmbedding, required int topK}); - List crateApiSemanticChunkerSemanticChunk({ - required String text, - required int maxChars, - }); + List crateApiSemanticChunkerSemanticChunk( + {required String text, required int maxChars}); - List crateApiSemanticChunkerSemanticChunkWithOverlap({ - required String text, - required int maxChars, - required int overlapChars, - }); + List crateApiSemanticChunkerSemanticChunkWithOverlap( + {required String text, required int maxChars, required int overlapChars}); - Future crateApiCompressionUtilsSentenceHash({ - required String sentence, - }); + Future crateApiCompressionUtilsSentenceHash( + {required String sentence}); - Future crateApiCompressionUtilsShouldCompress({ - required String text, - required int tokenThreshold, - }); + Future crateApiCompressionUtilsShouldCompress( + {required String text, required int tokenThreshold}); - Future> crateApiCompressionUtilsSplitSentences({ - required String text, - }); + Future> crateApiCompressionUtilsSplitSentences( + {required String text}); + + ActivationTimingStats crateApiActivationMetricsTakeActivationTimingStats(); QueryContentReadStats crateApiQueryMetricsTakeQueryContentReadStats(); Uint32List crateApiTokenizerTokenize({required String text}); - Future crateApiSourceRagUpdateChunkEmbedding({ - required PlatformInt64 chunkId, - required List embedding, - }); + Future crateApiSourceRagUpdateChunkEmbedding( + {required PlatformInt64 chunkId, required List embedding}); - Future crateApiSourceRagUpdateChunkReembedded({ - required PlatformInt64 chunkId, - required List embedding, - required String targetFingerprint, - }); + Future crateApiSourceRagUpdateChunkReembedded( + {required PlatformInt64 chunkId, + required List embedding, + required String targetFingerprint}); - Future crateApiSourceRagUpdateSourceStatus({ - required PlatformInt64 sourceId, - required String status, - }); + Future crateApiSourceRagUpdateSourceStatus( + {required PlatformInt64 sourceId, required String status}); Future crateApiUserIntentUserIntentGetQuery({required UserIntent that}); - Future crateApiUserIntentUserIntentIntentType({ - required UserIntent that, - }); + Future crateApiUserIntentUserIntentIntentType( + {required UserIntent that}); - Future crateApiMigrationMetaWriteEmbeddingFingerprint({ - required String fingerprint, - }); + Future crateApiMigrationMetaWriteEmbeddingFingerprint( + {required String fingerprint}); RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_IngestSession; + get rust_arc_increment_strong_count_IngestSession; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_IngestSession; + get rust_arc_decrement_strong_count_IngestSession; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_IngestSessionPtr; + get rust_arc_decrement_strong_count_IngestSessionPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_SearchHandle; + get rust_arc_increment_strong_count_SearchHandle; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_SearchHandle; + get rust_arc_decrement_strong_count_SearchHandle; CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_SearchHandlePtr; } @@ -695,142 +578,108 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { }); @override - Future crateApiIngestSessionIngestSessionAbort({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 1, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiIngestSessionIngestSessionAbortConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionAbort( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 1, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionAbortConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionAbortConstMeta => - const TaskConstMeta(debugName: "IngestSession_abort", argNames: ["that"]); + const TaskConstMeta( + debugName: "IngestSession_abort", + argNames: ["that"], + ); @override - Future crateApiIngestSessionIngestSessionCommitEmbeddings({ - required IngestSession that, - required List embeddings, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - sse_encode_list_chunk_embedding(embeddings, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 2, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiIngestSessionIngestSessionCommitEmbeddingsConstMeta, - argValues: [that, embeddings], - apiImpl: this, + Future crateApiIngestSessionIngestSessionCommitEmbeddings( + {required IngestSession that, required List embeddings}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + sse_encode_list_chunk_embedding(embeddings, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 2, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionCommitEmbeddingsConstMeta, + argValues: [that, embeddings], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionIngestSessionCommitEmbeddingsConstMeta => - const TaskConstMeta( - debugName: "IngestSession_commit_embeddings", - argNames: ["that", "embeddings"], - ); + get kCrateApiIngestSessionIngestSessionCommitEmbeddingsConstMeta => + const TaskConstMeta( + debugName: "IngestSession_commit_embeddings", + argNames: ["that", "embeddings"], + ); @override - Future crateApiIngestSessionIngestSessionCommittedCount({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 3, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestSessionIngestSessionCommittedCountConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionCommittedCount( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 3, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionCommittedCountConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionIngestSessionCommittedCountConstMeta => - const TaskConstMeta( - debugName: "IngestSession_committed_count", - argNames: ["that"], - ); + get kCrateApiIngestSessionIngestSessionCommittedCountConstMeta => + const TaskConstMeta( + debugName: "IngestSession_committed_count", + argNames: ["that"], + ); @override - Future crateApiIngestSessionIngestSessionDispose({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 4, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestSessionIngestSessionDisposeConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionDispose( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 4, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionDisposeConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionDisposeConstMeta => @@ -840,33 +689,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIngestSessionIngestSessionFinalize({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 5, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiIngestSessionIngestSessionFinalizeConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionFinalize( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 5, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionFinalizeConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionFinalizeConstMeta => @@ -876,33 +716,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIngestSessionIngestSessionInFlightCount({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 6, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestSessionIngestSessionInFlightCountConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionInFlightCount( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 6, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionInFlightCountConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionInFlightCountConstMeta => @@ -912,71 +743,53 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIngestSessionIngestSessionPendingDispatchCount({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 7, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: null, - ), - constMeta: - kCrateApiIngestSessionIngestSessionPendingDispatchCountConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionPendingDispatchCount( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 7, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: null, ), - ); + constMeta: + kCrateApiIngestSessionIngestSessionPendingDispatchCountConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionIngestSessionPendingDispatchCountConstMeta => - const TaskConstMeta( - debugName: "IngestSession_pending_dispatch_count", - argNames: ["that"], - ); + get kCrateApiIngestSessionIngestSessionPendingDispatchCountConstMeta => + const TaskConstMeta( + debugName: "IngestSession_pending_dispatch_count", + argNames: ["that"], + ); @override - Future crateApiIngestSessionIngestSessionSourceId({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 8, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_64, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestSessionIngestSessionSourceIdConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionSourceId( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 8, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_64, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionSourceIdConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionSourceIdConstMeta => @@ -987,108 +800,81 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> - crateApiIngestSessionIngestSessionTakeEmbeddingBatch({ - required IngestSession that, - required int batchSize, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - sse_encode_i_32(batchSize, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 9, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_embedding_request, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiIngestSessionIngestSessionTakeEmbeddingBatchConstMeta, - argValues: [that, batchSize], - apiImpl: this, - ), - ); + crateApiIngestSessionIngestSessionTakeEmbeddingBatch( + {required IngestSession that, required int batchSize}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + sse_encode_i_32(batchSize, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 9, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_embedding_request, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiIngestSessionIngestSessionTakeEmbeddingBatchConstMeta, + argValues: [that, batchSize], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionIngestSessionTakeEmbeddingBatchConstMeta => - const TaskConstMeta( - debugName: "IngestSession_take_embedding_batch", - argNames: ["that", "batchSize"], - ); + get kCrateApiIngestSessionIngestSessionTakeEmbeddingBatchConstMeta => + const TaskConstMeta( + debugName: "IngestSession_take_embedding_batch", + argNames: ["that", "batchSize"], + ); @override - Future crateApiIngestSessionIngestSessionTotal({ - required IngestSession that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 10, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestSessionIngestSessionTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestSessionIngestSessionTotal( + {required IngestSession that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 10, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestSessionIngestSessionTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionIngestSessionTotalConstMeta => - const TaskConstMeta(debugName: "IngestSession_total", argNames: ["that"]); + const TaskConstMeta( + debugName: "IngestSession_total", + argNames: ["that"], + ); @override - Future crateApiSourceRagSearchHandleAssembleContext({ - required SearchHandle that, - required AssembleContextOptions options, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - that, - serializer, - ); - sse_encode_box_autoadd_assemble_context_options(options, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 11, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_assembled_context_v_2, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchHandleAssembleContextConstMeta, - argValues: [that, options], - apiImpl: this, + Future crateApiSourceRagSearchHandleAssembleContext( + {required SearchHandle that, required AssembleContextOptions options}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + that, serializer); + sse_encode_box_autoadd_assemble_context_options(options, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 11, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_assembled_context_v_2, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagSearchHandleAssembleContextConstMeta, + argValues: [that, options], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchHandleAssembleContextConstMeta => @@ -1098,33 +884,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagSearchHandleDispose({ - required SearchHandle that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 12, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiSourceRagSearchHandleDisposeConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiSourceRagSearchHandleDispose( + {required SearchHandle that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 12, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSourceRagSearchHandleDisposeConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchHandleDisposeConstMeta => @@ -1135,37 +912,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> - crateApiSourceRagSearchHandleGetChunkExcerpts({ - required SearchHandle that, - required Int64List chunkIds, - required int maxBytes, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - that, - serializer, - ); - sse_encode_list_prim_i_64_strict(chunkIds, serializer); - sse_encode_u_32(maxBytes, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 13, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_excerpt_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchHandleGetChunkExcerptsConstMeta, - argValues: [that, chunkIds, maxBytes], - apiImpl: this, - ), - ); + crateApiSourceRagSearchHandleGetChunkExcerpts( + {required SearchHandle that, + required Int64List chunkIds, + required int maxBytes}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + that, serializer); + sse_encode_list_prim_i_64_strict(chunkIds, serializer); + sse_encode_u_32(maxBytes, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 13, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_excerpt_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagSearchHandleGetChunkExcerptsConstMeta, + argValues: [that, chunkIds, maxBytes], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchHandleGetChunkExcerptsConstMeta => @@ -1175,33 +943,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSourceRagSearchHandleHitMeta({ - required SearchHandle that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - that, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 14, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_search_hit_meta, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchHandleHitMetaConstMeta, - argValues: [that], - apiImpl: this, + Future> crateApiSourceRagSearchHandleHitMeta( + {required SearchHandle that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 14, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_search_hit_meta, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagSearchHandleHitMetaConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchHandleHitMetaConstMeta => @@ -1211,35 +970,25 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSourceRagSearchHandleHydrateChunks({ - required SearchHandle that, - required Int64List chunkIds, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - that, - serializer, - ); - sse_encode_list_prim_i_64_strict(chunkIds, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 15, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchHandleHydrateChunksConstMeta, - argValues: [that, chunkIds], - apiImpl: this, + Future> crateApiSourceRagSearchHandleHydrateChunks( + {required SearchHandle that, required Int64List chunkIds}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + that, serializer); + sse_encode_list_prim_i_64_strict(chunkIds, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 15, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_search_result, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagSearchHandleHydrateChunksConstMeta, + argValues: [that, chunkIds], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchHandleHydrateChunksConstMeta => @@ -1249,138 +998,129 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiMigrationMetaAcknowledgeAndClearEmbeddings({ - required String confirmation, - required String newFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(confirmation, serializer); - sse_encode_String(newFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 16, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_64, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaAcknowledgeAndClearEmbeddingsConstMeta, - argValues: [confirmation, newFingerprint], - apiImpl: this, + Future crateApiMigrationMetaAcknowledgeAndClearEmbeddings( + {required String confirmation, required String newFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(confirmation, serializer); + sse_encode_String(newFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 16, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_64, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiMigrationMetaAcknowledgeAndClearEmbeddingsConstMeta, + argValues: [confirmation, newFingerprint], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiMigrationMetaAcknowledgeAndClearEmbeddingsConstMeta => - const TaskConstMeta( - debugName: "acknowledge_and_clear_embeddings", - argNames: ["confirmation", "newFingerprint"], - ); + get kCrateApiMigrationMetaAcknowledgeAndClearEmbeddingsConstMeta => + const TaskConstMeta( + debugName: "acknowledge_and_clear_embeddings", + argNames: ["confirmation", "newFingerprint"], + ); @override - Future crateApiSourceRagActivateCollectionForHybridSearch({ - required String collectionId, - required String basePath, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(basePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 17, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagActivateCollectionForHybridSearchConstMeta, - argValues: [collectionId, basePath], - apiImpl: this, + Future crateApiSourceRagActivateCollectionForHybridSearch( + {required String collectionId, required String basePath}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(basePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 17, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagActivateCollectionForHybridSearchConstMeta, + argValues: [collectionId, basePath], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiSourceRagActivateCollectionForHybridSearchConstMeta => + get kCrateApiSourceRagActivateCollectionForHybridSearchConstMeta => + const TaskConstMeta( + debugName: "activate_collection_for_hybrid_search", + argNames: ["collectionId", "basePath"], + ); + + @override + ActivationTimingStats crateApiActivationMetricsActivationTimingStats() { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 18)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_activation_timing_stats, + decodeErrorData: null, + ), + constMeta: kCrateApiActivationMetricsActivationTimingStatsConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiActivationMetricsActivationTimingStatsConstMeta => const TaskConstMeta( - debugName: "activate_collection_for_hybrid_search", - argNames: ["collectionId", "basePath"], + debugName: "activation_timing_stats", + argNames: [], ); @override - Future crateApiSourceRagAddChunks({ - required PlatformInt64 sourceId, - required List chunks, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - sse_encode_list_chunk_data(chunks, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 18, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagAddChunksConstMeta, - argValues: [sourceId, chunks], - apiImpl: this, + Future crateApiSourceRagAddChunks( + {required PlatformInt64 sourceId, required List chunks}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + sse_encode_list_chunk_data(chunks, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 19, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagAddChunksConstMeta, + argValues: [sourceId, chunks], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagAddChunksConstMeta => const TaskConstMeta( - debugName: "add_chunks", - argNames: ["sourceId", "chunks"], - ); + debugName: "add_chunks", + argNames: ["sourceId", "chunks"], + ); @override - Future crateApiSimpleRagAddDocument({ - required String content, - required List embedding, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(content, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 19, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_add_document_result, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagAddDocumentConstMeta, - argValues: [content, embedding], - apiImpl: this, + Future crateApiSimpleRagAddDocument( + {required String content, required List embedding}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(content, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 20, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_add_document_result, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiSimpleRagAddDocumentConstMeta, + argValues: [content, embedding], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagAddDocumentConstMeta => @@ -1390,32 +1130,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSimpleRagAddDocumentSimple({ - required String content, - required List embedding, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(content, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 20, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagAddDocumentSimpleConstMeta, - argValues: [content, embedding], - apiImpl: this, + Future crateApiSimpleRagAddDocumentSimple( + {required String content, required List embedding}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(content, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 21, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiSimpleRagAddDocumentSimpleConstMeta, + argValues: [content, embedding], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagAddDocumentSimpleConstMeta => @@ -1425,72 +1157,56 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagAddSource({ - required String content, - String? metadata, - String? name, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(content, serializer); - sse_encode_opt_String(metadata, serializer); - sse_encode_opt_String(name, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 21, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_add_source_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagAddSourceConstMeta, - argValues: [content, metadata, name], - apiImpl: this, + Future crateApiSourceRagAddSource( + {required String content, String? metadata, String? name}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(content, serializer); + sse_encode_opt_String(metadata, serializer); + sse_encode_opt_String(name, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 22, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_add_source_result, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagAddSourceConstMeta, + argValues: [content, metadata, name], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagAddSourceConstMeta => const TaskConstMeta( - debugName: "add_source", - argNames: ["content", "metadata", "name"], - ); + debugName: "add_source", + argNames: ["content", "metadata", "name"], + ); @override - Future crateApiSourceRagAddSourceInCollection({ - required String collectionId, - required String content, - String? metadata, - String? name, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(content, serializer); - sse_encode_opt_String(metadata, serializer); - sse_encode_opt_String(name, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 22, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_add_source_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagAddSourceInCollectionConstMeta, - argValues: [collectionId, content, metadata, name], - apiImpl: this, - ), - ); + Future crateApiSourceRagAddSourceInCollection( + {required String collectionId, + required String content, + String? metadata, + String? name}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(content, serializer); + sse_encode_opt_String(metadata, serializer); + sse_encode_opt_String(name, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 23, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_add_source_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagAddSourceInCollectionConstMeta, + argValues: [collectionId, content, metadata, name], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagAddSourceInCollectionConstMeta => @@ -1500,30 +1216,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiMigrationMetaBeginEmbeddingReembed({ - required String targetFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(targetFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 23, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_64, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaBeginEmbeddingReembedConstMeta, - argValues: [targetFingerprint], - apiImpl: this, + Future crateApiMigrationMetaBeginEmbeddingReembed( + {required String targetFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(targetFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 24, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_64, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiMigrationMetaBeginEmbeddingReembedConstMeta, + argValues: [targetFingerprint], + apiImpl: this, + )); } TaskConstMeta get kCrateApiMigrationMetaBeginEmbeddingReembedConstMeta => @@ -1534,71 +1243,56 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> - crateApiSourceRagBenchmarkSearchChunksLinearInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 24, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiSourceRagBenchmarkSearchChunksLinearInCollectionConstMeta, - argValues: [collectionId, queryEmbedding, topK], - apiImpl: this, - ), - ); + crateApiSourceRagBenchmarkSearchChunksLinearInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 25, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_search_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: + kCrateApiSourceRagBenchmarkSearchChunksLinearInCollectionConstMeta, + argValues: [collectionId, queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiSourceRagBenchmarkSearchChunksLinearInCollectionConstMeta => - const TaskConstMeta( - debugName: "benchmark_search_chunks_linear_in_collection", - argNames: ["collectionId", "queryEmbedding", "topK"], - ); + get kCrateApiSourceRagBenchmarkSearchChunksLinearInCollectionConstMeta => + const TaskConstMeta( + debugName: "benchmark_search_chunks_linear_in_collection", + argNames: ["collectionId", "queryEmbedding", "topK"], + ); @override - Future> crateApiSimpleRagBenchmarkSearchLinearScan({ - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 25, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagBenchmarkSearchLinearScanConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, + Future> crateApiSimpleRagBenchmarkSearchLinearScan( + {required List queryEmbedding, required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 26, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiSimpleRagBenchmarkSearchLinearScanConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagBenchmarkSearchLinearScanConstMeta => @@ -1608,32 +1302,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiBm25SearchBm25AddDocument({ - required PlatformInt64 docId, - required String content, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(docId, serializer); - sse_encode_String(content, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 26, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25AddDocumentConstMeta, - argValues: [docId, content], - apiImpl: this, + Future crateApiBm25SearchBm25AddDocument( + {required PlatformInt64 docId, required String content}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(docId, serializer); + sse_encode_String(content, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 27, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiBm25SearchBm25AddDocumentConstMeta, + argValues: [docId, content], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25AddDocumentConstMeta => @@ -1643,114 +1329,97 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiBm25SearchBm25AddDocuments({ - required List<(PlatformInt64, String)> docs, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_record_i_64_string(docs, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 27, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25AddDocumentsConstMeta, - argValues: [docs], - apiImpl: this, + Future crateApiBm25SearchBm25AddDocuments( + {required List<(PlatformInt64, String)> docs}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_record_i_64_string(docs, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 28, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiBm25SearchBm25AddDocumentsConstMeta, + argValues: [docs], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25AddDocumentsConstMeta => - const TaskConstMeta(debugName: "bm25_add_documents", argNames: ["docs"]); + const TaskConstMeta( + debugName: "bm25_add_documents", + argNames: ["docs"], + ); @override Future crateApiBm25SearchBm25ClearIndex() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 28, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25ClearIndexConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 29, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiBm25SearchBm25ClearIndexConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25ClearIndexConstMeta => - const TaskConstMeta(debugName: "bm25_clear_index", argNames: []); + const TaskConstMeta( + debugName: "bm25_clear_index", + argNames: [], + ); @override Future crateApiBm25SearchBm25GetDocumentCount() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 29, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_usize, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25GetDocumentCountConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 30, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_usize, + decodeErrorData: null, + ), + constMeta: kCrateApiBm25SearchBm25GetDocumentCountConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25GetDocumentCountConstMeta => - const TaskConstMeta(debugName: "bm25_get_document_count", argNames: []); + const TaskConstMeta( + debugName: "bm25_get_document_count", + argNames: [], + ); @override - Future crateApiBm25SearchBm25RemoveDocument({ - required PlatformInt64 docId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(docId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 30, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25RemoveDocumentConstMeta, - argValues: [docId], - apiImpl: this, + Future crateApiBm25SearchBm25RemoveDocument( + {required PlatformInt64 docId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(docId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 31, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiBm25SearchBm25RemoveDocumentConstMeta, + argValues: [docId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25RemoveDocumentConstMeta => @@ -1760,32 +1429,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiBm25SearchBm25Search({ - required String query, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(query, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 31, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_bm_25_search_result, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchBm25SearchConstMeta, - argValues: [query, topK], - apiImpl: this, + Future> crateApiBm25SearchBm25Search( + {required String query, required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(query, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 32, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_bm_25_search_result, + decodeErrorData: null, ), - ); + constMeta: kCrateApiBm25SearchBm25SearchConstMeta, + argValues: [query, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchBm25SearchConstMeta => @@ -1795,57 +1456,49 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiHnswIndexBuildHnswIndex({ - required List<(PlatformInt64, Float32List)> points, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_record_i_64_list_prim_f_32_strict(points, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 32, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiHnswIndexBuildHnswIndexConstMeta, - argValues: [points], - apiImpl: this, + Future crateApiHnswIndexBuildHnswIndex( + {required List<(PlatformInt64, Float32List)> points}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_record_i_64_list_prim_f_32_strict(points, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 33, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiHnswIndexBuildHnswIndexConstMeta, + argValues: [points], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexBuildHnswIndexConstMeta => - const TaskConstMeta(debugName: "build_hnsw_index", argNames: ["points"]); + const TaskConstMeta( + debugName: "build_hnsw_index", + argNames: ["points"], + ); @override - double crateApiSimpleRagCalculateCosineSimilarity({ - required List vecA, - required List vecB, - }) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(vecA, serializer); - sse_encode_list_prim_f_32_loose(vecB, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 33)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_f_64, - decodeErrorData: null, - ), - constMeta: kCrateApiSimpleRagCalculateCosineSimilarityConstMeta, - argValues: [vecA, vecB], - apiImpl: this, + double crateApiSimpleRagCalculateCosineSimilarity( + {required List vecA, required List vecB}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(vecA, serializer); + sse_encode_list_prim_f_32_loose(vecB, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 34)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_f_64, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSimpleRagCalculateCosineSimilarityConstMeta, + argValues: [vecA, vecB], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagCalculateCosineSimilarityConstMeta => @@ -1855,90 +1508,75 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSemanticChunkerChunkTypeAsStr({ - required ChunkType that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_chunk_type(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 34, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerChunkTypeAsStrConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiSemanticChunkerChunkTypeAsStr( + {required ChunkType that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_chunk_type(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 35, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSemanticChunkerChunkTypeAsStrConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerChunkTypeAsStrConstMeta => - const TaskConstMeta(debugName: "chunk_type_as_str", argNames: ["that"]); + const TaskConstMeta( + debugName: "chunk_type_as_str", + argNames: ["that"], + ); @override - Future crateApiSemanticChunkerChunkTypeFromStr({ - required String s, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(s, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 35, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_chunk_type, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerChunkTypeFromStrConstMeta, - argValues: [s], - apiImpl: this, + Future crateApiSemanticChunkerChunkTypeFromStr( + {required String s}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(s, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 36, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_chunk_type, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSemanticChunkerChunkTypeFromStrConstMeta, + argValues: [s], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerChunkTypeFromStrConstMeta => - const TaskConstMeta(debugName: "chunk_type_from_str", argNames: ["s"]); + const TaskConstMeta( + debugName: "chunk_type_from_str", + argNames: ["s"], + ); @override - Future crateApiSourceRagClaimSourceForIngestion({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 36, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagClaimSourceForIngestionConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagClaimSourceForIngestion( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 37, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagClaimSourceForIngestionConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagClaimSourceForIngestionConstMeta => @@ -1949,133 +1587,118 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override ChunkType crateApiSemanticChunkerClassifyChunk({required String text}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 37)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_chunk_type, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerClassifyChunkConstMeta, - argValues: [text], - apiImpl: this, - ), - ); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 38)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_chunk_type, + decodeErrorData: null, + ), + constMeta: kCrateApiSemanticChunkerClassifyChunkConstMeta, + argValues: [text], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerClassifyChunkConstMeta => - const TaskConstMeta(debugName: "classify_chunk", argNames: ["text"]); + const TaskConstMeta( + debugName: "classify_chunk", + argNames: ["text"], + ); @override Future crateApiSimpleRagClearAllDocuments() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 38, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagClearAllDocumentsConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 39, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiSimpleRagClearAllDocumentsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagClearAllDocumentsConstMeta => - const TaskConstMeta(debugName: "clear_all_documents", argNames: []); + const TaskConstMeta( + debugName: "clear_all_documents", + argNames: [], + ); @override Future crateApiIncrementalIndexClearBuffer() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 39, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexClearBufferConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 40, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiIncrementalIndexClearBufferConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexClearBufferConstMeta => - const TaskConstMeta(debugName: "clear_buffer", argNames: []); + const TaskConstMeta( + debugName: "clear_buffer", + argNames: [], + ); @override Future crateApiHnswIndexClearHnswIndex() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 40, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiHnswIndexClearHnswIndexConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 41, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiHnswIndexClearHnswIndexConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexClearHnswIndexConstMeta => - const TaskConstMeta(debugName: "clear_hnsw_index", argNames: []); + const TaskConstMeta( + debugName: "clear_hnsw_index", + argNames: [], + ); @override - Future crateApiSourceRagClearSourceChunks({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 41, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagClearSourceChunksConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagClearSourceChunks( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 42, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagClearSourceChunksConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagClearSourceChunksConstMeta => @@ -2086,82 +1709,72 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiDbPoolCloseDbPool() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 42, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiDbPoolCloseDbPoolConstMeta, - argValues: [], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiDbPoolCloseDbPoolConstMeta => - const TaskConstMeta(debugName: "close_db_pool", argNames: []); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 43, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiDbPoolCloseDbPoolConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiDbPoolCloseDbPoolConstMeta => const TaskConstMeta( + debugName: "close_db_pool", + argNames: [], + ); @override void crateApiLoggerCloseLogStream() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 43)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiLoggerCloseLogStreamConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 44)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiLoggerCloseLogStreamConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiLoggerCloseLogStreamConstMeta => - const TaskConstMeta(debugName: "close_log_stream", argNames: []); + const TaskConstMeta( + debugName: "close_log_stream", + argNames: [], + ); @override - Future crateApiCompressionUtilsCompressText({ - required String text, - required int maxChars, - required CompressionOptions options, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(maxChars, serializer); - sse_encode_box_autoadd_compression_options(options, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 44, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_compressed_text, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsCompressTextConstMeta, - argValues: [text, maxChars, options], - apiImpl: this, - ), - ); + Future crateApiCompressionUtilsCompressText( + {required String text, + required int maxChars, + required CompressionOptions options}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(maxChars, serializer); + sse_encode_box_autoadd_compression_options(options, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 45, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_compressed_text, + decodeErrorData: null, + ), + constMeta: kCrateApiCompressionUtilsCompressTextConstMeta, + argValues: [text, maxChars, options], + apiImpl: this, + )); } TaskConstMeta get kCrateApiCompressionUtilsCompressTextConstMeta => @@ -2171,32 +1784,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiCompressionUtilsCompressTextSimple({ - required String text, - required int level, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(level, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 45, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsCompressTextSimpleConstMeta, - argValues: [text, level], - apiImpl: this, + Future crateApiCompressionUtilsCompressTextSimple( + {required String text, required int level}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(level, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 46, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: null, ), - ); + constMeta: kCrateApiCompressionUtilsCompressTextSimpleConstMeta, + argValues: [text, level], + apiImpl: this, + )); } TaskConstMeta get kCrateApiCompressionUtilsCompressTextSimpleConstMeta => @@ -2207,61 +1812,48 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future - crateApiCompressionUtilsCompressionOptionsDefault() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 46, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_compression_options, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsCompressionOptionsDefaultConstMeta, - argValues: [], - apiImpl: this, - ), - ); + crateApiCompressionUtilsCompressionOptionsDefault() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 47, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_compression_options, + decodeErrorData: null, + ), + constMeta: kCrateApiCompressionUtilsCompressionOptionsDefaultConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiCompressionUtilsCompressionOptionsDefaultConstMeta => - const TaskConstMeta( - debugName: "compression_options_default", - argNames: [], - ); + get kCrateApiCompressionUtilsCompressionOptionsDefaultConstMeta => + const TaskConstMeta( + debugName: "compression_options_default", + argNames: [], + ); @override - Future crateApiMigrationMetaCountChunksNeedingReembed({ - required String targetFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(targetFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 47, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_64, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaCountChunksNeedingReembedConstMeta, - argValues: [targetFingerprint], - apiImpl: this, + Future crateApiMigrationMetaCountChunksNeedingReembed( + {required String targetFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(targetFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 48, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_64, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiMigrationMetaCountChunksNeedingReembedConstMeta, + argValues: [targetFingerprint], + apiImpl: this, + )); } TaskConstMeta get kCrateApiMigrationMetaCountChunksNeedingReembedConstMeta => @@ -2272,107 +1864,97 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override int crateApiTokenizerCountTokens({required String text}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 48)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_32, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiTokenizerCountTokensConstMeta, - argValues: [text], - apiImpl: this, - ), - ); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 49)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_32, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiTokenizerCountTokensConstMeta, + argValues: [text], + apiImpl: this, + )); } TaskConstMeta get kCrateApiTokenizerCountTokensConstMeta => - const TaskConstMeta(debugName: "count_tokens", argNames: ["text"]); + const TaskConstMeta( + debugName: "count_tokens", + argNames: ["text"], + ); @override String crateApiTokenizerDecodeTokens({required List tokenIds}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_u_32_loose(tokenIds, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 49)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiTokenizerDecodeTokensConstMeta, - argValues: [tokenIds], - apiImpl: this, - ), - ); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_u_32_loose(tokenIds, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 50)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiTokenizerDecodeTokensConstMeta, + argValues: [tokenIds], + apiImpl: this, + )); } TaskConstMeta get kCrateApiTokenizerDecodeTokensConstMeta => - const TaskConstMeta(debugName: "decode_tokens", argNames: ["tokenIds"]); + const TaskConstMeta( + debugName: "decode_tokens", + argNames: ["tokenIds"], + ); @override - Future crateApiSourceRagDeleteSource({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 50, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagDeleteSourceConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagDeleteSource( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 51, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagDeleteSourceConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagDeleteSourceConstMeta => - const TaskConstMeta(debugName: "delete_source", argNames: ["sourceId"]); + const TaskConstMeta( + debugName: "delete_source", + argNames: ["sourceId"], + ); @override - Future crateApiSourceRagDeleteSourceInCollection({ - required String collectionId, - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 51, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagDeleteSourceInCollectionConstMeta, - argValues: [collectionId, sourceId], - apiImpl: this, + Future crateApiSourceRagDeleteSourceInCollection( + {required String collectionId, required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 52, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagDeleteSourceInCollectionConstMeta, + argValues: [collectionId, sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagDeleteSourceInCollectionConstMeta => @@ -2382,50 +1964,40 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagDeriveContextBudgetForPromptV2({ - required int fullPromptBudget, - required String query, - String? systemInstruction, - required bool useStrictMode, - required int safetyMarginTokens, - int? fixedPromptOverheadTokens, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_u_32(fullPromptBudget, serializer); - sse_encode_String(query, serializer); - sse_encode_opt_String(systemInstruction, serializer); - sse_encode_bool(useStrictMode, serializer); - sse_encode_u_32(safetyMarginTokens, serializer); - sse_encode_opt_box_autoadd_u_32( - fixedPromptOverheadTokens, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 52, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_32, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagDeriveContextBudgetForPromptV2ConstMeta, - argValues: [ - fullPromptBudget, - query, - systemInstruction, - useStrictMode, - safetyMarginTokens, - fixedPromptOverheadTokens, - ], - apiImpl: this, - ), - ); + Future crateApiSourceRagDeriveContextBudgetForPromptV2( + {required int fullPromptBudget, + required String query, + String? systemInstruction, + required bool useStrictMode, + required int safetyMarginTokens, + int? fixedPromptOverheadTokens}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_u_32(fullPromptBudget, serializer); + sse_encode_String(query, serializer); + sse_encode_opt_String(systemInstruction, serializer); + sse_encode_bool(useStrictMode, serializer); + sse_encode_u_32(safetyMarginTokens, serializer); + sse_encode_opt_box_autoadd_u_32(fixedPromptOverheadTokens, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 53, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_32, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagDeriveContextBudgetForPromptV2ConstMeta, + argValues: [ + fullPromptBudget, + query, + systemInstruction, + useStrictMode, + safetyMarginTokens, + fixedPromptOverheadTokens + ], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagDeriveContextBudgetForPromptV2ConstMeta => @@ -2437,73 +2009,57 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { "systemInstruction", "useStrictMode", "safetyMarginTokens", - "fixedPromptOverheadTokens", + "fixedPromptOverheadTokens" ], ); @override Future - crateApiMigrationMetaDetectEmbeddingFingerprintGate({ - required String currentFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(currentFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 53, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_embedding_fingerprint_gate, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiMigrationMetaDetectEmbeddingFingerprintGateConstMeta, - argValues: [currentFingerprint], - apiImpl: this, - ), - ); + crateApiMigrationMetaDetectEmbeddingFingerprintGate( + {required String currentFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(currentFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 54, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_embedding_fingerprint_gate, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiMigrationMetaDetectEmbeddingFingerprintGateConstMeta, + argValues: [currentFingerprint], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiMigrationMetaDetectEmbeddingFingerprintGateConstMeta => - const TaskConstMeta( - debugName: "detect_embedding_fingerprint_gate", - argNames: ["currentFingerprint"], - ); + get kCrateApiMigrationMetaDetectEmbeddingFingerprintGateConstMeta => + const TaskConstMeta( + debugName: "detect_embedding_fingerprint_gate", + argNames: ["currentFingerprint"], + ); @override - Future crateApiHnswIndexEmbeddingPointNew({ - required PlatformInt64 id, - required List embedding, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(id, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 54, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_embedding_point, - decodeErrorData: null, - ), - constMeta: kCrateApiHnswIndexEmbeddingPointNewConstMeta, - argValues: [id, embedding], - apiImpl: this, + Future crateApiHnswIndexEmbeddingPointNew( + {required PlatformInt64 id, required List embedding}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(id, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 55, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_embedding_point, + decodeErrorData: null, ), - ); + constMeta: kCrateApiHnswIndexEmbeddingPointNewConstMeta, + argValues: [id, embedding], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexEmbeddingPointNewConstMeta => @@ -2513,30 +2069,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiDocumentParserExtractTextFromDocument({ - required List fileBytes, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_u_8_loose(fileBytes, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 55, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDocumentParserExtractTextFromDocumentConstMeta, - argValues: [fileBytes], - apiImpl: this, + Future crateApiDocumentParserExtractTextFromDocument( + {required List fileBytes}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_u_8_loose(fileBytes, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 56, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDocumentParserExtractTextFromDocumentConstMeta, + argValues: [fileBytes], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDocumentParserExtractTextFromDocumentConstMeta => @@ -2546,30 +2095,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiDocumentParserExtractTextFromDocx({ - required List fileBytes, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_u_8_loose(fileBytes, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 56, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDocumentParserExtractTextFromDocxConstMeta, - argValues: [fileBytes], - apiImpl: this, + Future crateApiDocumentParserExtractTextFromDocx( + {required List fileBytes}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_u_8_loose(fileBytes, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 57, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDocumentParserExtractTextFromDocxConstMeta, + argValues: [fileBytes], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDocumentParserExtractTextFromDocxConstMeta => @@ -2579,30 +2121,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiDocumentParserExtractTextFromFile({ - required String filePath, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(filePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 57, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDocumentParserExtractTextFromFileConstMeta, - argValues: [filePath], - apiImpl: this, + Future crateApiDocumentParserExtractTextFromFile( + {required String filePath}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(filePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 58, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDocumentParserExtractTextFromFileConstMeta, + argValues: [filePath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDocumentParserExtractTextFromFileConstMeta => @@ -2612,30 +2147,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiDocumentParserExtractTextFromPdf({ - required List fileBytes, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_u_8_loose(fileBytes, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 58, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDocumentParserExtractTextFromPdfConstMeta, - argValues: [fileBytes], - apiImpl: this, + Future crateApiDocumentParserExtractTextFromPdf( + {required List fileBytes}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_u_8_loose(fileBytes, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 59, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDocumentParserExtractTextFromPdfConstMeta, + argValues: [fileBytes], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDocumentParserExtractTextFromPdfConstMeta => @@ -2645,30 +2173,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiDocumentParserExtractTextFromUtf8({ - required List fileBytes, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_u_8_loose(fileBytes, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 59, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDocumentParserExtractTextFromUtf8ConstMeta, - argValues: [fileBytes], - apiImpl: this, + Future crateApiDocumentParserExtractTextFromUtf8( + {required List fileBytes}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_u_8_loose(fileBytes, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 60, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDocumentParserExtractTextFromUtf8ConstMeta, + argValues: [fileBytes], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDocumentParserExtractTextFromUtf8ConstMeta => @@ -2678,30 +2199,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiMigrationMetaFinalizeEmbeddingReembed({ - required String targetFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(targetFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 60, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaFinalizeEmbeddingReembedConstMeta, - argValues: [targetFingerprint], - apiImpl: this, + Future crateApiMigrationMetaFinalizeEmbeddingReembed( + {required String targetFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(targetFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 61, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiMigrationMetaFinalizeEmbeddingReembedConstMeta, + argValues: [targetFingerprint], + apiImpl: this, + )); } TaskConstMeta get kCrateApiMigrationMetaFinalizeEmbeddingReembedConstMeta => @@ -2711,34 +2225,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSourceRagGetAdjacentChunks({ - required PlatformInt64 sourceId, - required int minIndex, - required int maxIndex, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - sse_encode_i_32(minIndex, serializer); - sse_encode_i_32(maxIndex, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 61, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetAdjacentChunksConstMeta, - argValues: [sourceId, minIndex, maxIndex], - apiImpl: this, - ), - ); + Future> crateApiSourceRagGetAdjacentChunks( + {required PlatformInt64 sourceId, + required int minIndex, + required int maxIndex}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + sse_encode_i_32(minIndex, serializer); + sse_encode_i_32(maxIndex, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 62, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_search_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagGetAdjacentChunksConstMeta, + argValues: [sourceId, minIndex, maxIndex], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetAdjacentChunksConstMeta => @@ -2749,27 +2256,21 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> - crateApiSourceRagGetAllChunkIdsAndContents() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 62, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_for_reembedding, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetAllChunkIdsAndContentsConstMeta, - argValues: [], - apiImpl: this, - ), - ); + crateApiSourceRagGetAllChunkIdsAndContents() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 63, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_for_reembedding, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagGetAllChunkIdsAndContentsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetAllChunkIdsAndContentsConstMeta => @@ -2780,204 +2281,172 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> - crateApiSourceRagGetAllChunkIdsAndContentsInCollection({ - required String collectionId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 63, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_for_reembedding, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiSourceRagGetAllChunkIdsAndContentsInCollectionConstMeta, - argValues: [collectionId], - apiImpl: this, - ), - ); + crateApiSourceRagGetAllChunkIdsAndContentsInCollection( + {required String collectionId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 64, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_for_reembedding, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: + kCrateApiSourceRagGetAllChunkIdsAndContentsInCollectionConstMeta, + argValues: [collectionId], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiSourceRagGetAllChunkIdsAndContentsInCollectionConstMeta => - const TaskConstMeta( - debugName: "get_all_chunk_ids_and_contents_in_collection", - argNames: ["collectionId"], - ); + get kCrateApiSourceRagGetAllChunkIdsAndContentsInCollectionConstMeta => + const TaskConstMeta( + debugName: "get_all_chunk_ids_and_contents_in_collection", + argNames: ["collectionId"], + ); @override Future> - crateApiIncrementalIndexGetBufferForMerge() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 64, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_record_i_64_list_prim_f_32_strict, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexGetBufferForMergeConstMeta, - argValues: [], - apiImpl: this, - ), - ); + crateApiIncrementalIndexGetBufferForMerge() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 65, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_record_i_64_list_prim_f_32_strict, + decodeErrorData: null, + ), + constMeta: kCrateApiIncrementalIndexGetBufferForMergeConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexGetBufferForMergeConstMeta => - const TaskConstMeta(debugName: "get_buffer_for_merge", argNames: []); + const TaskConstMeta( + debugName: "get_buffer_for_merge", + argNames: [], + ); @override Future crateApiIncrementalIndexGetBufferStats() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 65, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_buffer_stats, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexGetBufferStatsConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 66, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_buffer_stats, + decodeErrorData: null, + ), + constMeta: kCrateApiIncrementalIndexGetBufferStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexGetBufferStatsConstMeta => - const TaskConstMeta(debugName: "get_buffer_stats", argNames: []); + const TaskConstMeta( + debugName: "get_buffer_stats", + argNames: [], + ); @override Future crateApiSimpleRagGetDocumentCount() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 66, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_64, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagGetDocumentCountConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 67, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_64, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiSimpleRagGetDocumentCountConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagGetDocumentCountConstMeta => - const TaskConstMeta(debugName: "get_document_count", argNames: []); + const TaskConstMeta( + debugName: "get_document_count", + argNames: [], + ); @override Future<(int, int, int)?> crateApiDbPoolGetPoolStats() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 67, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_opt_box_autoadd_record_u_32_u_32_u_32, - decodeErrorData: null, - ), - constMeta: kCrateApiDbPoolGetPoolStatsConstMeta, - argValues: [], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiDbPoolGetPoolStatsConstMeta => - const TaskConstMeta(debugName: "get_pool_stats", argNames: []); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 68, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_opt_box_autoadd_record_u_32_u_32_u_32, + decodeErrorData: null, + ), + constMeta: kCrateApiDbPoolGetPoolStatsConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiDbPoolGetPoolStatsConstMeta => const TaskConstMeta( + debugName: "get_pool_stats", + argNames: [], + ); @override - Future crateApiSourceRagGetSource({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 68, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_opt_String, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagGetSource( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 69, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_opt_String, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagGetSourceConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } - TaskConstMeta get kCrateApiSourceRagGetSourceConstMeta => - const TaskConstMeta(debugName: "get_source", argNames: ["sourceId"]); + TaskConstMeta get kCrateApiSourceRagGetSourceConstMeta => const TaskConstMeta( + debugName: "get_source", + argNames: ["sourceId"], + ); @override - Future crateApiSourceRagGetSourceChunkCount({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 69, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_i_32, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceChunkCountConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagGetSourceChunkCount( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 70, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_i_32, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagGetSourceChunkCountConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetSourceChunkCountConstMeta => @@ -2987,30 +2456,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSourceRagGetSourceChunks({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 70, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_String, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceChunksConstMeta, - argValues: [sourceId], - apiImpl: this, + Future> crateApiSourceRagGetSourceChunks( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 71, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_String, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagGetSourceChunksConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetSourceChunksConstMeta => @@ -3021,56 +2483,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiSourceRagGetSourceStats() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 71, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_source_stats, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceStatsConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 72, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_source_stats, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagGetSourceStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetSourceStatsConstMeta => - const TaskConstMeta(debugName: "get_source_stats", argNames: []); + const TaskConstMeta( + debugName: "get_source_stats", + argNames: [], + ); @override - Future crateApiSourceRagGetSourceStatsInCollection({ - required String collectionId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 72, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_source_stats, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceStatsInCollectionConstMeta, - argValues: [collectionId], - apiImpl: this, + Future crateApiSourceRagGetSourceStatsInCollection( + {required String collectionId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 73, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_source_stats, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagGetSourceStatsInCollectionConstMeta, + argValues: [collectionId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetSourceStatsInCollectionConstMeta => @@ -3080,30 +2532,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagGetSourceStatus({ - required PlatformInt64 sourceId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 73, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_opt_String, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagGetSourceStatusConstMeta, - argValues: [sourceId], - apiImpl: this, + Future crateApiSourceRagGetSourceStatus( + {required PlatformInt64 sourceId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 74, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_opt_String, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagGetSourceStatusConstMeta, + argValues: [sourceId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagGetSourceStatusConstMeta => @@ -3114,76 +2559,69 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override int crateApiTokenizerGetVocabSize() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 74)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_32, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiTokenizerGetVocabSizeConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 75)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_32, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiTokenizerGetVocabSizeConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiTokenizerGetVocabSizeConstMeta => - const TaskConstMeta(debugName: "get_vocab_size", argNames: []); + const TaskConstMeta( + debugName: "get_vocab_size", + argNames: [], + ); @override String crateApiSimpleGreet({required String name}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(name, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 75)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_String, - decodeErrorData: null, - ), - constMeta: kCrateApiSimpleGreetConstMeta, - argValues: [name], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiSimpleGreetConstMeta => - const TaskConstMeta(debugName: "greet", argNames: ["name"]); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(name, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 76)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_String, + decodeErrorData: null, + ), + constMeta: kCrateApiSimpleGreetConstMeta, + argValues: [name], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiSimpleGreetConstMeta => const TaskConstMeta( + debugName: "greet", + argNames: ["name"], + ); @override - Future crateApiIncrementalIndexIncrementalAdd({ - required PlatformInt64 docId, - required List embedding, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(docId, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 76, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexIncrementalAddConstMeta, - argValues: [docId, embedding], - apiImpl: this, + Future crateApiIncrementalIndexIncrementalAdd( + {required PlatformInt64 docId, required List embedding}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(docId, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 77, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIncrementalIndexIncrementalAddConstMeta, + argValues: [docId, embedding], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexIncrementalAddConstMeta => @@ -3193,30 +2631,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIncrementalIndexIncrementalAddBatch({ - required List<(PlatformInt64, Float32List)> docs, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_record_i_64_list_prim_f_32_strict(docs, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 77, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexIncrementalAddBatchConstMeta, - argValues: [docs], - apiImpl: this, + Future crateApiIncrementalIndexIncrementalAddBatch( + {required List<(PlatformInt64, Float32List)> docs}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_record_i_64_list_prim_f_32_strict(docs, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 78, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIncrementalIndexIncrementalAddBatchConstMeta, + argValues: [docs], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexIncrementalAddBatchConstMeta => @@ -3226,63 +2657,51 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIncrementalIndexIncrementalRemove({ - required PlatformInt64 docId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(docId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 78, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexIncrementalRemoveConstMeta, - argValues: [docId], - apiImpl: this, + Future crateApiIncrementalIndexIncrementalRemove( + {required PlatformInt64 docId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(docId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 79, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIncrementalIndexIncrementalRemoveConstMeta, + argValues: [docId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexIncrementalRemoveConstMeta => - const TaskConstMeta(debugName: "incremental_remove", argNames: ["docId"]); + const TaskConstMeta( + debugName: "incremental_remove", + argNames: ["docId"], + ); @override Future> - crateApiIncrementalIndexIncrementalSearch({ - required List queryEmbedding, - required BigInt topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_usize(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 79, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_incremental_search_result, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiIncrementalIndexIncrementalSearchConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, - ), - ); + crateApiIncrementalIndexIncrementalSearch( + {required List queryEmbedding, required BigInt topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_usize(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 80, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_incremental_search_result, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiIncrementalIndexIncrementalSearchConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexIncrementalSearchConstMeta => @@ -3293,287 +2712,245 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override IngestTrafficStats crateApiIngestMetricsIngestTrafficStats() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 80)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_ingest_traffic_stats, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestMetricsIngestTrafficStatsConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 81)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_ingest_traffic_stats, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestMetricsIngestTrafficStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestMetricsIngestTrafficStatsConstMeta => - const TaskConstMeta(debugName: "ingest_traffic_stats", argNames: []); + const TaskConstMeta( + debugName: "ingest_traffic_stats", + argNames: [], + ); @override - Future crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal({ - required IngestTrafficStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_ingest_traffic_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 81, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: - kCrateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotal( + {required IngestTrafficStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_ingest_traffic_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 82, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: + kCrateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotalConstMeta => - const TaskConstMeta( - debugName: "ingest_traffic_stats_legacy_text_traffic_total", - argNames: ["that"], - ); + get kCrateApiIngestMetricsIngestTrafficStatsLegacyTextTrafficTotalConstMeta => + const TaskConstMeta( + debugName: "ingest_traffic_stats_legacy_text_traffic_total", + argNames: ["that"], + ); @override - Future - crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal({ - required IngestTrafficStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_ingest_traffic_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 82, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: - kCrateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotal( + {required IngestTrafficStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_ingest_traffic_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 83, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: + kCrateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotalConstMeta => - const TaskConstMeta( - debugName: "ingest_traffic_stats_session_text_traffic_total", - argNames: ["that"], - ); + get kCrateApiIngestMetricsIngestTrafficStatsSessionTextTrafficTotalConstMeta => + const TaskConstMeta( + debugName: "ingest_traffic_stats_session_text_traffic_total", + argNames: ["that"], + ); @override Future crateApiSimpleInitApp() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 83, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiSimpleInitAppConstMeta, - argValues: [], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiSimpleInitAppConstMeta => - const TaskConstMeta(debugName: "init_app", argNames: []); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 84, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiSimpleInitAppConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiSimpleInitAppConstMeta => const TaskConstMeta( + debugName: "init_app", + argNames: [], + ); @override Future crateApiSimpleRagInitDb() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 84, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagInitDbConstMeta, - argValues: [], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiSimpleRagInitDbConstMeta => - const TaskConstMeta(debugName: "init_db", argNames: []); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 85, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiSimpleRagInitDbConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiSimpleRagInitDbConstMeta => const TaskConstMeta( + debugName: "init_db", + argNames: [], + ); @override - Future crateApiDbPoolInitDbPool({ - required String dbPath, - required int maxSize, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(dbPath, serializer); - sse_encode_u_32(maxSize, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 85, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiDbPoolInitDbPoolConstMeta, - argValues: [dbPath, maxSize], - apiImpl: this, + Future crateApiDbPoolInitDbPool( + {required String dbPath, required int maxSize}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(dbPath, serializer); + sse_encode_u_32(maxSize, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 86, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiDbPoolInitDbPoolConstMeta, + argValues: [dbPath, maxSize], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDbPoolInitDbPoolConstMeta => const TaskConstMeta( - debugName: "init_db_pool", - argNames: ["dbPath", "maxSize"], - ); + debugName: "init_db_pool", + argNames: ["dbPath", "maxSize"], + ); @override Stream crateApiLoggerInitLogStream() { final sink = RustStreamSink(); - handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_StreamSink_String_Sse(sink, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 86)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiLoggerInitLogStreamConstMeta, - argValues: [sink], - apiImpl: this, - ), - ); + handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_StreamSink_String_Sse(sink, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 87)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiLoggerInitLogStreamConstMeta, + argValues: [sink], + apiImpl: this, + )); return sink.stream; } TaskConstMeta get kCrateApiLoggerInitLogStreamConstMeta => - const TaskConstMeta(debugName: "init_log_stream", argNames: ["sink"]); + const TaskConstMeta( + debugName: "init_log_stream", + argNames: ["sink"], + ); @override Future crateApiLoggerInitLogger() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 87, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiLoggerInitLoggerConstMeta, - argValues: [], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiLoggerInitLoggerConstMeta => - const TaskConstMeta(debugName: "init_logger", argNames: []); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 88, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiLoggerInitLoggerConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiLoggerInitLoggerConstMeta => const TaskConstMeta( + debugName: "init_logger", + argNames: [], + ); @override Future crateApiSourceRagInitSourceDb() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 88, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagInitSourceDbConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 89, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagInitSourceDbConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagInitSourceDbConstMeta => - const TaskConstMeta(debugName: "init_source_db", argNames: []); + const TaskConstMeta( + debugName: "init_source_db", + argNames: [], + ); @override Future crateApiTokenizerInitTokenizer({required String tokenizerPath}) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(tokenizerPath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 89, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiTokenizerInitTokenizerConstMeta, - argValues: [tokenizerPath], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(tokenizerPath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 90, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiTokenizerInitTokenizerConstMeta, + argValues: [tokenizerPath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiTokenizerInitTokenizerConstMeta => @@ -3584,53 +2961,44 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiBm25SearchIsBm25IndexLoaded() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 90, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiBm25SearchIsBm25IndexLoadedConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 91, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiBm25SearchIsBm25IndexLoadedConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiBm25SearchIsBm25IndexLoadedConstMeta => - const TaskConstMeta(debugName: "is_bm25_index_loaded", argNames: []); + const TaskConstMeta( + debugName: "is_bm25_index_loaded", + argNames: [], + ); @override Future crateApiSourceRagIsChunkBm25IndexLoaded() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 91, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiSourceRagIsChunkBm25IndexLoadedConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 92, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiSourceRagIsChunkBm25IndexLoadedConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagIsChunkBm25IndexLoadedConstMeta => @@ -3641,85 +3009,71 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiHnswIndexIsHnswIndexLoaded() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 92, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiHnswIndexIsHnswIndexLoadedConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 93, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiHnswIndexIsHnswIndexLoadedConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexIsHnswIndexLoadedConstMeta => - const TaskConstMeta(debugName: "is_hnsw_index_loaded", argNames: []); + const TaskConstMeta( + debugName: "is_hnsw_index_loaded", + argNames: [], + ); @override Future crateApiDbPoolIsPoolInitialized() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 93, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiDbPoolIsPoolInitializedConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 94, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiDbPoolIsPoolInitializedConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiDbPoolIsPoolInitializedConstMeta => - const TaskConstMeta(debugName: "is_pool_initialized", argNames: []); + const TaskConstMeta( + debugName: "is_pool_initialized", + argNames: [], + ); @override - Future> crateApiSourceRagListChunksNeedingReembed({ - required String targetFingerprint, - required PlatformInt64 limit, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(targetFingerprint, serializer); - sse_encode_i_64(limit, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 94, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_for_reembedding, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagListChunksNeedingReembedConstMeta, - argValues: [targetFingerprint, limit], - apiImpl: this, + Future> crateApiSourceRagListChunksNeedingReembed( + {required String targetFingerprint, required PlatformInt64 limit}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(targetFingerprint, serializer); + sse_encode_i_64(limit, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 95, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_for_reembedding, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagListChunksNeedingReembedConstMeta, + argValues: [targetFingerprint, limit], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagListChunksNeedingReembedConstMeta => @@ -3730,56 +3084,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future> crateApiSourceRagListSources() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 95, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_source_entry, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagListSourcesConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 96, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_source_entry, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagListSourcesConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagListSourcesConstMeta => - const TaskConstMeta(debugName: "list_sources", argNames: []); + const TaskConstMeta( + debugName: "list_sources", + argNames: [], + ); @override - Future> crateApiSourceRagListSourcesInCollection({ - required String collectionId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 96, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_source_entry, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagListSourcesInCollectionConstMeta, - argValues: [collectionId], - apiImpl: this, + Future> crateApiSourceRagListSourcesInCollection( + {required String collectionId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 97, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_source_entry, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagListSourcesInCollectionConstMeta, + argValues: [collectionId], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagListSourcesInCollectionConstMeta => @@ -3789,32 +3133,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagLoadCollectionHnswIndex({ - required String collectionId, - required String basePath, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(basePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 97, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagLoadCollectionHnswIndexConstMeta, - argValues: [collectionId, basePath], - apiImpl: this, + Future crateApiSourceRagLoadCollectionHnswIndex( + {required String collectionId, required String basePath}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(basePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 98, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagLoadCollectionHnswIndexConstMeta, + argValues: [collectionId, basePath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagLoadCollectionHnswIndexConstMeta => @@ -3825,54 +3161,47 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiHnswIndexLoadHnswIndex({required String basePath}) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(basePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 98, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiHnswIndexLoadHnswIndexConstMeta, - argValues: [basePath], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(basePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 99, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiHnswIndexLoadHnswIndexConstMeta, + argValues: [basePath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexLoadHnswIndexConstMeta => - const TaskConstMeta(debugName: "load_hnsw_index", argNames: ["basePath"]); + const TaskConstMeta( + debugName: "load_hnsw_index", + argNames: ["basePath"], + ); @override - List crateApiSemanticChunkerMarkdownChunk({ - required String text, - required int maxChars, - }) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(maxChars, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 99)!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_structured_chunk, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerMarkdownChunkConstMeta, - argValues: [text, maxChars], - apiImpl: this, + List crateApiSemanticChunkerMarkdownChunk( + {required String text, required int maxChars}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(maxChars, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 100)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_structured_chunk, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSemanticChunkerMarkdownChunkConstMeta, + argValues: [text, maxChars], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerMarkdownChunkConstMeta => @@ -3882,131 +3211,138 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiIncrementalIndexNeedsMerge() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 100, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiIncrementalIndexNeedsMergeConstMeta, - argValues: [], - apiImpl: this, + NativeRuntimeInfo crateApiRuntimeInfoNativeRuntimeInfo() { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 101)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_native_runtime_info, + decodeErrorData: null, ), - ); + constMeta: kCrateApiRuntimeInfoNativeRuntimeInfoConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiRuntimeInfoNativeRuntimeInfoConstMeta => + const TaskConstMeta( + debugName: "native_runtime_info", + argNames: [], + ); + + @override + Future crateApiIncrementalIndexNeedsMerge() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 102, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiIncrementalIndexNeedsMergeConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIncrementalIndexNeedsMergeConstMeta => - const TaskConstMeta(debugName: "needs_merge", argNames: []); + const TaskConstMeta( + debugName: "needs_merge", + argNames: [], + ); @override ParsedIntent crateApiUserIntentParseIntent({required String input}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(input, serializer); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 101, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_parsed_intent, - decodeErrorData: null, - ), - constMeta: kCrateApiUserIntentParseIntentConstMeta, - argValues: [input], - apiImpl: this, - ), - ); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(input, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 103)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_parsed_intent, + decodeErrorData: null, + ), + constMeta: kCrateApiUserIntentParseIntentConstMeta, + argValues: [input], + apiImpl: this, + )); } TaskConstMeta get kCrateApiUserIntentParseIntentConstMeta => - const TaskConstMeta(debugName: "parse_intent", argNames: ["input"]); + const TaskConstMeta( + debugName: "parse_intent", + argNames: ["input"], + ); @override UserIntent crateApiUserIntentParseUserIntent({required String input}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(input, serializer); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 102, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_user_intent, - decodeErrorData: null, - ), - constMeta: kCrateApiUserIntentParseUserIntentConstMeta, - argValues: [input], - apiImpl: this, - ), - ); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(input, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 104)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_user_intent, + decodeErrorData: null, + ), + constMeta: kCrateApiUserIntentParseUserIntentConstMeta, + argValues: [input], + apiImpl: this, + )); } TaskConstMeta get kCrateApiUserIntentParseUserIntentConstMeta => - const TaskConstMeta(debugName: "parse_user_intent", argNames: ["input"]); + const TaskConstMeta( + debugName: "parse_user_intent", + argNames: ["input"], + ); @override - Future crateApiIngestSessionPrepareSourceIngestion({ - required String collectionId, - required String content, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(content, serializer); - sse_encode_opt_String(metadata, serializer); - sse_encode_opt_String(name, serializer); - sse_encode_ingest_strategy(strategy, serializer); - sse_encode_i_32(maxChars, serializer); - sse_encode_i_32(overlapChars, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 103, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_prepared_ingestion, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiIngestSessionPrepareSourceIngestionConstMeta, - argValues: [ - collectionId, - content, - metadata, - name, - strategy, - maxChars, - overlapChars, - ], - apiImpl: this, - ), - ); + Future crateApiIngestSessionPrepareSourceIngestion( + {required String collectionId, + required String content, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(content, serializer); + sse_encode_opt_String(metadata, serializer); + sse_encode_opt_String(name, serializer); + sse_encode_ingest_strategy(strategy, serializer); + sse_encode_i_32(maxChars, serializer); + sse_encode_i_32(overlapChars, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 105, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_prepared_ingestion, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiIngestSessionPrepareSourceIngestionConstMeta, + argValues: [ + collectionId, + content, + metadata, + name, + strategy, + maxChars, + overlapChars + ], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestSessionPrepareSourceIngestionConstMeta => @@ -4019,530 +3355,468 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { "name", "strategy", "maxChars", - "overlapChars", + "overlapChars" ], ); @override - Future - crateApiIngestSessionPrepareSourceIngestionFromFile({ - required String collectionId, - required String filePath, - String? metadata, - String? name, - IngestStrategy? strategyHint, - required int maxChars, - required int overlapChars, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(filePath, serializer); - sse_encode_opt_String(metadata, serializer); - sse_encode_opt_String(name, serializer); - sse_encode_opt_box_autoadd_ingest_strategy(strategyHint, serializer); - sse_encode_i_32(maxChars, serializer); - sse_encode_i_32(overlapChars, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 104, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_prepared_ingestion, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiIngestSessionPrepareSourceIngestionFromFileConstMeta, - argValues: [ - collectionId, - filePath, - metadata, - name, - strategyHint, - maxChars, - overlapChars, - ], - apiImpl: this, - ), - ); + Future crateApiIngestSessionPrepareSourceIngestionFromFile( + {required String collectionId, + required String filePath, + String? metadata, + String? name, + IngestStrategy? strategyHint, + required int maxChars, + required int overlapChars}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(filePath, serializer); + sse_encode_opt_String(metadata, serializer); + sse_encode_opt_String(name, serializer); + sse_encode_opt_box_autoadd_ingest_strategy(strategyHint, serializer); + sse_encode_i_32(maxChars, serializer); + sse_encode_i_32(overlapChars, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 106, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_prepared_ingestion, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiIngestSessionPrepareSourceIngestionFromFileConstMeta, + argValues: [ + collectionId, + filePath, + metadata, + name, + strategyHint, + maxChars, + overlapChars + ], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionPrepareSourceIngestionFromFileConstMeta => - const TaskConstMeta( - debugName: "prepare_source_ingestion_from_file", - argNames: [ - "collectionId", - "filePath", - "metadata", - "name", - "strategyHint", - "maxChars", - "overlapChars", - ], - ); - - @override - Future - crateApiIngestSessionPrepareSourceIngestionFromUtf8({ - required String collectionId, - required List contentBytes, - String? metadata, - String? name, - required IngestStrategy strategy, - required int maxChars, - required int overlapChars, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_list_prim_u_8_loose(contentBytes, serializer); - sse_encode_opt_String(metadata, serializer); - sse_encode_opt_String(name, serializer); - sse_encode_ingest_strategy(strategy, serializer); - sse_encode_i_32(maxChars, serializer); - sse_encode_i_32(overlapChars, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 105, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_prepared_ingestion, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiIngestSessionPrepareSourceIngestionFromUtf8ConstMeta, - argValues: [ - collectionId, - contentBytes, - metadata, - name, - strategy, - maxChars, - overlapChars, - ], - apiImpl: this, - ), - ); + get kCrateApiIngestSessionPrepareSourceIngestionFromFileConstMeta => + const TaskConstMeta( + debugName: "prepare_source_ingestion_from_file", + argNames: [ + "collectionId", + "filePath", + "metadata", + "name", + "strategyHint", + "maxChars", + "overlapChars" + ], + ); + + @override + Future crateApiIngestSessionPrepareSourceIngestionFromUtf8( + {required String collectionId, + required List contentBytes, + String? metadata, + String? name, + required IngestStrategy strategy, + required int maxChars, + required int overlapChars}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_list_prim_u_8_loose(contentBytes, serializer); + sse_encode_opt_String(metadata, serializer); + sse_encode_opt_String(name, serializer); + sse_encode_ingest_strategy(strategy, serializer); + sse_encode_i_32(maxChars, serializer); + sse_encode_i_32(overlapChars, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 107, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_prepared_ingestion, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiIngestSessionPrepareSourceIngestionFromUtf8ConstMeta, + argValues: [ + collectionId, + contentBytes, + metadata, + name, + strategy, + maxChars, + overlapChars + ], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiIngestSessionPrepareSourceIngestionFromUtf8ConstMeta => - const TaskConstMeta( - debugName: "prepare_source_ingestion_from_utf8", - argNames: [ - "collectionId", - "contentBytes", - "metadata", - "name", - "strategy", - "maxChars", - "overlapChars", - ], - ); + get kCrateApiIngestSessionPrepareSourceIngestionFromUtf8ConstMeta => + const TaskConstMeta( + debugName: "prepare_source_ingestion_from_utf8", + argNames: [ + "collectionId", + "contentBytes", + "metadata", + "name", + "strategy", + "maxChars", + "overlapChars" + ], + ); @override QueryContentReadStats crateApiQueryMetricsQueryContentReadStats() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 106, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_query_content_read_stats, - decodeErrorData: null, - ), - constMeta: kCrateApiQueryMetricsQueryContentReadStatsConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 108)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_query_content_read_stats, + decodeErrorData: null, ), - ); + constMeta: kCrateApiQueryMetricsQueryContentReadStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiQueryMetricsQueryContentReadStatsConstMeta => - const TaskConstMeta(debugName: "query_content_read_stats", argNames: []); + const TaskConstMeta( + debugName: "query_content_read_stats", + argNames: [], + ); @override - Future crateApiQueryMetricsQueryContentReadStatsContentBytesTotal({ - required QueryContentReadStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_query_content_read_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 107, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: - kCrateApiQueryMetricsQueryContentReadStatsContentBytesTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiQueryMetricsQueryContentReadStatsContentBytesTotal( + {required QueryContentReadStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_query_content_read_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 109, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: + kCrateApiQueryMetricsQueryContentReadStatsContentBytesTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiQueryMetricsQueryContentReadStatsContentBytesTotalConstMeta => - const TaskConstMeta( - debugName: "query_content_read_stats_content_bytes_total", - argNames: ["that"], - ); + get kCrateApiQueryMetricsQueryContentReadStatsContentBytesTotalConstMeta => + const TaskConstMeta( + debugName: "query_content_read_stats_content_bytes_total", + argNames: ["that"], + ); @override Future - crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal({ - required QueryContentReadStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_query_content_read_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 108, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: - kCrateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotalConstMeta, - argValues: [that], - apiImpl: this, - ), - ); + crateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotal( + {required QueryContentReadStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_query_content_read_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 110, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, + ), + constMeta: + kCrateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotalConstMeta => - const TaskConstMeta( - debugName: "query_content_read_stats_hydration_content_bytes_total", - argNames: ["that"], - ); + get kCrateApiQueryMetricsQueryContentReadStatsHydrationContentBytesTotalConstMeta => + const TaskConstMeta( + debugName: "query_content_read_stats_hydration_content_bytes_total", + argNames: ["that"], + ); @override - Future crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal({ - required QueryContentReadStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_query_content_read_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 109, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: - kCrateApiQueryMetricsQueryContentReadStatsHydrationRowsTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiQueryMetricsQueryContentReadStatsHydrationRowsTotal( + {required QueryContentReadStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_query_content_read_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 111, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: + kCrateApiQueryMetricsQueryContentReadStatsHydrationRowsTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiQueryMetricsQueryContentReadStatsHydrationRowsTotalConstMeta => - const TaskConstMeta( - debugName: "query_content_read_stats_hydration_rows_total", - argNames: ["that"], - ); + get kCrateApiQueryMetricsQueryContentReadStatsHydrationRowsTotalConstMeta => + const TaskConstMeta( + debugName: "query_content_read_stats_hydration_rows_total", + argNames: ["that"], + ); @override - Future crateApiQueryMetricsQueryContentReadStatsRowsTotal({ - required QueryContentReadStats that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_query_content_read_stats(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 110, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: kCrateApiQueryMetricsQueryContentReadStatsRowsTotalConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiQueryMetricsQueryContentReadStatsRowsTotal( + {required QueryContentReadStats that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_query_content_read_stats(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 112, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: kCrateApiQueryMetricsQueryContentReadStatsRowsTotalConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiQueryMetricsQueryContentReadStatsRowsTotalConstMeta => - const TaskConstMeta( - debugName: "query_content_read_stats_rows_total", - argNames: ["that"], - ); + get kCrateApiQueryMetricsQueryContentReadStatsRowsTotalConstMeta => + const TaskConstMeta( + debugName: "query_content_read_stats_rows_total", + argNames: ["that"], + ); @override Future crateApiMigrationMetaReadMigrationAxes() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 111, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_migration_axes, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaReadMigrationAxesConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 113, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_migration_axes, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiMigrationMetaReadMigrationAxesConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiMigrationMetaReadMigrationAxesConstMeta => - const TaskConstMeta(debugName: "read_migration_axes", argNames: []); + const TaskConstMeta( + debugName: "read_migration_axes", + argNames: [], + ); @override Future crateApiSimpleRagRebuildBm25Index() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 112, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagRebuildBm25IndexConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 114, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiSimpleRagRebuildBm25IndexConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagRebuildBm25IndexConstMeta => - const TaskConstMeta(debugName: "rebuild_bm25_index", argNames: []); + const TaskConstMeta( + debugName: "rebuild_bm25_index", + argNames: [], + ); @override Future crateApiSourceRagRebuildChunkBm25Index() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 113, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagRebuildChunkBm25IndexConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 115, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagRebuildChunkBm25IndexConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagRebuildChunkBm25IndexConstMeta => - const TaskConstMeta(debugName: "rebuild_chunk_bm25_index", argNames: []); + const TaskConstMeta( + debugName: "rebuild_chunk_bm25_index", + argNames: [], + ); @override - Future crateApiSourceRagRebuildChunkBm25IndexForCollection({ - required String collectionId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 114, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiSourceRagRebuildChunkBm25IndexForCollectionConstMeta, - argValues: [collectionId], - apiImpl: this, + Future crateApiSourceRagRebuildChunkBm25IndexForCollection( + {required String collectionId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 116, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagRebuildChunkBm25IndexForCollectionConstMeta, + argValues: [collectionId], + apiImpl: this, + )); } TaskConstMeta - get kCrateApiSourceRagRebuildChunkBm25IndexForCollectionConstMeta => - const TaskConstMeta( - debugName: "rebuild_chunk_bm25_index_for_collection", - argNames: ["collectionId"], - ); + get kCrateApiSourceRagRebuildChunkBm25IndexForCollectionConstMeta => + const TaskConstMeta( + debugName: "rebuild_chunk_bm25_index_for_collection", + argNames: ["collectionId"], + ); @override Future crateApiSourceRagRebuildChunkHnswIndex() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 115, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagRebuildChunkHnswIndexConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 117, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagRebuildChunkHnswIndexConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagRebuildChunkHnswIndexConstMeta => - const TaskConstMeta(debugName: "rebuild_chunk_hnsw_index", argNames: []); + const TaskConstMeta( + debugName: "rebuild_chunk_hnsw_index", + argNames: [], + ); @override - Future crateApiSourceRagRebuildChunkHnswIndexForCollection({ - required String collectionId, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 116, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: - kCrateApiSourceRagRebuildChunkHnswIndexForCollectionConstMeta, - argValues: [collectionId], - apiImpl: this, + Future crateApiSourceRagRebuildChunkHnswIndexForCollection( + {required String collectionId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 118, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagRebuildChunkHnswIndexForCollectionConstMeta, + argValues: [collectionId], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiSourceRagRebuildChunkHnswIndexForCollectionConstMeta => + const TaskConstMeta( + debugName: "rebuild_chunk_hnsw_index_for_collection", + argNames: ["collectionId"], + ); + + @override + Future crateApiSimpleRagRebuildHnswIndex() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 119, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiSimpleRagRebuildHnswIndexConstMeta, + argValues: [], + apiImpl: this, + )); } - TaskConstMeta - get kCrateApiSourceRagRebuildChunkHnswIndexForCollectionConstMeta => + TaskConstMeta get kCrateApiSimpleRagRebuildHnswIndexConstMeta => const TaskConstMeta( - debugName: "rebuild_chunk_hnsw_index_for_collection", - argNames: ["collectionId"], + debugName: "rebuild_hnsw_index", + argNames: [], ); @override - Future crateApiSimpleRagRebuildHnswIndex() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 117, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagRebuildHnswIndexConstMeta, - argValues: [], - apiImpl: this, + void crateApiActivationMetricsResetActivationTimingStats() { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 120)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiActivationMetricsResetActivationTimingStatsConstMeta, + argValues: [], + apiImpl: this, + )); } - TaskConstMeta get kCrateApiSimpleRagRebuildHnswIndexConstMeta => - const TaskConstMeta(debugName: "rebuild_hnsw_index", argNames: []); + TaskConstMeta + get kCrateApiActivationMetricsResetActivationTimingStatsConstMeta => + const TaskConstMeta( + debugName: "reset_activation_timing_stats", + argNames: [], + ); @override void crateApiIngestMetricsResetIngestTrafficStats() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 118, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiIngestMetricsResetIngestTrafficStatsConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 121)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiIngestMetricsResetIngestTrafficStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiIngestMetricsResetIngestTrafficStatsConstMeta => @@ -4553,25 +3827,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override void crateApiQueryMetricsResetQueryContentReadStats() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 119, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiQueryMetricsResetQueryContentReadStatsConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 122)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiQueryMetricsResetQueryContentReadStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiQueryMetricsResetQueryContentReadStatsConstMeta => @@ -4582,58 +3850,47 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiHybridSearchRrfConfigDefault() { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 120, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_rrf_config, - decodeErrorData: null, - ), - constMeta: kCrateApiHybridSearchRrfConfigDefaultConstMeta, - argValues: [], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 123, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_rrf_config, + decodeErrorData: null, + ), + constMeta: kCrateApiHybridSearchRrfConfigDefaultConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHybridSearchRrfConfigDefaultConstMeta => - const TaskConstMeta(debugName: "rrf_config_default", argNames: []); + const TaskConstMeta( + debugName: "rrf_config_default", + argNames: [], + ); @override - Future crateApiSourceRagSaveCollectionHnswIndex({ - required String collectionId, - required String basePath, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(basePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 121, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSaveCollectionHnswIndexConstMeta, - argValues: [collectionId, basePath], - apiImpl: this, + Future crateApiSourceRagSaveCollectionHnswIndex( + {required String collectionId, required String basePath}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(basePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 124, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagSaveCollectionHnswIndexConstMeta, + argValues: [collectionId, basePath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSaveCollectionHnswIndexConstMeta => @@ -4644,59 +3901,48 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateApiHnswIndexSaveHnswIndex({required String basePath}) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(basePath, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 122, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiHnswIndexSaveHnswIndexConstMeta, - argValues: [basePath], - apiImpl: this, - ), - ); + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(basePath, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 125, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiHnswIndexSaveHnswIndexConstMeta, + argValues: [basePath], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexSaveHnswIndexConstMeta => - const TaskConstMeta(debugName: "save_hnsw_index", argNames: ["basePath"]); + const TaskConstMeta( + debugName: "save_hnsw_index", + argNames: ["basePath"], + ); @override - Future> crateApiSourceRagSearchChunks({ - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 123, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchChunksConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, + Future> crateApiSourceRagSearchChunks( + {required List queryEmbedding, required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 126, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_search_result, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagSearchChunksConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchChunksConstMeta => @@ -4706,34 +3952,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSourceRagSearchChunksInCollection({ - required String collectionId, - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 124, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_chunk_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchChunksInCollectionConstMeta, - argValues: [collectionId, queryEmbedding, topK], - apiImpl: this, - ), - ); + Future> crateApiSourceRagSearchChunksInCollection( + {required String collectionId, + required List queryEmbedding, + required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 127, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_chunk_search_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagSearchChunksInCollectionConstMeta, + argValues: [collectionId, queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchChunksInCollectionConstMeta => @@ -4743,32 +3982,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiHnswIndexSearchHnsw({ - required List queryEmbedding, - required BigInt topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_usize(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 125, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_hnsw_search_result, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiHnswIndexSearchHnswConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, + Future> crateApiHnswIndexSearchHnsw( + {required List queryEmbedding, required BigInt topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_usize(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 128, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_hnsw_search_result, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiHnswIndexSearchHnswConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexSearchHnswConstMeta => @@ -4778,32 +4009,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiHnswIndexSearchHnswSlice({ - required List queryEmbedding, - required BigInt topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_usize(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 126, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_hnsw_search_result, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiHnswIndexSearchHnswSliceConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, + Future> crateApiHnswIndexSearchHnswSlice( + {required List queryEmbedding, required BigInt topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_usize(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 129, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_hnsw_search_result, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiHnswIndexSearchHnswSliceConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHnswIndexSearchHnswSliceConstMeta => @@ -4813,38 +4036,31 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiHybridSearchSearchHybrid({ - required String queryText, - required List queryEmbedding, - required int topK, - RrfConfig? config, - SearchFilter? filter, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(queryText, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - sse_encode_opt_box_autoadd_rrf_config(config, serializer); - sse_encode_opt_box_autoadd_search_filter(filter, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 127, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_hybrid_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiHybridSearchSearchHybridConstMeta, - argValues: [queryText, queryEmbedding, topK, config, filter], - apiImpl: this, - ), - ); + Future> crateApiHybridSearchSearchHybrid( + {required String queryText, + required List queryEmbedding, + required int topK, + RrfConfig? config, + SearchFilter? filter}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(queryText, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + sse_encode_opt_box_autoadd_rrf_config(config, serializer); + sse_encode_opt_box_autoadd_search_filter(filter, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 130, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_hybrid_search_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiHybridSearchSearchHybridConstMeta, + argValues: [queryText, queryEmbedding, topK, config, filter], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHybridSearchSearchHybridConstMeta => @@ -4854,34 +4070,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiHybridSearchSearchHybridSimple({ - required String queryText, - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(queryText, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 128, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_String, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiHybridSearchSearchHybridSimpleConstMeta, - argValues: [queryText, queryEmbedding, topK], - apiImpl: this, - ), - ); + Future> crateApiHybridSearchSearchHybridSimple( + {required String queryText, + required List queryEmbedding, + required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(queryText, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 131, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_String, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiHybridSearchSearchHybridSimpleConstMeta, + argValues: [queryText, queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHybridSearchSearchHybridSimpleConstMeta => @@ -4891,38 +4100,31 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiHybridSearchSearchHybridWeighted({ - required String queryText, - required List queryEmbedding, - required int topK, - required double vectorWeight, - required double bm25Weight, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(queryText, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - sse_encode_f_64(vectorWeight, serializer); - sse_encode_f_64(bm25Weight, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 129, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_hybrid_search_result, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiHybridSearchSearchHybridWeightedConstMeta, - argValues: [queryText, queryEmbedding, topK, vectorWeight, bm25Weight], - apiImpl: this, - ), - ); + Future> crateApiHybridSearchSearchHybridWeighted( + {required String queryText, + required List queryEmbedding, + required int topK, + required double vectorWeight, + required double bm25Weight}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(queryText, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + sse_encode_f_64(vectorWeight, serializer); + sse_encode_f_64(bm25Weight, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 132, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_hybrid_search_result, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiHybridSearchSearchHybridWeightedConstMeta, + argValues: [queryText, queryEmbedding, topK, vectorWeight, bm25Weight], + apiImpl: this, + )); } TaskConstMeta get kCrateApiHybridSearchSearchHybridWeightedConstMeta => @@ -4933,45 +4135,35 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { "queryEmbedding", "topK", "vectorWeight", - "bm25Weight", + "bm25Weight" ], ); @override - Future crateApiSourceRagSearchMetaHybrid({ - required String collectionId, - required String queryText, - required List queryEmbedding, - required SearchMetaHybridOptions options, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(collectionId, serializer); - sse_encode_String(queryText, serializer); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_box_autoadd_search_meta_hybrid_options( - options, - serializer, - ); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 130, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagSearchMetaHybridConstMeta, - argValues: [collectionId, queryText, queryEmbedding, options], - apiImpl: this, - ), - ); + Future crateApiSourceRagSearchMetaHybrid( + {required String collectionId, + required String queryText, + required List queryEmbedding, + required SearchMetaHybridOptions options}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(collectionId, serializer); + sse_encode_String(queryText, serializer); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_box_autoadd_search_meta_hybrid_options(options, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 133, port: port_); + }, + codec: SseCodec( + decodeSuccessData: + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagSearchMetaHybridConstMeta, + argValues: [collectionId, queryText, queryEmbedding, options], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagSearchMetaHybridConstMeta => @@ -4981,32 +4173,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiSimpleRagSearchSimilar({ - required List queryEmbedding, - required int topK, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); - sse_encode_u_32(topK, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 131, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_String, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiSimpleRagSearchSimilarConstMeta, - argValues: [queryEmbedding, topK], - apiImpl: this, + Future> crateApiSimpleRagSearchSimilar( + {required List queryEmbedding, required int topK}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_prim_f_32_loose(queryEmbedding, serializer); + sse_encode_u_32(topK, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 134, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_String, + decodeErrorData: sse_decode_AnyhowException, ), - ); + constMeta: kCrateApiSimpleRagSearchSimilarConstMeta, + argValues: [queryEmbedding, topK], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSimpleRagSearchSimilarConstMeta => @@ -5016,31 +4200,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - List crateApiSemanticChunkerSemanticChunk({ - required String text, - required int maxChars, - }) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(maxChars, serializer); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 132, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_semantic_chunk, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerSemanticChunkConstMeta, - argValues: [text, maxChars], - apiImpl: this, + List crateApiSemanticChunkerSemanticChunk( + {required String text, required int maxChars}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(maxChars, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 135)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_semantic_chunk, + decodeErrorData: null, ), - ); + constMeta: kCrateApiSemanticChunkerSemanticChunkConstMeta, + argValues: [text, maxChars], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerSemanticChunkConstMeta => @@ -5050,33 +4226,26 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - List crateApiSemanticChunkerSemanticChunkWithOverlap({ - required String text, - required int maxChars, - required int overlapChars, - }) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(maxChars, serializer); - sse_encode_i_32(overlapChars, serializer); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 133, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_semantic_chunk, - decodeErrorData: null, - ), - constMeta: kCrateApiSemanticChunkerSemanticChunkWithOverlapConstMeta, - argValues: [text, maxChars, overlapChars], - apiImpl: this, - ), - ); + List crateApiSemanticChunkerSemanticChunkWithOverlap( + {required String text, + required int maxChars, + required int overlapChars}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(maxChars, serializer); + sse_encode_i_32(overlapChars, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 136)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_semantic_chunk, + decodeErrorData: null, + ), + constMeta: kCrateApiSemanticChunkerSemanticChunkWithOverlapConstMeta, + argValues: [text, maxChars, overlapChars], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSemanticChunkerSemanticChunkWithOverlapConstMeta => @@ -5086,62 +4255,50 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiCompressionUtilsSentenceHash({ - required String sentence, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(sentence, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 134, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_u_64, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsSentenceHashConstMeta, - argValues: [sentence], - apiImpl: this, + Future crateApiCompressionUtilsSentenceHash( + {required String sentence}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(sentence, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 137, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_u_64, + decodeErrorData: null, ), - ); + constMeta: kCrateApiCompressionUtilsSentenceHashConstMeta, + argValues: [sentence], + apiImpl: this, + )); } TaskConstMeta get kCrateApiCompressionUtilsSentenceHashConstMeta => - const TaskConstMeta(debugName: "sentence_hash", argNames: ["sentence"]); + const TaskConstMeta( + debugName: "sentence_hash", + argNames: ["sentence"], + ); @override - Future crateApiCompressionUtilsShouldCompress({ - required String text, - required int tokenThreshold, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - sse_encode_i_32(tokenThreshold, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 135, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_bool, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsShouldCompressConstMeta, - argValues: [text, tokenThreshold], - apiImpl: this, + Future crateApiCompressionUtilsShouldCompress( + {required String text, required int tokenThreshold}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + sse_encode_i_32(tokenThreshold, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 138, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_bool, + decodeErrorData: null, ), - ); + constMeta: kCrateApiCompressionUtilsShouldCompressConstMeta, + argValues: [text, tokenThreshold], + apiImpl: this, + )); } TaskConstMeta get kCrateApiCompressionUtilsShouldCompressConstMeta => @@ -5151,56 +4308,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateApiCompressionUtilsSplitSentences({ - required String text, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 136, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_String, - decodeErrorData: null, - ), - constMeta: kCrateApiCompressionUtilsSplitSentencesConstMeta, - argValues: [text], - apiImpl: this, + Future> crateApiCompressionUtilsSplitSentences( + {required String text}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 139, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_String, + decodeErrorData: null, ), - ); + constMeta: kCrateApiCompressionUtilsSplitSentencesConstMeta, + argValues: [text], + apiImpl: this, + )); } TaskConstMeta get kCrateApiCompressionUtilsSplitSentencesConstMeta => - const TaskConstMeta(debugName: "split_sentences", argNames: ["text"]); + const TaskConstMeta( + debugName: "split_sentences", + argNames: ["text"], + ); + + @override + ActivationTimingStats crateApiActivationMetricsTakeActivationTimingStats() { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 140)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_activation_timing_stats, + decodeErrorData: null, + ), + constMeta: kCrateApiActivationMetricsTakeActivationTimingStatsConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiActivationMetricsTakeActivationTimingStatsConstMeta => + const TaskConstMeta( + debugName: "take_activation_timing_stats", + argNames: [], + ); @override QueryContentReadStats crateApiQueryMetricsTakeQueryContentReadStats() { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 137, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_query_content_read_stats, - decodeErrorData: null, - ), - constMeta: kCrateApiQueryMetricsTakeQueryContentReadStatsConstMeta, - argValues: [], - apiImpl: this, + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 141)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_query_content_read_stats, + decodeErrorData: null, ), - ); + constMeta: kCrateApiQueryMetricsTakeQueryContentReadStatsConstMeta, + argValues: [], + apiImpl: this, + )); } TaskConstMeta get kCrateApiQueryMetricsTakeQueryContentReadStatsConstMeta => @@ -5211,58 +4382,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Uint32List crateApiTokenizerTokenize({required String text}) { - return handler.executeSync( - SyncTask( - callFfi: () { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(text, serializer); - return pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 138, - )!; - }, - codec: SseCodec( - decodeSuccessData: sse_decode_list_prim_u_32_strict, - decodeErrorData: sse_decode_AnyhowException, - ), - constMeta: kCrateApiTokenizerTokenizeConstMeta, - argValues: [text], - apiImpl: this, - ), - ); - } - - TaskConstMeta get kCrateApiTokenizerTokenizeConstMeta => - const TaskConstMeta(debugName: "tokenize", argNames: ["text"]); + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(text, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 142)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_prim_u_32_strict, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiTokenizerTokenizeConstMeta, + argValues: [text], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTokenizerTokenizeConstMeta => const TaskConstMeta( + debugName: "tokenize", + argNames: ["text"], + ); @override - Future crateApiSourceRagUpdateChunkEmbedding({ - required PlatformInt64 chunkId, - required List embedding, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(chunkId, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 139, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagUpdateChunkEmbeddingConstMeta, - argValues: [chunkId, embedding], - apiImpl: this, + Future crateApiSourceRagUpdateChunkEmbedding( + {required PlatformInt64 chunkId, required List embedding}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(chunkId, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 143, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagUpdateChunkEmbeddingConstMeta, + argValues: [chunkId, embedding], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagUpdateChunkEmbeddingConstMeta => @@ -5272,34 +4431,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagUpdateChunkReembedded({ - required PlatformInt64 chunkId, - required List embedding, - required String targetFingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(chunkId, serializer); - sse_encode_list_prim_f_32_loose(embedding, serializer); - sse_encode_String(targetFingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 140, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagUpdateChunkReembeddedConstMeta, - argValues: [chunkId, embedding, targetFingerprint], - apiImpl: this, - ), - ); + Future crateApiSourceRagUpdateChunkReembedded( + {required PlatformInt64 chunkId, + required List embedding, + required String targetFingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(chunkId, serializer); + sse_encode_list_prim_f_32_loose(embedding, serializer); + sse_encode_String(targetFingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 144, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, + ), + constMeta: kCrateApiSourceRagUpdateChunkReembeddedConstMeta, + argValues: [chunkId, embedding, targetFingerprint], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagUpdateChunkReembeddedConstMeta => @@ -5309,32 +4461,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiSourceRagUpdateSourceStatus({ - required PlatformInt64 sourceId, - required String status, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_i_64(sourceId, serializer); - sse_encode_String(status, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 141, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiSourceRagUpdateSourceStatusConstMeta, - argValues: [sourceId, status], - apiImpl: this, + Future crateApiSourceRagUpdateSourceStatus( + {required PlatformInt64 sourceId, required String status}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_i_64(sourceId, serializer); + sse_encode_String(status, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 145, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiSourceRagUpdateSourceStatusConstMeta, + argValues: [sourceId, status], + apiImpl: this, + )); } TaskConstMeta get kCrateApiSourceRagUpdateSourceStatusConstMeta => @@ -5344,30 +4488,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiUserIntentUserIntentGetQuery({ - required UserIntent that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_user_intent(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 142, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiUserIntentUserIntentGetQueryConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiUserIntentUserIntentGetQuery( + {required UserIntent that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_user_intent(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 146, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiUserIntentUserIntentGetQueryConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiUserIntentUserIntentGetQueryConstMeta => @@ -5377,30 +4514,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiUserIntentUserIntentIntentType({ - required UserIntent that, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_box_autoadd_user_intent(that, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 143, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: null, - ), - constMeta: kCrateApiUserIntentUserIntentIntentTypeConstMeta, - argValues: [that], - apiImpl: this, + Future crateApiUserIntentUserIntentIntentType( + {required UserIntent that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_box_autoadd_user_intent(that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 147, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, ), - ); + constMeta: kCrateApiUserIntentUserIntentIntentTypeConstMeta, + argValues: [that], + apiImpl: this, + )); } TaskConstMeta get kCrateApiUserIntentUserIntentIntentTypeConstMeta => @@ -5410,30 +4540,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateApiMigrationMetaWriteEmbeddingFingerprint({ - required String fingerprint, - }) { - return handler.executeNormal( - NormalTask( - callFfi: (port_) { - final serializer = SseSerializer(generalizedFrbRustBinding); - sse_encode_String(fingerprint, serializer); - pdeCallFfi( - generalizedFrbRustBinding, - serializer, - funcId: 144, - port: port_, - ); - }, - codec: SseCodec( - decodeSuccessData: sse_decode_unit, - decodeErrorData: sse_decode_rag_error, - ), - constMeta: kCrateApiMigrationMetaWriteEmbeddingFingerprintConstMeta, - argValues: [fingerprint], - apiImpl: this, + Future crateApiMigrationMetaWriteEmbeddingFingerprint( + {required String fingerprint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(fingerprint, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 148, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_rag_error, ), - ); + constMeta: kCrateApiMigrationMetaWriteEmbeddingFingerprintConstMeta, + argValues: [fingerprint], + apiImpl: this, + )); } TaskConstMeta get kCrateApiMigrationMetaWriteEmbeddingFingerprintConstMeta => @@ -5443,20 +4566,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_IngestSession => wire - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; + get rust_arc_increment_strong_count_IngestSession => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_IngestSession => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; + get rust_arc_decrement_strong_count_IngestSession => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_SearchHandle => wire - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; + get rust_arc_increment_strong_count_SearchHandle => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_SearchHandle => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; + get rust_arc_decrement_strong_count_SearchHandle => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; @protected AnyhowException dco_decode_AnyhowException(dynamic raw) { @@ -5466,85 +4589,74 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IngestSession - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - raw, - ); + raw); } @protected SearchHandle - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ) { + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - raw, - ); + raw); } @protected IngestSession - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return IngestSessionImpl.frbInternalDcoDecode(raw as List); } @protected SearchHandle - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ) { + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return SearchHandleImpl.frbInternalDcoDecode(raw as List); } @protected IngestSession - dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return IngestSessionImpl.frbInternalDcoDecode(raw as List); } @protected IngestSession - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return IngestSessionImpl.frbInternalDcoDecode(raw as List); } @protected SearchHandle - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ) { + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return SearchHandleImpl.frbInternalDcoDecode(raw as List); } @protected IngestSession - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return IngestSessionImpl.frbInternalDcoDecode(raw as List); } @protected SearchHandle - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ) { + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return SearchHandleImpl.frbInternalDcoDecode(raw as List); } @@ -5561,6 +4673,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw as String; } + @protected + ActivationTimingStats dco_decode_activation_timing_stats(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 12) + throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); + return ActivationTimingStats( + activateTotalNanos: dco_decode_u_64(arr[0]), + activateCount: dco_decode_u_64(arr[1]), + bm25RebuildNanos: dco_decode_u_64(arr[2]), + bm25RebuildCount: dco_decode_u_64(arr[3]), + hnswLoadNanos: dco_decode_u_64(arr[4]), + hnswLoadCount: dco_decode_u_64(arr[5]), + hnswLoadSuccessCount: dco_decode_u_64(arr[6]), + hnswLoadMissCount: dco_decode_u_64(arr[7]), + hnswRebuildNanos: dco_decode_u_64(arr[8]), + hnswRebuildCount: dco_decode_u_64(arr[9]), + hnswSaveNanos: dco_decode_u_64(arr[10]), + hnswSaveCount: dco_decode_u_64(arr[11]), + ); + } + @protected AddDocumentResult dco_decode_add_document_result(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -5637,8 +4771,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected AssembleContextOptions dco_decode_box_autoadd_assemble_context_options( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_assemble_context_options(raw); } @@ -5675,8 +4808,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected QueryContentReadStats dco_decode_box_autoadd_query_content_read_stats( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_query_content_read_stats(raw); } @@ -5701,8 +4833,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected SearchMetaHybridOptions dco_decode_box_autoadd_search_meta_hybrid_options( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_search_meta_hybrid_options(raw); } @@ -6054,8 +5185,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List dco_decode_list_incremental_search_result( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return (raw as List) .map(dco_decode_incremental_search_result) @@ -6106,7 +5236,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List<(PlatformInt64, Float32List)> - dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw) { + dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return (raw as List) .map(dco_decode_record_i_64_list_prim_f_32_strict) @@ -6115,8 +5245,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List<(PlatformInt64, String)> dco_decode_list_record_i_64_string( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return (raw as List).map(dco_decode_record_i_64_string).toList(); } @@ -6161,17 +5290,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); } + @protected + NativeRuntimeInfo dco_decode_native_runtime_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 2) + throw Exception('unexpected arr length: expect 2 but see ${arr.length}'); + return NativeRuntimeInfo( + nativeAllocator: dco_decode_String(arr[0]), + rustFeatures: dco_decode_String(arr[1]), + ); + } + @protected IngestSession? - dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ) { + dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - raw, - ); + raw); } @protected @@ -6200,8 +5339,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (int, int, int)? dco_decode_opt_box_autoadd_record_u_32_u_32_u_32( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null @@ -6261,8 +5399,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { message: dco_decode_String(arr[5]), session: dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - arr[6], - ), + arr[6]), ); } @@ -6303,19 +5440,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return RagError_DatabaseError(dco_decode_String(raw[1])); + return RagError_DatabaseError( + dco_decode_String(raw[1]), + ); case 1: - return RagError_IoError(dco_decode_String(raw[1])); + return RagError_IoError( + dco_decode_String(raw[1]), + ); case 2: - return RagError_ModelLoadError(dco_decode_String(raw[1])); + return RagError_ModelLoadError( + dco_decode_String(raw[1]), + ); case 3: - return RagError_InvalidInput(dco_decode_String(raw[1])); + return RagError_InvalidInput( + dco_decode_String(raw[1]), + ); case 4: - return RagError_StaleSearchHandle(dco_decode_String(raw[1])); + return RagError_StaleSearchHandle( + dco_decode_String(raw[1]), + ); case 5: - return RagError_ConcurrentMutation(dco_decode_String(raw[1])); + return RagError_ConcurrentMutation( + dco_decode_String(raw[1]), + ); case 6: - return RagError_InternalError(dco_decode_String(raw[1])); + return RagError_InternalError( + dco_decode_String(raw[1]), + ); case 7: return RagError_UnsupportedMigrationVersion( dco_decode_String(raw[1]), @@ -6329,7 +5480,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { dco_decode_i_64(raw[3]), ); case 9: - return RagError_Unknown(dco_decode_String(raw[1])); + return RagError_Unknown( + dco_decode_String(raw[1]), + ); default: throw Exception("unreachable"); } @@ -6337,14 +5490,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (PlatformInt64, Float32List) dco_decode_record_i_64_list_prim_f_32_strict( - dynamic raw, - ) { + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; if (arr.length != 2) { throw Exception('Expected 2 elements, got ${arr.length}'); } - return (dco_decode_i_64(arr[0]), dco_decode_list_prim_f_32_strict(arr[1])); + return ( + dco_decode_i_64(arr[0]), + dco_decode_list_prim_f_32_strict(arr[1]), + ); } @protected @@ -6354,7 +5509,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { if (arr.length != 2) { throw Exception('Expected 2 elements, got ${arr.length}'); } - return (dco_decode_i_64(arr[0]), dco_decode_String(arr[1])); + return ( + dco_decode_i_64(arr[0]), + dco_decode_String(arr[1]), + ); } @protected @@ -6519,13 +5677,21 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return UserIntent_Summary(query: dco_decode_String(raw[1])); + return UserIntent_Summary( + query: dco_decode_String(raw[1]), + ); case 1: - return UserIntent_Define(term: dco_decode_String(raw[1])); + return UserIntent_Define( + term: dco_decode_String(raw[1]), + ); case 2: - return UserIntent_ExpandKnowledge(query: dco_decode_String(raw[1])); + return UserIntent_ExpandKnowledge( + query: dco_decode_String(raw[1]), + ); case 3: - return UserIntent_General(query: dco_decode_String(raw[1])); + return UserIntent_General( + query: dco_decode_String(raw[1]), + ); case 4: return UserIntent_InvalidCommand( command: dco_decode_String(raw[1]), @@ -6551,118 +5717,92 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IngestSession - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - deserializer, - ); + deserializer); return inner; } @protected SearchHandle - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ) { + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - deserializer, - ); + deserializer); return inner; } @protected IngestSession - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return IngestSessionImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected SearchHandle - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ) { + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return SearchHandleImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected IngestSession - sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return IngestSessionImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected IngestSession - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return IngestSessionImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected SearchHandle - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ) { + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return SearchHandleImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected IngestSession - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return IngestSessionImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected SearchHandle - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ) { + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return SearchHandleImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), - sse_decode_i_32(deserializer), - ); + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected RustStreamSink sse_decode_StreamSink_String_Sse( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs throw UnimplementedError('Unreachable ()'); } @@ -6674,19 +5814,48 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return utf8.decoder.convert(inner); } + @protected + ActivationTimingStats sse_decode_activation_timing_stats( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_activateTotalNanos = sse_decode_u_64(deserializer); + var var_activateCount = sse_decode_u_64(deserializer); + var var_bm25RebuildNanos = sse_decode_u_64(deserializer); + var var_bm25RebuildCount = sse_decode_u_64(deserializer); + var var_hnswLoadNanos = sse_decode_u_64(deserializer); + var var_hnswLoadCount = sse_decode_u_64(deserializer); + var var_hnswLoadSuccessCount = sse_decode_u_64(deserializer); + var var_hnswLoadMissCount = sse_decode_u_64(deserializer); + var var_hnswRebuildNanos = sse_decode_u_64(deserializer); + var var_hnswRebuildCount = sse_decode_u_64(deserializer); + var var_hnswSaveNanos = sse_decode_u_64(deserializer); + var var_hnswSaveCount = sse_decode_u_64(deserializer); + return ActivationTimingStats( + activateTotalNanos: var_activateTotalNanos, + activateCount: var_activateCount, + bm25RebuildNanos: var_bm25RebuildNanos, + bm25RebuildCount: var_bm25RebuildCount, + hnswLoadNanos: var_hnswLoadNanos, + hnswLoadCount: var_hnswLoadCount, + hnswLoadSuccessCount: var_hnswLoadSuccessCount, + hnswLoadMissCount: var_hnswLoadMissCount, + hnswRebuildNanos: var_hnswRebuildNanos, + hnswRebuildCount: var_hnswRebuildCount, + hnswSaveNanos: var_hnswSaveNanos, + hnswSaveCount: var_hnswSaveCount); + } + @protected AddDocumentResult sse_decode_add_document_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_success = sse_decode_bool(deserializer); var var_isDuplicate = sse_decode_bool(deserializer); var var_message = sse_decode_String(deserializer); return AddDocumentResult( - success: var_success, - isDuplicate: var_isDuplicate, - message: var_message, - ); + success: var_success, + isDuplicate: var_isDuplicate, + message: var_message); } @protected @@ -6697,34 +5866,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_chunkCount = sse_decode_i_32(deserializer); var var_message = sse_decode_String(deserializer); return AddSourceResult( - sourceId: var_sourceId, - isDuplicate: var_isDuplicate, - chunkCount: var_chunkCount, - message: var_message, - ); + sourceId: var_sourceId, + isDuplicate: var_isDuplicate, + chunkCount: var_chunkCount, + message: var_message); } @protected AssembleContextOptions sse_decode_assemble_context_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_tokenBudget = sse_decode_i_32(deserializer); var var_strategy = sse_decode_context_assembly_strategy(deserializer); var var_separator = sse_decode_String(deserializer); var var_singleSourceMode = sse_decode_bool(deserializer); return AssembleContextOptions( - tokenBudget: var_tokenBudget, - strategy: var_strategy, - separator: var_separator, - singleSourceMode: var_singleSourceMode, - ); + tokenBudget: var_tokenBudget, + strategy: var_strategy, + separator: var_separator, + singleSourceMode: var_singleSourceMode); } @protected AssembledContextV2 sse_decode_assembled_context_v_2( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_text = sse_decode_String(deserializer); var var_exactTokens = sse_decode_u_32(deserializer); @@ -6732,18 +5897,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_remainingBudget = sse_decode_i_32(deserializer); var var_selectedSourceId = sse_decode_opt_box_autoadd_i_64(deserializer); return AssembledContextV2( - text: var_text, - exactTokens: var_exactTokens, - includedChunkIds: var_includedChunkIds, - remainingBudget: var_remainingBudget, - selectedSourceId: var_selectedSourceId, - ); + text: var_text, + exactTokens: var_exactTokens, + includedChunkIds: var_includedChunkIds, + remainingBudget: var_remainingBudget, + selectedSourceId: var_selectedSourceId); } @protected Bm25SearchResult sse_decode_bm_25_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_docId = sse_decode_i_64(deserializer); var var_score = sse_decode_f_64(deserializer); @@ -6758,16 +5921,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected AssembleContextOptions sse_decode_box_autoadd_assemble_context_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_assemble_context_options(deserializer)); } @protected CompressionOptions sse_decode_box_autoadd_compression_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_compression_options(deserializer)); } @@ -6786,32 +5947,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IngestStrategy sse_decode_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_ingest_strategy(deserializer)); } @protected IngestTrafficStats sse_decode_box_autoadd_ingest_traffic_stats( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_ingest_traffic_stats(deserializer)); } @protected QueryContentReadStats sse_decode_box_autoadd_query_content_read_stats( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_query_content_read_stats(deserializer)); } @protected (int, int, int) sse_decode_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_record_u_32_u_32_u_32(deserializer)); } @@ -6824,16 +5981,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected SearchFilter sse_decode_box_autoadd_search_filter( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_search_filter(deserializer)); } @protected SearchMetaHybridOptions sse_decode_box_autoadd_search_meta_hybrid_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_search_meta_hybrid_options(deserializer)); } @@ -6857,10 +6012,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_threshold = sse_decode_usize(deserializer); var var_hnswLoaded = sse_decode_bool(deserializer); return BufferStats( - bufferSize: var_bufferSize, - threshold: var_threshold, - hnswLoaded: var_hnswLoaded, - ); + bufferSize: var_bufferSize, + threshold: var_threshold, + hnswLoaded: var_hnswLoaded); } @protected @@ -6873,13 +6027,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_chunkType = sse_decode_String(deserializer); var var_embedding = sse_decode_list_prim_f_32_strict(deserializer); return ChunkData( - content: var_content, - chunkIndex: var_chunkIndex, - startPos: var_startPos, - endPos: var_endPos, - chunkType: var_chunkType, - embedding: var_embedding, - ); + content: var_content, + chunkIndex: var_chunkIndex, + startPos: var_startPos, + endPos: var_endPos, + chunkType: var_chunkType, + embedding: var_embedding); } @protected @@ -6892,8 +6045,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected ChunkExcerptResult sse_decode_chunk_excerpt_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_chunkId = sse_decode_i_64(deserializer); var var_sourceId = sse_decode_i_64(deserializer); @@ -6902,19 +6054,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_headerPathPreview = sse_decode_opt_String(deserializer); var var_excerpt = sse_decode_String(deserializer); return ChunkExcerptResult( - chunkId: var_chunkId, - sourceId: var_sourceId, - chunkIndex: var_chunkIndex, - rawType: var_rawType, - headerPathPreview: var_headerPathPreview, - excerpt: var_excerpt, - ); + chunkId: var_chunkId, + sourceId: var_sourceId, + chunkIndex: var_chunkIndex, + rawType: var_rawType, + headerPathPreview: var_headerPathPreview, + excerpt: var_excerpt); } @protected ChunkForReembedding sse_decode_chunk_for_reembedding( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_chunkId = sse_decode_i_64(deserializer); var var_content = sse_decode_String(deserializer); @@ -6923,8 +6073,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected ChunkSearchResult sse_decode_chunk_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_chunkId = sse_decode_i_64(deserializer); var var_sourceId = sse_decode_i_64(deserializer); @@ -6934,14 +6083,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_similarity = sse_decode_f_64(deserializer); var var_metadata = sse_decode_opt_String(deserializer); return ChunkSearchResult( - chunkId: var_chunkId, - sourceId: var_sourceId, - chunkIndex: var_chunkIndex, - content: var_content, - chunkType: var_chunkType, - similarity: var_similarity, - metadata: var_metadata, - ); + chunkId: var_chunkId, + sourceId: var_sourceId, + chunkIndex: var_chunkIndex, + content: var_content, + chunkType: var_chunkType, + similarity: var_similarity, + metadata: var_metadata); } @protected @@ -6962,37 +6110,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_charsSavedStopwords = sse_decode_i_32(deserializer); var var_charsSavedTruncation = sse_decode_i_32(deserializer); return CompressedText( - text: var_text, - originalChars: var_originalChars, - compressedChars: var_compressedChars, - ratio: var_ratio, - sentencesRemoved: var_sentencesRemoved, - charsSavedStopwords: var_charsSavedStopwords, - charsSavedTruncation: var_charsSavedTruncation, - ); + text: var_text, + originalChars: var_originalChars, + compressedChars: var_compressedChars, + ratio: var_ratio, + sentencesRemoved: var_sentencesRemoved, + charsSavedStopwords: var_charsSavedStopwords, + charsSavedTruncation: var_charsSavedTruncation); } @protected CompressionOptions sse_decode_compression_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_removeStopwords = sse_decode_bool(deserializer); var var_removeDuplicates = sse_decode_bool(deserializer); var var_language = sse_decode_String(deserializer); var var_level = sse_decode_i_32(deserializer); return CompressionOptions( - removeStopwords: var_removeStopwords, - removeDuplicates: var_removeDuplicates, - language: var_language, - level: var_level, - ); + removeStopwords: var_removeStopwords, + removeDuplicates: var_removeDuplicates, + language: var_language, + level: var_level); } @protected ContextAssemblyStrategy sse_decode_context_assembly_strategy( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_i_32(deserializer); return ContextAssemblyStrategy.values[inner]; @@ -7000,8 +6144,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected EmbeddingFingerprintGate sse_decode_embedding_fingerprint_gate( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var tag_ = sse_decode_i_32(deserializer); @@ -7016,11 +6159,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_remainingChunks = sse_decode_i_64(deserializer); var var_resumeInProgress = sse_decode_bool(deserializer); return EmbeddingFingerprintGate_Mismatch( - stored: var_stored, - current: var_current, - remainingChunks: var_remainingChunks, - resumeInProgress: var_resumeInProgress, - ); + stored: var_stored, + current: var_current, + remainingChunks: var_remainingChunks, + resumeInProgress: var_resumeInProgress); default: throw UnimplementedError(''); } @@ -7041,9 +6183,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_chunkIndex = sse_decode_i_32(deserializer); var var_embeddingText = sse_decode_String(deserializer); return EmbeddingRequest( - chunkIndex: var_chunkIndex, - embeddingText: var_embeddingText, - ); + chunkIndex: var_chunkIndex, embeddingText: var_embeddingText); } @protected @@ -7068,8 +6208,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected HybridSearchResult sse_decode_hybrid_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_docId = sse_decode_i_64(deserializer); var var_content = sse_decode_String(deserializer); @@ -7080,15 +6219,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_metadata = sse_decode_opt_String(deserializer); var var_chunkIndex = sse_decode_u_32(deserializer); return HybridSearchResult( - docId: var_docId, - content: var_content, - score: var_score, - vectorRank: var_vectorRank, - bm25Rank: var_bm25Rank, - sourceId: var_sourceId, - metadata: var_metadata, - chunkIndex: var_chunkIndex, - ); + docId: var_docId, + content: var_content, + score: var_score, + vectorRank: var_vectorRank, + bm25Rank: var_bm25Rank, + sourceId: var_sourceId, + metadata: var_metadata, + chunkIndex: var_chunkIndex); } @protected @@ -7105,17 +6243,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IncrementalSearchResult sse_decode_incremental_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_docId = sse_decode_i_64(deserializer); var var_distance = sse_decode_f_32(deserializer); var var_source = sse_decode_String(deserializer); return IncrementalSearchResult( - docId: var_docId, - distance: var_distance, - source: var_source, - ); + docId: var_docId, distance: var_distance, source: var_source); } @protected @@ -7127,8 +6261,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IngestTrafficStats sse_decode_ingest_traffic_stats( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_legacyAddSourceInBytes = sse_decode_u_64(deserializer); var var_legacyAddSourceInCalls = sse_decode_u_64(deserializer); @@ -7145,21 +6278,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_sessionCommitEmbeddingsInBytes = sse_decode_u_64(deserializer); var var_sessionCommitEmbeddingsInCalls = sse_decode_u_64(deserializer); return IngestTrafficStats( - legacyAddSourceInBytes: var_legacyAddSourceInBytes, - legacyAddSourceInCalls: var_legacyAddSourceInCalls, - legacyChunkerTextInBytes: var_legacyChunkerTextInBytes, - legacyChunkerTextInCalls: var_legacyChunkerTextInCalls, - legacyChunkerChunksOutBytes: var_legacyChunkerChunksOutBytes, - legacyChunkerChunksOutCalls: var_legacyChunkerChunksOutCalls, - legacyAddChunksInBytes: var_legacyAddChunksInBytes, - legacyAddChunksInCalls: var_legacyAddChunksInCalls, - sessionPrepareContentInBytes: var_sessionPrepareContentInBytes, - sessionPrepareContentInCalls: var_sessionPrepareContentInCalls, - sessionEmbeddingTextOutBytes: var_sessionEmbeddingTextOutBytes, - sessionEmbeddingTextOutCalls: var_sessionEmbeddingTextOutCalls, - sessionCommitEmbeddingsInBytes: var_sessionCommitEmbeddingsInBytes, - sessionCommitEmbeddingsInCalls: var_sessionCommitEmbeddingsInCalls, - ); + legacyAddSourceInBytes: var_legacyAddSourceInBytes, + legacyAddSourceInCalls: var_legacyAddSourceInCalls, + legacyChunkerTextInBytes: var_legacyChunkerTextInBytes, + legacyChunkerTextInCalls: var_legacyChunkerTextInCalls, + legacyChunkerChunksOutBytes: var_legacyChunkerChunksOutBytes, + legacyChunkerChunksOutCalls: var_legacyChunkerChunksOutCalls, + legacyAddChunksInBytes: var_legacyAddChunksInBytes, + legacyAddChunksInCalls: var_legacyAddChunksInCalls, + sessionPrepareContentInBytes: var_sessionPrepareContentInBytes, + sessionPrepareContentInCalls: var_sessionPrepareContentInCalls, + sessionEmbeddingTextOutBytes: var_sessionEmbeddingTextOutBytes, + sessionEmbeddingTextOutCalls: var_sessionEmbeddingTextOutCalls, + sessionCommitEmbeddingsInBytes: var_sessionCommitEmbeddingsInBytes, + sessionCommitEmbeddingsInCalls: var_sessionCommitEmbeddingsInCalls); } @protected @@ -7176,8 +6308,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_bm_25_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7202,8 +6333,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_chunk_embedding( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7216,8 +6346,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_chunk_excerpt_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7230,8 +6359,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_chunk_for_reembedding( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7244,8 +6372,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_chunk_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7258,8 +6385,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_embedding_request( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7272,8 +6398,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_hnsw_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7286,8 +6411,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_hybrid_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7300,8 +6424,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_incremental_search_result( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7363,9 +6486,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List<(PlatformInt64, Float32List)> - sse_decode_list_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ) { + sse_decode_list_record_i_64_list_prim_f_32_strict( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7378,8 +6500,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List<(PlatformInt64, String)> sse_decode_list_record_i_64_string( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7392,8 +6513,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_search_hit_meta( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7406,8 +6526,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_semantic_chunk( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7432,8 +6551,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected List sse_decode_list_structured_chunk( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); @@ -7454,26 +6572,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_embeddingFingerprintPending = sse_decode_String(deserializer); var var_lastEngineVersion = sse_decode_String(deserializer); return MigrationAxes( - sqlSchemaVersion: var_sqlSchemaVersion, - hnswFormatVersion: var_hnswFormatVersion, - bm25StatsVersion: var_bm25StatsVersion, - embeddingFingerprint: var_embeddingFingerprint, - embeddingFingerprintPending: var_embeddingFingerprintPending, - lastEngineVersion: var_lastEngineVersion, - ); + sqlSchemaVersion: var_sqlSchemaVersion, + hnswFormatVersion: var_hnswFormatVersion, + bm25StatsVersion: var_bm25StatsVersion, + embeddingFingerprint: var_embeddingFingerprint, + embeddingFingerprintPending: var_embeddingFingerprintPending, + lastEngineVersion: var_lastEngineVersion); + } + + @protected + NativeRuntimeInfo sse_decode_native_runtime_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nativeAllocator = sse_decode_String(deserializer); + var var_rustFeatures = sse_decode_String(deserializer); + return NativeRuntimeInfo( + nativeAllocator: var_nativeAllocator, rustFeatures: var_rustFeatures); } @protected IngestSession? - sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ) { + sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { return (sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - deserializer, - )); + deserializer)); } else { return null; } @@ -7514,8 +6639,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected IngestStrategy? sse_decode_opt_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -7527,8 +6651,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (int, int, int)? sse_decode_opt_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -7540,8 +6663,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected RrfConfig? sse_decode_opt_box_autoadd_rrf_config( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -7553,8 +6675,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected SearchFilter? sse_decode_opt_box_autoadd_search_filter( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -7577,8 +6698,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected Int64List? sse_decode_opt_list_prim_i_64_strict( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -7596,17 +6716,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_isValid = sse_decode_bool(deserializer); var var_errorMessage = sse_decode_opt_String(deserializer); return ParsedIntent( - intentType: var_intentType, - query: var_query, - isValid: var_isValid, - errorMessage: var_errorMessage, - ); + intentType: var_intentType, + query: var_query, + isValid: var_isValid, + errorMessage: var_errorMessage); } @protected PreparedIngestion sse_decode_prepared_ingestion( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_sourceId = sse_decode_i_64(deserializer); var var_state = sse_decode_prepared_source_state(deserializer); @@ -7616,23 +6734,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_message = sse_decode_String(deserializer); var var_session = sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - deserializer, - ); + deserializer); return PreparedIngestion( - sourceId: var_sourceId, - state: var_state, - totalChunks: var_totalChunks, - bodyByteLength: var_bodyByteLength, - bodyCharLength: var_bodyCharLength, - message: var_message, - session: var_session, - ); + sourceId: var_sourceId, + state: var_state, + totalChunks: var_totalChunks, + bodyByteLength: var_bodyByteLength, + bodyCharLength: var_bodyCharLength, + message: var_message, + session: var_session); } @protected PreparedSourceState sse_decode_prepared_source_state( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_i_32(deserializer); return PreparedSourceState.values[inner]; @@ -7640,8 +6755,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected QueryContentReadStats sse_decode_query_content_read_stats( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_hybridResultRows = sse_decode_u_64(deserializer); var var_hybridResultContentBytes = sse_decode_u_64(deserializer); @@ -7656,30 +6770,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_scopedExactScanRows = sse_decode_u_64(deserializer); var var_scopedExactScanContentBytes = sse_decode_u_64(deserializer); var var_scopedExactScanTokenizedRows = sse_decode_u_64(deserializer); - var var_scopedExactScanTokenizedContentBytes = sse_decode_u_64( - deserializer, - ); + var var_scopedExactScanTokenizedContentBytes = + sse_decode_u_64(deserializer); var var_scopedExactScanTokens = sse_decode_u_64(deserializer); var var_scopedExactScanTokenizationNanos = sse_decode_u_64(deserializer); return QueryContentReadStats( - hybridResultRows: var_hybridResultRows, - hybridResultContentBytes: var_hybridResultContentBytes, - fullHydrateRows: var_fullHydrateRows, - fullHydrateContentBytes: var_fullHydrateContentBytes, - previewRows: var_previewRows, - previewContentBytes: var_previewContentBytes, - assemblyRows: var_assemblyRows, - assemblyContentBytes: var_assemblyContentBytes, - unclassifiedRows: var_unclassifiedRows, - unclassifiedContentBytes: var_unclassifiedContentBytes, - scopedExactScanRows: var_scopedExactScanRows, - scopedExactScanContentBytes: var_scopedExactScanContentBytes, - scopedExactScanTokenizedRows: var_scopedExactScanTokenizedRows, - scopedExactScanTokenizedContentBytes: - var_scopedExactScanTokenizedContentBytes, - scopedExactScanTokens: var_scopedExactScanTokens, - scopedExactScanTokenizationNanos: var_scopedExactScanTokenizationNanos, - ); + hybridResultRows: var_hybridResultRows, + hybridResultContentBytes: var_hybridResultContentBytes, + fullHydrateRows: var_fullHydrateRows, + fullHydrateContentBytes: var_fullHydrateContentBytes, + previewRows: var_previewRows, + previewContentBytes: var_previewContentBytes, + assemblyRows: var_assemblyRows, + assemblyContentBytes: var_assemblyContentBytes, + unclassifiedRows: var_unclassifiedRows, + unclassifiedContentBytes: var_unclassifiedContentBytes, + scopedExactScanRows: var_scopedExactScanRows, + scopedExactScanContentBytes: var_scopedExactScanContentBytes, + scopedExactScanTokenizedRows: var_scopedExactScanTokenizedRows, + scopedExactScanTokenizedContentBytes: + var_scopedExactScanTokenizedContentBytes, + scopedExactScanTokens: var_scopedExactScanTokens, + scopedExactScanTokenizationNanos: var_scopedExactScanTokenizationNanos); } @protected @@ -7714,19 +6826,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_field1 = sse_decode_i_64(deserializer); var var_field2 = sse_decode_i_64(deserializer); return RagError_UnsupportedMigrationVersion( - var_field0, - var_field1, - var_field2, - ); + var_field0, var_field1, var_field2); case 8: var var_field0 = sse_decode_String(deserializer); var var_field1 = sse_decode_String(deserializer); var var_field2 = sse_decode_i_64(deserializer); return RagError_EmbeddingFingerprintMismatch( - var_field0, - var_field1, - var_field2, - ); + var_field0, var_field1, var_field2); case 9: var var_field0 = sse_decode_String(deserializer); return RagError_Unknown(var_field0); @@ -7737,8 +6843,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (PlatformInt64, Float32List) sse_decode_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_field0 = sse_decode_i_64(deserializer); var var_field1 = sse_decode_list_prim_f_32_strict(deserializer); @@ -7747,8 +6852,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (PlatformInt64, String) sse_decode_record_i_64_string( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_field0 = sse_decode_i_64(deserializer); var var_field1 = sse_decode_String(deserializer); @@ -7757,8 +6861,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected (int, int, int) sse_decode_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_field0 = sse_decode_u_32(deserializer); var var_field1 = sse_decode_u_32(deserializer); @@ -7773,10 +6876,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_vectorWeight = sse_decode_f_64(deserializer); var var_bm25Weight = sse_decode_f_64(deserializer); return RrfConfig( - k: var_k, - vectorWeight: var_vectorWeight, - bm25Weight: var_bm25Weight, - ); + k: var_k, vectorWeight: var_vectorWeight, bm25Weight: var_bm25Weight); } @protected @@ -7786,10 +6886,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_metadataLike = sse_decode_opt_String(deserializer); var var_collectionId = sse_decode_opt_String(deserializer); return SearchFilter( - sourceIds: var_sourceIds, - metadataLike: var_metadataLike, - collectionId: var_collectionId, - ); + sourceIds: var_sourceIds, + metadataLike: var_metadataLike, + collectionId: var_collectionId); } @protected @@ -7802,19 +6901,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_rawType = sse_decode_String(deserializer); var var_headerPathPreview = sse_decode_opt_String(deserializer); return SearchHitMeta( - chunkId: var_chunkId, - sourceId: var_sourceId, - chunkIndex: var_chunkIndex, - similarity: var_similarity, - rawType: var_rawType, - headerPathPreview: var_headerPathPreview, - ); + chunkId: var_chunkId, + sourceId: var_sourceId, + chunkIndex: var_chunkIndex, + similarity: var_similarity, + rawType: var_rawType, + headerPathPreview: var_headerPathPreview); } @protected SearchMetaHybridOptions sse_decode_search_meta_hybrid_options( - SseDeserializer deserializer, - ) { + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_topK = sse_decode_u_32(deserializer); var var_vectorWeight = sse_decode_f_64(deserializer); @@ -7822,12 +6919,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_sourceIds = sse_decode_opt_list_prim_i_64_strict(deserializer); var var_adjacentChunks = sse_decode_i_32(deserializer); return SearchMetaHybridOptions( - topK: var_topK, - vectorWeight: var_vectorWeight, - bm25Weight: var_bm25Weight, - sourceIds: var_sourceIds, - adjacentChunks: var_adjacentChunks, - ); + topK: var_topK, + vectorWeight: var_vectorWeight, + bm25Weight: var_bm25Weight, + sourceIds: var_sourceIds, + adjacentChunks: var_adjacentChunks); } @protected @@ -7839,12 +6935,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_endPos = sse_decode_i_32(deserializer); var var_chunkType = sse_decode_String(deserializer); return SemanticChunk( - index: var_index, - content: var_content, - startPos: var_startPos, - endPos: var_endPos, - chunkType: var_chunkType, - ); + index: var_index, + content: var_content, + startPos: var_startPos, + endPos: var_endPos, + chunkType: var_chunkType); } @protected @@ -7857,13 +6952,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_status = sse_decode_opt_String(deserializer); var var_collectionId = sse_decode_String(deserializer); return SourceEntry( - id: var_id, - name: var_name, - createdAt: var_createdAt, - metadata: var_metadata, - status: var_status, - collectionId: var_collectionId, - ); + id: var_id, + name: var_name, + createdAt: var_createdAt, + metadata: var_metadata, + status: var_status, + collectionId: var_collectionId); } @protected @@ -7872,9 +6966,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_sourceCount = sse_decode_i_64(deserializer); var var_chunkCount = sse_decode_i_64(deserializer); return SourceStats( - sourceCount: var_sourceCount, - chunkCount: var_chunkCount, - ); + sourceCount: var_sourceCount, chunkCount: var_chunkCount); } @protected @@ -7890,16 +6982,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_batchIndex = sse_decode_opt_box_autoadd_i_32(deserializer); var var_batchTotal = sse_decode_opt_box_autoadd_i_32(deserializer); return StructuredChunk( - index: var_index, - content: var_content, - headerPath: var_headerPath, - chunkType: var_chunkType, - startPos: var_startPos, - endPos: var_endPos, - batchId: var_batchId, - batchIndex: var_batchIndex, - batchTotal: var_batchTotal, - ); + index: var_index, + content: var_content, + headerPath: var_headerPath, + chunkType: var_chunkType, + startPos: var_startPos, + endPos: var_endPos, + batchId: var_batchId, + batchIndex: var_batchIndex, + batchTotal: var_batchTotal); } @protected @@ -7947,9 +7038,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_command = sse_decode_String(deserializer); var var_reason = sse_decode_String(deserializer); return UserIntent_InvalidCommand( - command: var_command, - reason: var_reason, - ); + command: var_command, reason: var_reason); default: throw UnimplementedError(''); } @@ -7963,145 +7052,110 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_AnyhowException( - AnyhowException self, - SseSerializer serializer, - ) { + AnyhowException self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.message, serializer); } @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ) { + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - self, - serializer, - ); + self, serializer); } @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ) { + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - self, - serializer, - ); + self, serializer); } @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as IngestSessionImpl).frbInternalSseEncode(move: true), - serializer, - ); + (self as IngestSessionImpl).frbInternalSseEncode(move: true), + serializer); } @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as SearchHandleImpl).frbInternalSseEncode(move: true), - serializer, - ); + (self as SearchHandleImpl).frbInternalSseEncode(move: true), + serializer); } @protected void - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ) { + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as IngestSessionImpl).frbInternalSseEncode(move: false), - serializer, - ); + (self as IngestSessionImpl).frbInternalSseEncode(move: false), + serializer); } @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ) { + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as IngestSessionImpl).frbInternalSseEncode(move: false), - serializer, - ); + (self as IngestSessionImpl).frbInternalSseEncode(move: false), + serializer); } @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ) { + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as SearchHandleImpl).frbInternalSseEncode(move: false), - serializer, - ); + (self as SearchHandleImpl).frbInternalSseEncode(move: false), + serializer); } @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ) { + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as IngestSessionImpl).frbInternalSseEncode(move: null), - serializer, - ); + (self as IngestSessionImpl).frbInternalSseEncode(move: null), + serializer); } @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ) { + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize( - (self as SearchHandleImpl).frbInternalSseEncode(move: null), - serializer, - ); + (self as SearchHandleImpl).frbInternalSseEncode(move: null), + serializer); } @protected void sse_encode_StreamSink_String_Sse( - RustStreamSink self, - SseSerializer serializer, - ) { + RustStreamSink self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String( - self.setupAndSerialize( - codec: SseCodec( + self.setupAndSerialize( + codec: SseCodec( decodeSuccessData: sse_decode_String, decodeErrorData: sse_decode_AnyhowException, - ), - ), - serializer, - ); + )), + serializer); } @protected @@ -8110,11 +7164,27 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); } + @protected + void sse_encode_activation_timing_stats( + ActivationTimingStats self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_64(self.activateTotalNanos, serializer); + sse_encode_u_64(self.activateCount, serializer); + sse_encode_u_64(self.bm25RebuildNanos, serializer); + sse_encode_u_64(self.bm25RebuildCount, serializer); + sse_encode_u_64(self.hnswLoadNanos, serializer); + sse_encode_u_64(self.hnswLoadCount, serializer); + sse_encode_u_64(self.hnswLoadSuccessCount, serializer); + sse_encode_u_64(self.hnswLoadMissCount, serializer); + sse_encode_u_64(self.hnswRebuildNanos, serializer); + sse_encode_u_64(self.hnswRebuildCount, serializer); + sse_encode_u_64(self.hnswSaveNanos, serializer); + sse_encode_u_64(self.hnswSaveCount, serializer); + } + @protected void sse_encode_add_document_result( - AddDocumentResult self, - SseSerializer serializer, - ) { + AddDocumentResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self.success, serializer); sse_encode_bool(self.isDuplicate, serializer); @@ -8123,9 +7193,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_add_source_result( - AddSourceResult self, - SseSerializer serializer, - ) { + AddSourceResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.sourceId, serializer); sse_encode_bool(self.isDuplicate, serializer); @@ -8135,9 +7203,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ) { + AssembleContextOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.tokenBudget, serializer); sse_encode_context_assembly_strategy(self.strategy, serializer); @@ -8147,9 +7213,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_assembled_context_v_2( - AssembledContextV2 self, - SseSerializer serializer, - ) { + AssembledContextV2 self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.text, serializer); sse_encode_u_32(self.exactTokens, serializer); @@ -8160,9 +7224,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_bm_25_search_result( - Bm25SearchResult self, - SseSerializer serializer, - ) { + Bm25SearchResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.docId, serializer); sse_encode_f_64(self.score, serializer); @@ -8176,18 +7238,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_box_autoadd_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ) { + AssembleContextOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_assemble_context_options(self, serializer); } @protected void sse_encode_box_autoadd_compression_options( - CompressionOptions self, - SseSerializer serializer, - ) { + CompressionOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_compression_options(self, serializer); } @@ -8200,72 +7258,56 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_box_autoadd_i_64( - PlatformInt64 self, - SseSerializer serializer, - ) { + PlatformInt64 self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self, serializer); } @protected void sse_encode_box_autoadd_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ) { + IngestStrategy self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_ingest_strategy(self, serializer); } @protected void sse_encode_box_autoadd_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ) { + IngestTrafficStats self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_ingest_traffic_stats(self, serializer); } @protected void sse_encode_box_autoadd_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ) { + QueryContentReadStats self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_query_content_read_stats(self, serializer); } @protected void sse_encode_box_autoadd_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ) { + (int, int, int) self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_record_u_32_u_32_u_32(self, serializer); } @protected void sse_encode_box_autoadd_rrf_config( - RrfConfig self, - SseSerializer serializer, - ) { + RrfConfig self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_rrf_config(self, serializer); } @protected void sse_encode_box_autoadd_search_filter( - SearchFilter self, - SseSerializer serializer, - ) { + SearchFilter self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_search_filter(self, serializer); } @protected void sse_encode_box_autoadd_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ) { + SearchMetaHybridOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_search_meta_hybrid_options(self, serializer); } @@ -8278,9 +7320,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_box_autoadd_user_intent( - UserIntent self, - SseSerializer serializer, - ) { + UserIntent self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_user_intent(self, serializer); } @@ -8306,9 +7346,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_chunk_embedding( - ChunkEmbedding self, - SseSerializer serializer, - ) { + ChunkEmbedding self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.chunkIndex, serializer); sse_encode_list_prim_f_32_strict(self.embedding, serializer); @@ -8316,9 +7354,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_chunk_excerpt_result( - ChunkExcerptResult self, - SseSerializer serializer, - ) { + ChunkExcerptResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.chunkId, serializer); sse_encode_i_64(self.sourceId, serializer); @@ -8330,9 +7366,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_chunk_for_reembedding( - ChunkForReembedding self, - SseSerializer serializer, - ) { + ChunkForReembedding self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.chunkId, serializer); sse_encode_String(self.content, serializer); @@ -8340,9 +7374,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_chunk_search_result( - ChunkSearchResult self, - SseSerializer serializer, - ) { + ChunkSearchResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.chunkId, serializer); sse_encode_i_64(self.sourceId, serializer); @@ -8361,9 +7393,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_compressed_text( - CompressedText self, - SseSerializer serializer, - ) { + CompressedText self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.text, serializer); sse_encode_i_32(self.originalChars, serializer); @@ -8376,9 +7406,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_compression_options( - CompressionOptions self, - SseSerializer serializer, - ) { + CompressionOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self.removeStopwords, serializer); sse_encode_bool(self.removeDuplicates, serializer); @@ -8388,18 +7416,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_context_assembly_strategy( - ContextAssemblyStrategy self, - SseSerializer serializer, - ) { + ContextAssemblyStrategy self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); } @protected void sse_encode_embedding_fingerprint_gate( - EmbeddingFingerprintGate self, - SseSerializer serializer, - ) { + EmbeddingFingerprintGate self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs switch (self) { case EmbeddingFingerprintGate_RequiresInitialBaseline(): @@ -8407,11 +7431,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { case EmbeddingFingerprintGate_Ok(): sse_encode_i_32(1, serializer); case EmbeddingFingerprintGate_Mismatch( - stored: final stored, - current: final current, - remainingChunks: final remainingChunks, - resumeInProgress: final resumeInProgress, - ): + stored: final stored, + current: final current, + remainingChunks: final remainingChunks, + resumeInProgress: final resumeInProgress + ): sse_encode_i_32(2, serializer); sse_encode_String(stored, serializer); sse_encode_String(current, serializer); @@ -8422,9 +7446,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_embedding_point( - EmbeddingPoint self, - SseSerializer serializer, - ) { + EmbeddingPoint self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.id, serializer); sse_encode_list_prim_f_32_strict(self.embedding, serializer); @@ -8433,9 +7455,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_embedding_request( - EmbeddingRequest self, - SseSerializer serializer, - ) { + EmbeddingRequest self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.chunkIndex, serializer); sse_encode_String(self.embeddingText, serializer); @@ -8455,9 +7475,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_hnsw_search_result( - HnswSearchResult self, - SseSerializer serializer, - ) { + HnswSearchResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.id, serializer); sse_encode_f_32(self.distance, serializer); @@ -8465,9 +7483,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_hybrid_search_result( - HybridSearchResult self, - SseSerializer serializer, - ) { + HybridSearchResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.docId, serializer); sse_encode_String(self.content, serializer); @@ -8493,9 +7509,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_incremental_search_result( - IncrementalSearchResult self, - SseSerializer serializer, - ) { + IncrementalSearchResult self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.docId, serializer); sse_encode_f_32(self.distance, serializer); @@ -8504,18 +7518,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ) { + IngestStrategy self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); } @protected void sse_encode_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ) { + IngestTrafficStats self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_64(self.legacyAddSourceInBytes, serializer); sse_encode_u_64(self.legacyAddSourceInCalls, serializer); @@ -8544,9 +7554,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_bm_25_search_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8556,9 +7564,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_chunk_data( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8568,9 +7574,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_chunk_embedding( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8580,9 +7584,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_chunk_excerpt_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8592,9 +7594,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_chunk_for_reembedding( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8604,9 +7604,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_chunk_search_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8616,9 +7614,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_embedding_request( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8628,9 +7624,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_hnsw_search_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8640,9 +7634,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_hybrid_search_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8652,9 +7644,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_incremental_search_result( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8664,21 +7654,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_prim_f_32_loose( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); serializer.buffer.putFloat32List( - self is Float32List ? self : Float32List.fromList(self), - ); + self is Float32List ? self : Float32List.fromList(self)); } @protected void sse_encode_list_prim_f_32_strict( - Float32List self, - SseSerializer serializer, - ) { + Float32List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); serializer.buffer.putFloat32List(self); @@ -8686,9 +7671,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_prim_i_64_strict( - Int64List self, - SseSerializer serializer, - ) { + Int64List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); serializer.buffer.putInt64List(self); @@ -8696,21 +7679,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_prim_u_32_loose( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); - serializer.buffer.putUint32List( - self is Uint32List ? self : Uint32List.fromList(self), - ); + serializer.buffer + .putUint32List(self is Uint32List ? self : Uint32List.fromList(self)); } @protected void sse_encode_list_prim_u_32_strict( - Uint32List self, - SseSerializer serializer, - ) { + Uint32List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); serializer.buffer.putUint32List(self); @@ -8718,21 +7696,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_prim_u_8_loose( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); - serializer.buffer.putUint8List( - self is Uint8List ? self : Uint8List.fromList(self), - ); + serializer.buffer + .putUint8List(self is Uint8List ? self : Uint8List.fromList(self)); } @protected void sse_encode_list_prim_u_8_strict( - Uint8List self, - SseSerializer serializer, - ) { + Uint8List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); serializer.buffer.putUint8List(self); @@ -8740,9 +7713,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_record_i_64_list_prim_f_32_strict( - List<(PlatformInt64, Float32List)> self, - SseSerializer serializer, - ) { + List<(PlatformInt64, Float32List)> self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8752,9 +7723,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_record_i_64_string( - List<(PlatformInt64, String)> self, - SseSerializer serializer, - ) { + List<(PlatformInt64, String)> self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8764,9 +7733,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_search_hit_meta( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8776,9 +7743,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_semantic_chunk( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8788,9 +7753,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_source_entry( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8800,9 +7763,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_list_structured_chunk( - List self, - SseSerializer serializer, - ) { + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { @@ -8821,20 +7782,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_String(self.lastEngineVersion, serializer); } + @protected + void sse_encode_native_runtime_info( + NativeRuntimeInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.nativeAllocator, serializer); + sse_encode_String(self.rustFeatures, serializer); + } + @protected void - sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession? self, - SseSerializer serializer, - ) { + sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); if (self != null) { sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - self, - serializer, - ); + self, serializer); } } @@ -8860,9 +7825,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_box_autoadd_i_64( - PlatformInt64? self, - SseSerializer serializer, - ) { + PlatformInt64? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8873,9 +7836,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_box_autoadd_ingest_strategy( - IngestStrategy? self, - SseSerializer serializer, - ) { + IngestStrategy? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8886,9 +7847,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_box_autoadd_record_u_32_u_32_u_32( - (int, int, int)? self, - SseSerializer serializer, - ) { + (int, int, int)? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8899,9 +7858,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_box_autoadd_rrf_config( - RrfConfig? self, - SseSerializer serializer, - ) { + RrfConfig? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8912,9 +7869,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_box_autoadd_search_filter( - SearchFilter? self, - SseSerializer serializer, - ) { + SearchFilter? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8935,9 +7890,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_opt_list_prim_i_64_strict( - Int64List? self, - SseSerializer serializer, - ) { + Int64List? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -8957,9 +7910,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_prepared_ingestion( - PreparedIngestion self, - SseSerializer serializer, - ) { + PreparedIngestion self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.sourceId, serializer); sse_encode_prepared_source_state(self.state, serializer); @@ -8968,25 +7919,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_i_32(self.bodyCharLength, serializer); sse_encode_String(self.message, serializer); sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - self.session, - serializer, - ); + self.session, serializer); } @protected void sse_encode_prepared_source_state( - PreparedSourceState self, - SseSerializer serializer, - ) { + PreparedSourceState self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); } @protected void sse_encode_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ) { + QueryContentReadStats self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_64(self.hybridResultRows, serializer); sse_encode_u_64(self.hybridResultContentBytes, serializer); @@ -9032,19 +7977,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_i_32(6, serializer); sse_encode_String(field0, serializer); case RagError_UnsupportedMigrationVersion( - field0: final field0, - field1: final field1, - field2: final field2, - ): + field0: final field0, + field1: final field1, + field2: final field2 + ): sse_encode_i_32(7, serializer); sse_encode_String(field0, serializer); sse_encode_i_64(field1, serializer); sse_encode_i_64(field2, serializer); case RagError_EmbeddingFingerprintMismatch( - field0: final field0, - field1: final field1, - field2: final field2, - ): + field0: final field0, + field1: final field1, + field2: final field2 + ): sse_encode_i_32(8, serializer); sse_encode_String(field0, serializer); sse_encode_String(field1, serializer); @@ -9057,9 +8002,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_record_i_64_list_prim_f_32_strict( - (PlatformInt64, Float32List) self, - SseSerializer serializer, - ) { + (PlatformInt64, Float32List) self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.$1, serializer); sse_encode_list_prim_f_32_strict(self.$2, serializer); @@ -9067,9 +8010,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_record_i_64_string( - (PlatformInt64, String) self, - SseSerializer serializer, - ) { + (PlatformInt64, String) self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.$1, serializer); sse_encode_String(self.$2, serializer); @@ -9077,9 +8018,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ) { + (int, int, int) self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_32(self.$1, serializer); sse_encode_u_32(self.$2, serializer); @@ -9104,9 +8043,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_search_hit_meta( - SearchHitMeta self, - SseSerializer serializer, - ) { + SearchHitMeta self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_64(self.chunkId, serializer); sse_encode_i_64(self.sourceId, serializer); @@ -9118,9 +8055,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ) { + SearchMetaHybridOptions self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_32(self.topK, serializer); sse_encode_f_64(self.vectorWeight, serializer); @@ -9159,9 +8094,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_structured_chunk( - StructuredChunk self, - SseSerializer serializer, - ) { + StructuredChunk self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); sse_encode_String(self.content, serializer); @@ -9214,9 +8147,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_i_32(3, serializer); sse_encode_String(query, serializer); case UserIntent_InvalidCommand( - command: final command, - reason: final reason, - ): + command: final command, + reason: final reason + ): sse_encode_i_32(4, serializer); sse_encode_String(command, serializer); sse_encode_String(reason, serializer); @@ -9234,11 +8167,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { class IngestSessionImpl extends RustOpaque implements IngestSession { // Not to be used by end users IngestSessionImpl.frbInternalDcoDecode(List wire) - : super.frbInternalDcoDecode(wire, _kStaticData); + : super.frbInternalDcoDecode(wire, _kStaticData); // Not to be used by end users IngestSessionImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) - : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); static final _kStaticData = RustArcStaticData( rustArcIncrementStrongCount: @@ -9253,7 +8186,9 @@ class IngestSessionImpl extends RustOpaque implements IngestSession { /// source `failed`, and drop staged content. Idempotent after the first /// call; no-op once the session is finalized. Future abort() => - RustLib.instance.api.crateApiIngestSessionIngestSessionAbort(that: this); + RustLib.instance.api.crateApiIngestSessionIngestSessionAbort( + that: this, + ); /// Flush the current in-flight batch to the chunks table using the /// provided embeddings. Returns the number of chunks written. @@ -9262,29 +8197,39 @@ class IngestSessionImpl extends RustOpaque implements IngestSession { /// embedding payload does not lose chunk content. Future commitEmbeddings({required List embeddings}) => RustLib.instance.api.crateApiIngestSessionIngestSessionCommitEmbeddings( + that: this, embeddings: embeddings); + + Future committedCount() => + RustLib.instance.api.crateApiIngestSessionIngestSessionCommittedCount( that: this, - embeddings: embeddings, ); - Future committedCount() => RustLib.instance.api - .crateApiIngestSessionIngestSessionCommittedCount(that: this); - /// Explicit drop to release the Rust handle from Dart. - Future dispose() => RustLib.instance.api - .crateApiIngestSessionIngestSessionDispose(that: this); + Future dispose() => + RustLib.instance.api.crateApiIngestSessionIngestSessionDispose( + that: this, + ); /// Mark the source `completed`. Errors if any chunks are still pending or in flight. - Future finalize() => RustLib.instance.api - .crateApiIngestSessionIngestSessionFinalize(that: this); + Future finalize() => + RustLib.instance.api.crateApiIngestSessionIngestSessionFinalize( + that: this, + ); - Future inFlightCount() => RustLib.instance.api - .crateApiIngestSessionIngestSessionInFlightCount(that: this); + Future inFlightCount() => + RustLib.instance.api.crateApiIngestSessionIngestSessionInFlightCount( + that: this, + ); Future pendingDispatchCount() => RustLib.instance.api - .crateApiIngestSessionIngestSessionPendingDispatchCount(that: this); + .crateApiIngestSessionIngestSessionPendingDispatchCount( + that: this, + ); - Future sourceId() => RustLib.instance.api - .crateApiIngestSessionIngestSessionSourceId(that: this); + Future sourceId() => + RustLib.instance.api.crateApiIngestSessionIngestSessionSourceId( + that: this, + ); /// Drain up to `batch_size` chunks from the pending queue. Each chunk's /// `embedding_text` is computed from its stored content+chunk_type and @@ -9294,23 +8239,23 @@ class IngestSessionImpl extends RustOpaque implements IngestSession { /// Errors if a previous batch is still in flight (single-batch discipline). Future> takeEmbeddingBatch({required int batchSize}) => RustLib.instance.api.crateApiIngestSessionIngestSessionTakeEmbeddingBatch( - that: this, - batchSize: batchSize, - ); + that: this, batchSize: batchSize); Future total() => - RustLib.instance.api.crateApiIngestSessionIngestSessionTotal(that: this); + RustLib.instance.api.crateApiIngestSessionIngestSessionTotal( + that: this, + ); } @sealed class SearchHandleImpl extends RustOpaque implements SearchHandle { // Not to be used by end users SearchHandleImpl.frbInternalDcoDecode(List wire) - : super.frbInternalDcoDecode(wire, _kStaticData); + : super.frbInternalDcoDecode(wire, _kStaticData); // Not to be used by end users SearchHandleImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) - : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); static final _kStaticData = RustArcStaticData( rustArcIncrementStrongCount: @@ -9321,32 +8266,28 @@ class SearchHandleImpl extends RustOpaque implements SearchHandle { RustLib.instance.api.rust_arc_decrement_strong_count_SearchHandlePtr, ); - Future assembleContext({ - required AssembleContextOptions options, - }) => RustLib.instance.api.crateApiSourceRagSearchHandleAssembleContext( - that: this, - options: options, - ); + Future assembleContext( + {required AssembleContextOptions options}) => + RustLib.instance.api.crateApiSourceRagSearchHandleAssembleContext( + that: this, options: options); Future dispose() => - RustLib.instance.api.crateApiSourceRagSearchHandleDispose(that: this); - - Future> getChunkExcerpts({ - required Int64List chunkIds, - required int maxBytes, - }) => RustLib.instance.api.crateApiSourceRagSearchHandleGetChunkExcerpts( - that: this, - chunkIds: chunkIds, - maxBytes: maxBytes, - ); + RustLib.instance.api.crateApiSourceRagSearchHandleDispose( + that: this, + ); + + Future> getChunkExcerpts( + {required Int64List chunkIds, required int maxBytes}) => + RustLib.instance.api.crateApiSourceRagSearchHandleGetChunkExcerpts( + that: this, chunkIds: chunkIds, maxBytes: maxBytes); Future> hitMeta() => - RustLib.instance.api.crateApiSourceRagSearchHandleHitMeta(that: this); + RustLib.instance.api.crateApiSourceRagSearchHandleHitMeta( + that: this, + ); - Future> hydrateChunks({ - required Int64List chunkIds, - }) => RustLib.instance.api.crateApiSourceRagSearchHandleHydrateChunks( - that: this, - chunkIds: chunkIds, - ); + Future> hydrateChunks( + {required Int64List chunkIds}) => + RustLib.instance.api.crateApiSourceRagSearchHandleHydrateChunks( + that: this, chunkIds: chunkIds); } diff --git a/lib/src/rust/frb_generated.io.dart b/lib/src/rust/frb_generated.io.dart index 310b0cb..f2a9f91 100644 --- a/lib/src/rust/frb_generated.io.dart +++ b/lib/src/rust/frb_generated.io.dart @@ -3,6 +3,7 @@ // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field +import 'api/activation_metrics.dart'; import 'api/bm25_search.dart'; import 'api/compression_utils.dart'; import 'api/db_pool.dart'; @@ -16,6 +17,7 @@ import 'api/ingest_session.dart'; import 'api/logger.dart'; import 'api/migration_meta.dart'; import 'api/query_metrics.dart'; +import 'api/runtime_info.dart'; import 'api/semantic_chunker.dart'; import 'api/simple.dart'; import 'api/simple_rag.dart'; @@ -37,69 +39,60 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { }); CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_IngestSessionPtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr; + get rust_arc_decrement_strong_count_IngestSessionPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_SearchHandlePtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr; + get rust_arc_decrement_strong_count_SearchHandlePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr; @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @protected IngestSession - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected IngestSession - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected RustStreamSink dco_decode_StreamSink_String_Sse(dynamic raw); @@ -107,6 +100,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected String dco_decode_String(dynamic raw); + @protected + ActivationTimingStats dco_decode_activation_timing_stats(dynamic raw); + @protected AddDocumentResult dco_decode_add_document_result(dynamic raw); @@ -127,8 +123,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AssembleContextOptions dco_decode_box_autoadd_assemble_context_options( - dynamic raw, - ); + dynamic raw); @protected CompressionOptions dco_decode_box_autoadd_compression_options(dynamic raw); @@ -147,8 +142,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected QueryContentReadStats dco_decode_box_autoadd_query_content_read_stats( - dynamic raw, - ); + dynamic raw); @protected (int, int, int) dco_decode_box_autoadd_record_u_32_u_32_u_32(dynamic raw); @@ -161,8 +155,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected SearchMetaHybridOptions dco_decode_box_autoadd_search_meta_hybrid_options( - dynamic raw, - ); + dynamic raw); @protected int dco_decode_box_autoadd_u_32(dynamic raw); @@ -268,8 +261,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_incremental_search_result( - dynamic raw, - ); + dynamic raw); @protected List dco_decode_list_prim_f_32_loose(dynamic raw); @@ -294,7 +286,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List<(PlatformInt64, Float32List)> - dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw); + dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw); @protected List<(PlatformInt64, String)> dco_decode_list_record_i_64_string(dynamic raw); @@ -314,11 +306,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected MigrationAxes dco_decode_migration_axes(dynamic raw); + @protected + NativeRuntimeInfo dco_decode_native_runtime_info(dynamic raw); + @protected IngestSession? - dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); @@ -334,8 +328,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected (int, int, int)? dco_decode_opt_box_autoadd_record_u_32_u_32_u_32( - dynamic raw, - ); + dynamic raw); @protected RrfConfig? dco_decode_opt_box_autoadd_rrf_config(dynamic raw); @@ -366,8 +359,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected (PlatformInt64, Float32List) dco_decode_record_i_64_list_prim_f_32_strict( - dynamic raw, - ); + dynamic raw); @protected (PlatformInt64, String) dco_decode_record_i_64_string(dynamic raw); @@ -422,83 +414,74 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestSession - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected RustStreamSink sse_decode_StreamSink_String_Sse( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected String sse_decode_String(SseDeserializer deserializer); + @protected + ActivationTimingStats sse_decode_activation_timing_stats( + SseDeserializer deserializer); + @protected AddDocumentResult sse_decode_add_document_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected AddSourceResult sse_decode_add_source_result(SseDeserializer deserializer); @protected AssembleContextOptions sse_decode_assemble_context_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected AssembledContextV2 sse_decode_assembled_context_v_2( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected Bm25SearchResult sse_decode_bm_25_search_result(SseDeserializer deserializer); @@ -508,13 +491,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AssembleContextOptions sse_decode_box_autoadd_assemble_context_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected CompressionOptions sse_decode_box_autoadd_compression_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_box_autoadd_i_32(SseDeserializer deserializer); @@ -524,36 +505,30 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestStrategy sse_decode_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected IngestTrafficStats sse_decode_box_autoadd_ingest_traffic_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected QueryContentReadStats sse_decode_box_autoadd_query_content_read_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int) sse_decode_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig sse_decode_box_autoadd_rrf_config(SseDeserializer deserializer); @protected SearchFilter sse_decode_box_autoadd_search_filter( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SearchMetaHybridOptions sse_decode_box_autoadd_search_meta_hybrid_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); @@ -572,18 +547,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected ChunkExcerptResult sse_decode_chunk_excerpt_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkForReembedding sse_decode_chunk_for_reembedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkSearchResult sse_decode_chunk_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkType sse_decode_chunk_type(SseDeserializer deserializer); @@ -593,18 +565,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected CompressionOptions sse_decode_compression_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ContextAssemblyStrategy sse_decode_context_assembly_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected EmbeddingFingerprintGate sse_decode_embedding_fingerprint_gate( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected EmbeddingPoint sse_decode_embedding_point(SseDeserializer deserializer); @@ -623,8 +592,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected HybridSearchResult sse_decode_hybrid_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_i_32(SseDeserializer deserializer); @@ -634,67 +602,56 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IncrementalSearchResult sse_decode_incremental_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected IngestStrategy sse_decode_ingest_strategy(SseDeserializer deserializer); @protected IngestTrafficStats sse_decode_ingest_traffic_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_String(SseDeserializer deserializer); @protected List sse_decode_list_bm_25_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_data(SseDeserializer deserializer); @protected List sse_decode_list_chunk_embedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_excerpt_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_for_reembedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_embedding_request( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_hnsw_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_hybrid_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_incremental_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_prim_f_32_loose(SseDeserializer deserializer); @@ -719,41 +676,39 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List<(PlatformInt64, Float32List)> - sse_decode_list_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ); + sse_decode_list_record_i_64_list_prim_f_32_strict( + SseDeserializer deserializer); @protected List<(PlatformInt64, String)> sse_decode_list_record_i_64_string( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_search_hit_meta( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_semantic_chunk( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_source_entry(SseDeserializer deserializer); @protected List sse_decode_list_structured_chunk( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected MigrationAxes sse_decode_migration_axes(SseDeserializer deserializer); + @protected + NativeRuntimeInfo sse_decode_native_runtime_info( + SseDeserializer deserializer); + @protected IngestSession? - sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -766,23 +721,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestStrategy? sse_decode_opt_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int)? sse_decode_opt_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig? sse_decode_opt_box_autoadd_rrf_config( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SearchFilter? sse_decode_opt_box_autoadd_search_filter( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); @@ -798,31 +749,26 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PreparedSourceState sse_decode_prepared_source_state( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected QueryContentReadStats sse_decode_query_content_read_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RagError sse_decode_rag_error(SseDeserializer deserializer); @protected (PlatformInt64, Float32List) sse_decode_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (PlatformInt64, String) sse_decode_record_i_64_string( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int) sse_decode_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig sse_decode_rrf_config(SseDeserializer deserializer); @@ -835,8 +781,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected SearchMetaHybridOptions sse_decode_search_meta_hybrid_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SemanticChunk sse_decode_semantic_chunk(SseDeserializer deserializer); @@ -870,186 +815,136 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_AnyhowException( - AnyhowException self, - SseSerializer serializer, - ); + AnyhowException self, SseSerializer serializer); @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void sse_encode_StreamSink_String_Sse( - RustStreamSink self, - SseSerializer serializer, - ); + RustStreamSink self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); + @protected + void sse_encode_activation_timing_stats( + ActivationTimingStats self, SseSerializer serializer); + @protected void sse_encode_add_document_result( - AddDocumentResult self, - SseSerializer serializer, - ); + AddDocumentResult self, SseSerializer serializer); @protected void sse_encode_add_source_result( - AddSourceResult self, - SseSerializer serializer, - ); + AddSourceResult self, SseSerializer serializer); @protected void sse_encode_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ); + AssembleContextOptions self, SseSerializer serializer); @protected void sse_encode_assembled_context_v_2( - AssembledContextV2 self, - SseSerializer serializer, - ); + AssembledContextV2 self, SseSerializer serializer); @protected void sse_encode_bm_25_search_result( - Bm25SearchResult self, - SseSerializer serializer, - ); + Bm25SearchResult self, SseSerializer serializer); @protected void sse_encode_bool(bool self, SseSerializer serializer); @protected void sse_encode_box_autoadd_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ); + AssembleContextOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_compression_options( - CompressionOptions self, - SseSerializer serializer, - ); + CompressionOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_i_32(int self, SseSerializer serializer); @protected void sse_encode_box_autoadd_i_64( - PlatformInt64 self, - SseSerializer serializer, - ); + PlatformInt64 self, SseSerializer serializer); @protected void sse_encode_box_autoadd_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ); + IngestStrategy self, SseSerializer serializer); @protected void sse_encode_box_autoadd_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ); + IngestTrafficStats self, SseSerializer serializer); @protected void sse_encode_box_autoadd_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ); + QueryContentReadStats self, SseSerializer serializer); @protected void sse_encode_box_autoadd_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ); + (int, int, int) self, SseSerializer serializer); @protected void sse_encode_box_autoadd_rrf_config( - RrfConfig self, - SseSerializer serializer, - ); + RrfConfig self, SseSerializer serializer); @protected void sse_encode_box_autoadd_search_filter( - SearchFilter self, - SseSerializer serializer, - ); + SearchFilter self, SseSerializer serializer); @protected void sse_encode_box_autoadd_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ); + SearchMetaHybridOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); @protected void sse_encode_box_autoadd_user_intent( - UserIntent self, - SseSerializer serializer, - ); + UserIntent self, SseSerializer serializer); @protected void sse_encode_buffer_stats(BufferStats self, SseSerializer serializer); @@ -1059,66 +954,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_chunk_embedding( - ChunkEmbedding self, - SseSerializer serializer, - ); + ChunkEmbedding self, SseSerializer serializer); @protected void sse_encode_chunk_excerpt_result( - ChunkExcerptResult self, - SseSerializer serializer, - ); + ChunkExcerptResult self, SseSerializer serializer); @protected void sse_encode_chunk_for_reembedding( - ChunkForReembedding self, - SseSerializer serializer, - ); + ChunkForReembedding self, SseSerializer serializer); @protected void sse_encode_chunk_search_result( - ChunkSearchResult self, - SseSerializer serializer, - ); + ChunkSearchResult self, SseSerializer serializer); @protected void sse_encode_chunk_type(ChunkType self, SseSerializer serializer); @protected void sse_encode_compressed_text( - CompressedText self, - SseSerializer serializer, - ); + CompressedText self, SseSerializer serializer); @protected void sse_encode_compression_options( - CompressionOptions self, - SseSerializer serializer, - ); + CompressionOptions self, SseSerializer serializer); @protected void sse_encode_context_assembly_strategy( - ContextAssemblyStrategy self, - SseSerializer serializer, - ); + ContextAssemblyStrategy self, SseSerializer serializer); @protected void sse_encode_embedding_fingerprint_gate( - EmbeddingFingerprintGate self, - SseSerializer serializer, - ); + EmbeddingFingerprintGate self, SseSerializer serializer); @protected void sse_encode_embedding_point( - EmbeddingPoint self, - SseSerializer serializer, - ); + EmbeddingPoint self, SseSerializer serializer); @protected void sse_encode_embedding_request( - EmbeddingRequest self, - SseSerializer serializer, - ); + EmbeddingRequest self, SseSerializer serializer); @protected void sse_encode_f_32(double self, SseSerializer serializer); @@ -1128,15 +1003,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_hnsw_search_result( - HnswSearchResult self, - SseSerializer serializer, - ); + HnswSearchResult self, SseSerializer serializer); @protected void sse_encode_hybrid_search_result( - HybridSearchResult self, - SseSerializer serializer, - ); + HybridSearchResult self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); @@ -1146,169 +1017,121 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_incremental_search_result( - IncrementalSearchResult self, - SseSerializer serializer, - ); + IncrementalSearchResult self, SseSerializer serializer); @protected void sse_encode_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ); + IngestStrategy self, SseSerializer serializer); @protected void sse_encode_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ); + IngestTrafficStats self, SseSerializer serializer); @protected void sse_encode_list_String(List self, SseSerializer serializer); @protected void sse_encode_list_bm_25_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_data( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_embedding( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_excerpt_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_for_reembedding( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_embedding_request( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_hnsw_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_hybrid_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_incremental_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_f_32_loose( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_f_32_strict( - Float32List self, - SseSerializer serializer, - ); + Float32List self, SseSerializer serializer); @protected void sse_encode_list_prim_i_64_strict( - Int64List self, - SseSerializer serializer, - ); + Int64List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_32_loose( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_32_strict( - Uint32List self, - SseSerializer serializer, - ); + Uint32List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_8_strict( - Uint8List self, - SseSerializer serializer, - ); + Uint8List self, SseSerializer serializer); @protected void sse_encode_list_record_i_64_list_prim_f_32_strict( - List<(PlatformInt64, Float32List)> self, - SseSerializer serializer, - ); + List<(PlatformInt64, Float32List)> self, SseSerializer serializer); @protected void sse_encode_list_record_i_64_string( - List<(PlatformInt64, String)> self, - SseSerializer serializer, - ); + List<(PlatformInt64, String)> self, SseSerializer serializer); @protected void sse_encode_list_search_hit_meta( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_semantic_chunk( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_source_entry( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_structured_chunk( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_migration_axes(MigrationAxes self, SseSerializer serializer); + @protected + void sse_encode_native_runtime_info( + NativeRuntimeInfo self, SseSerializer serializer); + @protected void - sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession? self, - SseSerializer serializer, - ); + sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession? self, SseSerializer serializer); @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -1318,84 +1141,60 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_opt_box_autoadd_i_64( - PlatformInt64? self, - SseSerializer serializer, - ); + PlatformInt64? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_ingest_strategy( - IngestStrategy? self, - SseSerializer serializer, - ); + IngestStrategy? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_record_u_32_u_32_u_32( - (int, int, int)? self, - SseSerializer serializer, - ); + (int, int, int)? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_rrf_config( - RrfConfig? self, - SseSerializer serializer, - ); + RrfConfig? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_search_filter( - SearchFilter? self, - SseSerializer serializer, - ); + SearchFilter? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); @protected void sse_encode_opt_list_prim_i_64_strict( - Int64List? self, - SseSerializer serializer, - ); + Int64List? self, SseSerializer serializer); @protected void sse_encode_parsed_intent(ParsedIntent self, SseSerializer serializer); @protected void sse_encode_prepared_ingestion( - PreparedIngestion self, - SseSerializer serializer, - ); + PreparedIngestion self, SseSerializer serializer); @protected void sse_encode_prepared_source_state( - PreparedSourceState self, - SseSerializer serializer, - ); + PreparedSourceState self, SseSerializer serializer); @protected void sse_encode_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ); + QueryContentReadStats self, SseSerializer serializer); @protected void sse_encode_rag_error(RagError self, SseSerializer serializer); @protected void sse_encode_record_i_64_list_prim_f_32_strict( - (PlatformInt64, Float32List) self, - SseSerializer serializer, - ); + (PlatformInt64, Float32List) self, SseSerializer serializer); @protected void sse_encode_record_i_64_string( - (PlatformInt64, String) self, - SseSerializer serializer, - ); + (PlatformInt64, String) self, SseSerializer serializer); @protected void sse_encode_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ); + (int, int, int) self, SseSerializer serializer); @protected void sse_encode_rrf_config(RrfConfig self, SseSerializer serializer); @@ -1408,9 +1207,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ); + SearchMetaHybridOptions self, SseSerializer serializer); @protected void sse_encode_semantic_chunk(SemanticChunk self, SseSerializer serializer); @@ -1423,9 +1220,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_structured_chunk( - StructuredChunk self, - SseSerializer serializer, - ); + StructuredChunk self, SseSerializer serializer); @protected void sse_encode_u_32(int self, SseSerializer serializer); @@ -1454,14 +1249,14 @@ class RustLibWire implements BaseWire { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) - _lookup; + _lookup; /// The symbols are looked up in [dynamicLibrary]. RustLibWire(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + : _lookup = dynamicLibrary.lookup; void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( ffi.Pointer ptr, ) { return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( @@ -1471,14 +1266,13 @@ class RustLibWire implements BaseWire { late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr = _lookup)>>( - 'frbgen_mobile_rag_engine_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession', - ); + 'frbgen_mobile_rag_engine_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession'); late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession = _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr .asFunction)>(); void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( ffi.Pointer ptr, ) { return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( @@ -1488,14 +1282,13 @@ class RustLibWire implements BaseWire { late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr = _lookup)>>( - 'frbgen_mobile_rag_engine_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession', - ); + 'frbgen_mobile_rag_engine_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession'); late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession = _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSessionPtr .asFunction)>(); void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( ffi.Pointer ptr, ) { return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( @@ -1505,14 +1298,13 @@ class RustLibWire implements BaseWire { late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr = _lookup)>>( - 'frbgen_mobile_rag_engine_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle', - ); + 'frbgen_mobile_rag_engine_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle'); late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle = _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr .asFunction)>(); void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( ffi.Pointer ptr, ) { return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( @@ -1522,8 +1314,7 @@ class RustLibWire implements BaseWire { late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr = _lookup)>>( - 'frbgen_mobile_rag_engine_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle', - ); + 'frbgen_mobile_rag_engine_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle'); late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle = _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandlePtr .asFunction)>(); diff --git a/lib/src/rust/frb_generated.web.dart b/lib/src/rust/frb_generated.web.dart index a6cc11b..01de4be 100644 --- a/lib/src/rust/frb_generated.web.dart +++ b/lib/src/rust/frb_generated.web.dart @@ -6,6 +6,7 @@ // Static analysis wrongly picks the IO variant, thus ignore this // ignore_for_file: argument_type_not_assignable +import 'api/activation_metrics.dart'; import 'api/bm25_search.dart'; import 'api/compression_utils.dart'; import 'api/db_pool.dart'; @@ -19,6 +20,7 @@ import 'api/ingest_session.dart'; import 'api/logger.dart'; import 'api/migration_meta.dart'; import 'api/query_metrics.dart'; +import 'api/runtime_info.dart'; import 'api/semantic_chunker.dart'; import 'api/simple.dart'; import 'api/simple_rag.dart'; @@ -39,69 +41,60 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { }); CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_IngestSessionPtr => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; + get rust_arc_decrement_strong_count_IngestSessionPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_SearchHandlePtr => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; + get rust_arc_decrement_strong_count_SearchHandlePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle; @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @protected IngestSession - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected IngestSession - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected IngestSession - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected SearchHandle - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - dynamic raw, - ); + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + dynamic raw); @protected RustStreamSink dco_decode_StreamSink_String_Sse(dynamic raw); @@ -109,6 +102,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected String dco_decode_String(dynamic raw); + @protected + ActivationTimingStats dco_decode_activation_timing_stats(dynamic raw); + @protected AddDocumentResult dco_decode_add_document_result(dynamic raw); @@ -129,8 +125,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AssembleContextOptions dco_decode_box_autoadd_assemble_context_options( - dynamic raw, - ); + dynamic raw); @protected CompressionOptions dco_decode_box_autoadd_compression_options(dynamic raw); @@ -149,8 +144,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected QueryContentReadStats dco_decode_box_autoadd_query_content_read_stats( - dynamic raw, - ); + dynamic raw); @protected (int, int, int) dco_decode_box_autoadd_record_u_32_u_32_u_32(dynamic raw); @@ -163,8 +157,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected SearchMetaHybridOptions dco_decode_box_autoadd_search_meta_hybrid_options( - dynamic raw, - ); + dynamic raw); @protected int dco_decode_box_autoadd_u_32(dynamic raw); @@ -270,8 +263,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_incremental_search_result( - dynamic raw, - ); + dynamic raw); @protected List dco_decode_list_prim_f_32_loose(dynamic raw); @@ -296,7 +288,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List<(PlatformInt64, Float32List)> - dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw); + dco_decode_list_record_i_64_list_prim_f_32_strict(dynamic raw); @protected List<(PlatformInt64, String)> dco_decode_list_record_i_64_string(dynamic raw); @@ -316,11 +308,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected MigrationAxes dco_decode_migration_axes(dynamic raw); + @protected + NativeRuntimeInfo dco_decode_native_runtime_info(dynamic raw); + @protected IngestSession? - dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - dynamic raw, - ); + dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); @@ -336,8 +330,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected (int, int, int)? dco_decode_opt_box_autoadd_record_u_32_u_32_u_32( - dynamic raw, - ); + dynamic raw); @protected RrfConfig? dco_decode_opt_box_autoadd_rrf_config(dynamic raw); @@ -368,8 +361,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected (PlatformInt64, Float32List) dco_decode_record_i_64_list_prim_f_32_strict( - dynamic raw, - ); + dynamic raw); @protected (PlatformInt64, String) dco_decode_record_i_64_string(dynamic raw); @@ -424,83 +416,74 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestSession - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected IngestSession - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected IngestSession - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected SearchHandle - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SseDeserializer deserializer, - ); + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SseDeserializer deserializer); @protected RustStreamSink sse_decode_StreamSink_String_Sse( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected String sse_decode_String(SseDeserializer deserializer); + @protected + ActivationTimingStats sse_decode_activation_timing_stats( + SseDeserializer deserializer); + @protected AddDocumentResult sse_decode_add_document_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected AddSourceResult sse_decode_add_source_result(SseDeserializer deserializer); @protected AssembleContextOptions sse_decode_assemble_context_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected AssembledContextV2 sse_decode_assembled_context_v_2( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected Bm25SearchResult sse_decode_bm_25_search_result(SseDeserializer deserializer); @@ -510,13 +493,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AssembleContextOptions sse_decode_box_autoadd_assemble_context_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected CompressionOptions sse_decode_box_autoadd_compression_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_box_autoadd_i_32(SseDeserializer deserializer); @@ -526,36 +507,30 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestStrategy sse_decode_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected IngestTrafficStats sse_decode_box_autoadd_ingest_traffic_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected QueryContentReadStats sse_decode_box_autoadd_query_content_read_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int) sse_decode_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig sse_decode_box_autoadd_rrf_config(SseDeserializer deserializer); @protected SearchFilter sse_decode_box_autoadd_search_filter( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SearchMetaHybridOptions sse_decode_box_autoadd_search_meta_hybrid_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); @@ -574,18 +549,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected ChunkExcerptResult sse_decode_chunk_excerpt_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkForReembedding sse_decode_chunk_for_reembedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkSearchResult sse_decode_chunk_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ChunkType sse_decode_chunk_type(SseDeserializer deserializer); @@ -595,18 +567,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected CompressionOptions sse_decode_compression_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected ContextAssemblyStrategy sse_decode_context_assembly_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected EmbeddingFingerprintGate sse_decode_embedding_fingerprint_gate( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected EmbeddingPoint sse_decode_embedding_point(SseDeserializer deserializer); @@ -625,8 +594,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected HybridSearchResult sse_decode_hybrid_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int sse_decode_i_32(SseDeserializer deserializer); @@ -636,67 +604,56 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IncrementalSearchResult sse_decode_incremental_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected IngestStrategy sse_decode_ingest_strategy(SseDeserializer deserializer); @protected IngestTrafficStats sse_decode_ingest_traffic_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_String(SseDeserializer deserializer); @protected List sse_decode_list_bm_25_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_data(SseDeserializer deserializer); @protected List sse_decode_list_chunk_embedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_excerpt_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_for_reembedding( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_chunk_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_embedding_request( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_hnsw_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_hybrid_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_incremental_search_result( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_prim_f_32_loose(SseDeserializer deserializer); @@ -721,41 +678,39 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List<(PlatformInt64, Float32List)> - sse_decode_list_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ); + sse_decode_list_record_i_64_list_prim_f_32_strict( + SseDeserializer deserializer); @protected List<(PlatformInt64, String)> sse_decode_list_record_i_64_string( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_search_hit_meta( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_semantic_chunk( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected List sse_decode_list_source_entry(SseDeserializer deserializer); @protected List sse_decode_list_structured_chunk( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected MigrationAxes sse_decode_migration_axes(SseDeserializer deserializer); + @protected + NativeRuntimeInfo sse_decode_native_runtime_info( + SseDeserializer deserializer); + @protected IngestSession? - sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - SseDeserializer deserializer, - ); + sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -768,23 +723,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected IngestStrategy? sse_decode_opt_box_autoadd_ingest_strategy( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int)? sse_decode_opt_box_autoadd_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig? sse_decode_opt_box_autoadd_rrf_config( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SearchFilter? sse_decode_opt_box_autoadd_search_filter( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); @@ -800,31 +751,26 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PreparedSourceState sse_decode_prepared_source_state( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected QueryContentReadStats sse_decode_query_content_read_stats( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RagError sse_decode_rag_error(SseDeserializer deserializer); @protected (PlatformInt64, Float32List) sse_decode_record_i_64_list_prim_f_32_strict( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (PlatformInt64, String) sse_decode_record_i_64_string( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected (int, int, int) sse_decode_record_u_32_u_32_u_32( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected RrfConfig sse_decode_rrf_config(SseDeserializer deserializer); @@ -837,8 +783,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected SearchMetaHybridOptions sse_decode_search_meta_hybrid_options( - SseDeserializer deserializer, - ); + SseDeserializer deserializer); @protected SemanticChunk sse_decode_semantic_chunk(SseDeserializer deserializer); @@ -872,186 +817,136 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_AnyhowException( - AnyhowException self, - SseSerializer serializer, - ); + AnyhowException self, SseSerializer serializer); @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession self, - SseSerializer serializer, - ); + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession self, SseSerializer serializer); @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - SearchHandle self, - SseSerializer serializer, - ); + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + SearchHandle self, SseSerializer serializer); @protected void sse_encode_StreamSink_String_Sse( - RustStreamSink self, - SseSerializer serializer, - ); + RustStreamSink self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); + @protected + void sse_encode_activation_timing_stats( + ActivationTimingStats self, SseSerializer serializer); + @protected void sse_encode_add_document_result( - AddDocumentResult self, - SseSerializer serializer, - ); + AddDocumentResult self, SseSerializer serializer); @protected void sse_encode_add_source_result( - AddSourceResult self, - SseSerializer serializer, - ); + AddSourceResult self, SseSerializer serializer); @protected void sse_encode_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ); + AssembleContextOptions self, SseSerializer serializer); @protected void sse_encode_assembled_context_v_2( - AssembledContextV2 self, - SseSerializer serializer, - ); + AssembledContextV2 self, SseSerializer serializer); @protected void sse_encode_bm_25_search_result( - Bm25SearchResult self, - SseSerializer serializer, - ); + Bm25SearchResult self, SseSerializer serializer); @protected void sse_encode_bool(bool self, SseSerializer serializer); @protected void sse_encode_box_autoadd_assemble_context_options( - AssembleContextOptions self, - SseSerializer serializer, - ); + AssembleContextOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_compression_options( - CompressionOptions self, - SseSerializer serializer, - ); + CompressionOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_i_32(int self, SseSerializer serializer); @protected void sse_encode_box_autoadd_i_64( - PlatformInt64 self, - SseSerializer serializer, - ); + PlatformInt64 self, SseSerializer serializer); @protected void sse_encode_box_autoadd_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ); + IngestStrategy self, SseSerializer serializer); @protected void sse_encode_box_autoadd_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ); + IngestTrafficStats self, SseSerializer serializer); @protected void sse_encode_box_autoadd_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ); + QueryContentReadStats self, SseSerializer serializer); @protected void sse_encode_box_autoadd_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ); + (int, int, int) self, SseSerializer serializer); @protected void sse_encode_box_autoadd_rrf_config( - RrfConfig self, - SseSerializer serializer, - ); + RrfConfig self, SseSerializer serializer); @protected void sse_encode_box_autoadd_search_filter( - SearchFilter self, - SseSerializer serializer, - ); + SearchFilter self, SseSerializer serializer); @protected void sse_encode_box_autoadd_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ); + SearchMetaHybridOptions self, SseSerializer serializer); @protected void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); @protected void sse_encode_box_autoadd_user_intent( - UserIntent self, - SseSerializer serializer, - ); + UserIntent self, SseSerializer serializer); @protected void sse_encode_buffer_stats(BufferStats self, SseSerializer serializer); @@ -1061,66 +956,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_chunk_embedding( - ChunkEmbedding self, - SseSerializer serializer, - ); + ChunkEmbedding self, SseSerializer serializer); @protected void sse_encode_chunk_excerpt_result( - ChunkExcerptResult self, - SseSerializer serializer, - ); + ChunkExcerptResult self, SseSerializer serializer); @protected void sse_encode_chunk_for_reembedding( - ChunkForReembedding self, - SseSerializer serializer, - ); + ChunkForReembedding self, SseSerializer serializer); @protected void sse_encode_chunk_search_result( - ChunkSearchResult self, - SseSerializer serializer, - ); + ChunkSearchResult self, SseSerializer serializer); @protected void sse_encode_chunk_type(ChunkType self, SseSerializer serializer); @protected void sse_encode_compressed_text( - CompressedText self, - SseSerializer serializer, - ); + CompressedText self, SseSerializer serializer); @protected void sse_encode_compression_options( - CompressionOptions self, - SseSerializer serializer, - ); + CompressionOptions self, SseSerializer serializer); @protected void sse_encode_context_assembly_strategy( - ContextAssemblyStrategy self, - SseSerializer serializer, - ); + ContextAssemblyStrategy self, SseSerializer serializer); @protected void sse_encode_embedding_fingerprint_gate( - EmbeddingFingerprintGate self, - SseSerializer serializer, - ); + EmbeddingFingerprintGate self, SseSerializer serializer); @protected void sse_encode_embedding_point( - EmbeddingPoint self, - SseSerializer serializer, - ); + EmbeddingPoint self, SseSerializer serializer); @protected void sse_encode_embedding_request( - EmbeddingRequest self, - SseSerializer serializer, - ); + EmbeddingRequest self, SseSerializer serializer); @protected void sse_encode_f_32(double self, SseSerializer serializer); @@ -1130,15 +1005,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_hnsw_search_result( - HnswSearchResult self, - SseSerializer serializer, - ); + HnswSearchResult self, SseSerializer serializer); @protected void sse_encode_hybrid_search_result( - HybridSearchResult self, - SseSerializer serializer, - ); + HybridSearchResult self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); @@ -1148,169 +1019,121 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_incremental_search_result( - IncrementalSearchResult self, - SseSerializer serializer, - ); + IncrementalSearchResult self, SseSerializer serializer); @protected void sse_encode_ingest_strategy( - IngestStrategy self, - SseSerializer serializer, - ); + IngestStrategy self, SseSerializer serializer); @protected void sse_encode_ingest_traffic_stats( - IngestTrafficStats self, - SseSerializer serializer, - ); + IngestTrafficStats self, SseSerializer serializer); @protected void sse_encode_list_String(List self, SseSerializer serializer); @protected void sse_encode_list_bm_25_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_data( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_embedding( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_excerpt_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_for_reembedding( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_chunk_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_embedding_request( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_hnsw_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_hybrid_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_incremental_search_result( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_f_32_loose( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_f_32_strict( - Float32List self, - SseSerializer serializer, - ); + Float32List self, SseSerializer serializer); @protected void sse_encode_list_prim_i_64_strict( - Int64List self, - SseSerializer serializer, - ); + Int64List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_32_loose( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_32_strict( - Uint32List self, - SseSerializer serializer, - ); + Uint32List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @protected void sse_encode_list_prim_u_8_strict( - Uint8List self, - SseSerializer serializer, - ); + Uint8List self, SseSerializer serializer); @protected void sse_encode_list_record_i_64_list_prim_f_32_strict( - List<(PlatformInt64, Float32List)> self, - SseSerializer serializer, - ); + List<(PlatformInt64, Float32List)> self, SseSerializer serializer); @protected void sse_encode_list_record_i_64_string( - List<(PlatformInt64, String)> self, - SseSerializer serializer, - ); + List<(PlatformInt64, String)> self, SseSerializer serializer); @protected void sse_encode_list_search_hit_meta( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_semantic_chunk( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_source_entry( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_list_structured_chunk( - List self, - SseSerializer serializer, - ); + List self, SseSerializer serializer); @protected void sse_encode_migration_axes(MigrationAxes self, SseSerializer serializer); + @protected + void sse_encode_native_runtime_info( + NativeRuntimeInfo self, SseSerializer serializer); + @protected void - sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - IngestSession? self, - SseSerializer serializer, - ); + sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + IngestSession? self, SseSerializer serializer); @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -1320,84 +1143,60 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_opt_box_autoadd_i_64( - PlatformInt64? self, - SseSerializer serializer, - ); + PlatformInt64? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_ingest_strategy( - IngestStrategy? self, - SseSerializer serializer, - ); + IngestStrategy? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_record_u_32_u_32_u_32( - (int, int, int)? self, - SseSerializer serializer, - ); + (int, int, int)? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_rrf_config( - RrfConfig? self, - SseSerializer serializer, - ); + RrfConfig? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_search_filter( - SearchFilter? self, - SseSerializer serializer, - ); + SearchFilter? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); @protected void sse_encode_opt_list_prim_i_64_strict( - Int64List? self, - SseSerializer serializer, - ); + Int64List? self, SseSerializer serializer); @protected void sse_encode_parsed_intent(ParsedIntent self, SseSerializer serializer); @protected void sse_encode_prepared_ingestion( - PreparedIngestion self, - SseSerializer serializer, - ); + PreparedIngestion self, SseSerializer serializer); @protected void sse_encode_prepared_source_state( - PreparedSourceState self, - SseSerializer serializer, - ); + PreparedSourceState self, SseSerializer serializer); @protected void sse_encode_query_content_read_stats( - QueryContentReadStats self, - SseSerializer serializer, - ); + QueryContentReadStats self, SseSerializer serializer); @protected void sse_encode_rag_error(RagError self, SseSerializer serializer); @protected void sse_encode_record_i_64_list_prim_f_32_strict( - (PlatformInt64, Float32List) self, - SseSerializer serializer, - ); + (PlatformInt64, Float32List) self, SseSerializer serializer); @protected void sse_encode_record_i_64_string( - (PlatformInt64, String) self, - SseSerializer serializer, - ); + (PlatformInt64, String) self, SseSerializer serializer); @protected void sse_encode_record_u_32_u_32_u_32( - (int, int, int) self, - SseSerializer serializer, - ); + (int, int, int) self, SseSerializer serializer); @protected void sse_encode_rrf_config(RrfConfig self, SseSerializer serializer); @@ -1410,9 +1209,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_search_meta_hybrid_options( - SearchMetaHybridOptions self, - SseSerializer serializer, - ); + SearchMetaHybridOptions self, SseSerializer serializer); @protected void sse_encode_semantic_chunk(SemanticChunk self, SseSerializer serializer); @@ -1425,9 +1222,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_structured_chunk( - StructuredChunk self, - SseSerializer serializer, - ); + StructuredChunk self, SseSerializer serializer); @protected void sse_encode_u_32(int self, SseSerializer serializer); @@ -1453,37 +1248,29 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { class RustLibWire implements BaseWire { RustLibWire.fromExternalLibrary(ExternalLibrary lib); - void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - int ptr, - ) => wasmModule - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - ptr, - ); - - void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - int ptr, - ) => wasmModule - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - ptr, - ); - - void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - int ptr, - ) => wasmModule - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - ptr, - ); - - void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - int ptr, - ) => wasmModule - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - ptr, - ); + void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + int ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + int ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + int ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + int ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + ptr); } @JS('wasm_bindgen') @@ -1493,22 +1280,18 @@ external RustLibWasmModule get wasmModule; @anonymous extension type RustLibWasmModule._(JSObject _) implements JSObject { external void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - int ptr, - ); + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + int ptr); external void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( - int ptr, - ); + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIngestSession( + int ptr); external void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - int ptr, - ); + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + int ptr); external void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( - int ptr, - ); + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSearchHandle( + int ptr); } diff --git a/rust_builder/rust/Cargo.lock b/rust_builder/rust/Cargo.lock index 360bc46..46305c6 100644 --- a/rust_builder/rust/Cargo.lock +++ b/rust_builder/rust/Cargo.lock @@ -1795,6 +1795,15 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +[[package]] +name = "libmimalloc-sys" +version = "0.1.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a45a52f43e1c16f667ccfe4dd8c85b7f7c204fd5e3bf46c5b0db9a5c3c0b8e9" +dependencies = [ + "cc", +] + [[package]] name = "libredox" version = "0.1.10" @@ -1917,6 +1926,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mimalloc" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4139bb28d14ad1facf21d5eb8825051b326e172d216b39f6d31df53cc97862" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2389,6 +2407,7 @@ dependencies = [ "hnsw_rs", "lazy_static", "log", + "mimalloc", "once_cell", "oslog", "pdf-extract", diff --git a/rust_builder/rust/Cargo.toml b/rust_builder/rust/Cargo.toml index 5afbbdc..eb2796d 100644 --- a/rust_builder/rust/Cargo.toml +++ b/rust_builder/rust/Cargo.toml @@ -12,6 +12,7 @@ crate-type = ["cdylib", "staticlib", "lib"] default = [] vector_faer = ["dep:faer"] vector_quant_i8 = [] +allocator_mimalloc = ["dep:mimalloc"] # Bench-only: exposes a thin `bench_api` re-export of the (otherwise pub(crate)) # vector_math kernels so `benches/` can reach them. Never set in production builds. bench = [] @@ -27,6 +28,7 @@ log = "0.4.29" once_cell = "1.21" lazy_static = "1.4" faer = { version = "0.24.0", optional = true, default-features = false, features = ["std", "linalg"] } +mimalloc = { version = "0.1.52", optional = true, default-features = false } # Tokenizer for text preprocessing # Using fancy-regex instead of onig for iOS cross-compilation compatibility diff --git a/rust_builder/rust/cargokit.yaml b/rust_builder/rust/cargokit.yaml index b359d9c..e33a2f0 100644 --- a/rust_builder/rust/cargokit.yaml +++ b/rust_builder/rust/cargokit.yaml @@ -1,4 +1,8 @@ cargo: + profile: + extra_flags: + - --features + - vector_faer,vector_quant_i8 release: extra_flags: - --features diff --git a/rust_builder/rust/src/api/activation_metrics.rs b/rust_builder/rust/src/api/activation_metrics.rs new file mode 100644 index 0000000..96fdc23 --- /dev/null +++ b/rust_builder/rust/src/api/activation_metrics.rs @@ -0,0 +1,159 @@ +use flutter_rust_bridge::frb; +use std::sync::atomic::{AtomicU64, Ordering}; + +struct AtomicTimingCounter { + count: AtomicU64, + nanos: AtomicU64, +} + +impl AtomicTimingCounter { + const fn new() -> Self { + Self { + count: AtomicU64::new(0), + nanos: AtomicU64::new(0), + } + } + + fn record(&self, nanos: u64) { + self.count.fetch_add(1, Ordering::Relaxed); + self.nanos.fetch_add(nanos, Ordering::Relaxed); + } + + fn snapshot(&self) -> (u64, u64) { + ( + self.nanos.load(Ordering::Relaxed), + self.count.load(Ordering::Relaxed), + ) + } + + fn reset(&self) { + self.count.store(0, Ordering::Relaxed); + self.nanos.store(0, Ordering::Relaxed); + } +} + +static ACTIVATE_TOTAL: AtomicTimingCounter = AtomicTimingCounter::new(); +static BM25_REBUILD: AtomicTimingCounter = AtomicTimingCounter::new(); +static HNSW_LOAD: AtomicTimingCounter = AtomicTimingCounter::new(); +static HNSW_LOAD_SUCCESS: AtomicU64 = AtomicU64::new(0); +static HNSW_LOAD_MISS: AtomicU64 = AtomicU64::new(0); +static HNSW_REBUILD: AtomicTimingCounter = AtomicTimingCounter::new(); +static HNSW_SAVE: AtomicTimingCounter = AtomicTimingCounter::new(); + +#[derive(Debug, Clone)] +pub struct ActivationTimingStats { + pub activate_total_nanos: u64, + pub activate_count: u64, + pub bm25_rebuild_nanos: u64, + pub bm25_rebuild_count: u64, + pub hnsw_load_nanos: u64, + pub hnsw_load_count: u64, + pub hnsw_load_success_count: u64, + pub hnsw_load_miss_count: u64, + pub hnsw_rebuild_nanos: u64, + pub hnsw_rebuild_count: u64, + pub hnsw_save_nanos: u64, + pub hnsw_save_count: u64, +} + +pub(crate) fn record_activate_total_nanos(nanos: u64) { + ACTIVATE_TOTAL.record(nanos); +} + +pub(crate) fn record_bm25_rebuild_nanos(nanos: u64) { + BM25_REBUILD.record(nanos); +} + +pub(crate) fn record_hnsw_load_nanos(nanos: u64, loaded: bool) { + HNSW_LOAD.record(nanos); + if loaded { + HNSW_LOAD_SUCCESS.fetch_add(1, Ordering::Relaxed); + } else { + HNSW_LOAD_MISS.fetch_add(1, Ordering::Relaxed); + } +} + +pub(crate) fn record_hnsw_rebuild_nanos(nanos: u64) { + HNSW_REBUILD.record(nanos); +} + +pub(crate) fn record_hnsw_save_nanos(nanos: u64) { + HNSW_SAVE.record(nanos); +} + +#[frb(sync)] +pub fn activation_timing_stats() -> ActivationTimingStats { + let (activate_total_nanos, activate_count) = ACTIVATE_TOTAL.snapshot(); + let (bm25_rebuild_nanos, bm25_rebuild_count) = BM25_REBUILD.snapshot(); + let (hnsw_load_nanos, hnsw_load_count) = HNSW_LOAD.snapshot(); + let (hnsw_rebuild_nanos, hnsw_rebuild_count) = HNSW_REBUILD.snapshot(); + let (hnsw_save_nanos, hnsw_save_count) = HNSW_SAVE.snapshot(); + + ActivationTimingStats { + activate_total_nanos, + activate_count, + bm25_rebuild_nanos, + bm25_rebuild_count, + hnsw_load_nanos, + hnsw_load_count, + hnsw_load_success_count: HNSW_LOAD_SUCCESS.load(Ordering::Relaxed), + hnsw_load_miss_count: HNSW_LOAD_MISS.load(Ordering::Relaxed), + hnsw_rebuild_nanos, + hnsw_rebuild_count, + hnsw_save_nanos, + hnsw_save_count, + } +} + +#[frb(sync)] +pub fn reset_activation_timing_stats() { + ACTIVATE_TOTAL.reset(); + BM25_REBUILD.reset(); + HNSW_LOAD.reset(); + HNSW_LOAD_SUCCESS.store(0, Ordering::Relaxed); + HNSW_LOAD_MISS.store(0, Ordering::Relaxed); + HNSW_REBUILD.reset(); + HNSW_SAVE.reset(); +} + +#[frb(sync)] +pub fn take_activation_timing_stats() -> ActivationTimingStats { + let stats = activation_timing_stats(); + reset_activation_timing_stats(); + stats +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn take_returns_recorded_activation_timings_and_resets() { + reset_activation_timing_stats(); + + record_activate_total_nanos(100); + record_bm25_rebuild_nanos(20); + record_hnsw_load_nanos(30, true); + record_hnsw_load_nanos(40, false); + record_hnsw_rebuild_nanos(50); + record_hnsw_save_nanos(60); + + let stats = take_activation_timing_stats(); + assert_eq!(stats.activate_total_nanos, 100); + assert_eq!(stats.activate_count, 1); + assert_eq!(stats.bm25_rebuild_nanos, 20); + assert_eq!(stats.bm25_rebuild_count, 1); + assert_eq!(stats.hnsw_load_nanos, 70); + assert_eq!(stats.hnsw_load_count, 2); + assert_eq!(stats.hnsw_load_success_count, 1); + assert_eq!(stats.hnsw_load_miss_count, 1); + assert_eq!(stats.hnsw_rebuild_nanos, 50); + assert_eq!(stats.hnsw_rebuild_count, 1); + assert_eq!(stats.hnsw_save_nanos, 60); + assert_eq!(stats.hnsw_save_count, 1); + + let reset = take_activation_timing_stats(); + assert_eq!(reset.activate_total_nanos, 0); + assert_eq!(reset.hnsw_load_count, 0); + } +} diff --git a/rust_builder/rust/src/api/mod.rs b/rust_builder/rust/src/api/mod.rs index 7f6653d..bdc61ca 100644 --- a/rust_builder/rust/src/api/mod.rs +++ b/rust_builder/rust/src/api/mod.rs @@ -5,6 +5,7 @@ // This file is part of the core engine. Any modifications require owner approval. // Please submit a PR with detailed explanation of changes before modifying. +pub mod activation_metrics; pub mod bm25_search; pub mod compression_utils; pub mod db_pool; @@ -18,6 +19,7 @@ pub mod ingest_session; pub mod logger; pub mod migration_meta; pub mod query_metrics; +pub mod runtime_info; pub mod semantic_chunker; pub mod simple; pub(crate) mod simple_rag; diff --git a/rust_builder/rust/src/api/runtime_info.rs b/rust_builder/rust/src/api/runtime_info.rs new file mode 100644 index 0000000..202492d --- /dev/null +++ b/rust_builder/rust/src/api/runtime_info.rs @@ -0,0 +1,67 @@ +use flutter_rust_bridge::frb; + +#[derive(Debug, Clone)] +pub struct NativeRuntimeInfo { + pub native_allocator: String, + pub rust_features: String, +} + +#[frb(sync)] +pub fn native_runtime_info() -> NativeRuntimeInfo { + NativeRuntimeInfo { + native_allocator: native_allocator_label().to_string(), + rust_features: rust_features_label().to_string(), + } +} + +fn native_allocator_label() -> &'static str { + if cfg!(feature = "allocator_mimalloc") { + "mimalloc" + } else { + "system" + } +} + +fn rust_features_label() -> &'static str { + match ( + cfg!(feature = "vector_faer"), + cfg!(feature = "vector_quant_i8"), + cfg!(feature = "allocator_mimalloc"), + ) { + (true, true, true) => "vector_faer,vector_quant_i8,allocator_mimalloc", + (true, true, false) => "vector_faer,vector_quant_i8", + (true, false, true) => "vector_faer,allocator_mimalloc", + (true, false, false) => "vector_faer", + (false, true, true) => "vector_quant_i8,allocator_mimalloc", + (false, true, false) => "vector_quant_i8", + (false, false, true) => "allocator_mimalloc", + (false, false, false) => "default", + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn allocator_label_matches_compile_time_feature() { + let expected = if cfg!(feature = "allocator_mimalloc") { + "mimalloc" + } else { + "system" + }; + + assert_eq!(native_runtime_info().native_allocator, expected); + } + + #[test] + fn rust_features_label_lists_enabled_allocator_feature() { + let info = native_runtime_info(); + + if cfg!(feature = "allocator_mimalloc") { + assert!(info.rust_features.contains("allocator_mimalloc")); + } else { + assert!(!info.rust_features.contains("allocator_mimalloc")); + } + } +} diff --git a/rust_builder/rust/src/api/source_rag.rs b/rust_builder/rust/src/api/source_rag.rs index 411d552..a39e637 100644 --- a/rust_builder/rust/src/api/source_rag.rs +++ b/rust_builder/rust/src/api/source_rag.rs @@ -16,17 +16,18 @@ // //! Extended RAG API with sources and chunks for LLM-optimized context. +use crate::api::activation_metrics; use crate::api::bm25_search::{bm25_add_documents, bm25_clear_index, is_bm25_index_loaded}; use crate::api::db_pool::get_connection; use crate::api::error::RagError; -use crate::api::ingest_metrics::{ - legacy_counters_enabled, LEGACY_ADD_CHUNKS_IN, LEGACY_ADD_SOURCE_IN, -}; use crate::api::hnsw_index::{ build_hnsw_index, clear_hnsw_index, is_hnsw_index_loaded, load_hnsw_index, save_hnsw_index, search_hnsw, }; use crate::api::hybrid_search::{search_hybrid_meta_inner, RrfConfig, SearchFilter}; +use crate::api::ingest_metrics::{ + legacy_counters_enabled, LEGACY_ADD_CHUNKS_IN, LEGACY_ADD_SOURCE_IN, +}; use crate::api::migration_meta::{detect_existing_install, initialize_migration_meta}; use crate::api::query_metrics::{ record_hydrated_content_read, QueryContentReadGuard, QueryContentReadPhase, @@ -49,6 +50,7 @@ use rusqlite::{params, OptionalExtension}; use sha2::{Digest, Sha256}; use std::collections::{HashMap, HashSet}; use std::sync::{Arc, Mutex, RwLock}; +use std::time::Instant; pub const DEFAULT_COLLECTION_ID: &str = "__default__"; @@ -62,6 +64,10 @@ static CJK_OR_HANGUL_RE: Lazy = Lazy::new(|| { .expect("valid cjk regex") }); +fn elapsed_nanos_u64(start: Instant) -> u64 { + start.elapsed().as_nanos().min(u128::from(u64::MAX)) as u64 +} + #[cfg(test)] static SEARCH_META_TEST_HOOK: Lazy>> = Lazy::new(|| RwLock::new(None)); #[cfg(test)] @@ -733,8 +739,7 @@ pub struct ChunkData { /// Add chunks for a source (uses transaction for atomicity). pub fn add_chunks(source_id: i64, chunks: Vec) -> Result { if legacy_counters_enabled() { - LEGACY_ADD_CHUNKS_IN - .record(chunks.iter().map(|c| c.content.len() as u64).sum()); + LEGACY_ADD_CHUNKS_IN.record(chunks.iter().map(|c| c.content.len() as u64).sum()); } info!( "[add_chunks] Adding {} chunks for source {}", @@ -768,8 +773,7 @@ pub fn add_chunks(source_id: i64, chunks: Vec) -> Result Result<(), RagError> { /// Rebuild HNSW index from chunks table for a specific collection. pub fn rebuild_chunk_hnsw_index_for_collection(collection_id: String) -> Result<(), RagError> { + let start = Instant::now(); + let result = rebuild_chunk_hnsw_index_for_collection_inner(collection_id); + activation_metrics::record_hnsw_rebuild_nanos(elapsed_nanos_u64(start)); + result +} + +fn rebuild_chunk_hnsw_index_for_collection_inner(collection_id: String) -> Result<(), RagError> { let collection_id = normalize_collection_id(collection_id); info!( "[rebuild_chunk_hnsw] Starting for collection={}", @@ -928,6 +939,13 @@ pub fn rebuild_chunk_bm25_index() -> Result<(), RagError> { /// Rebuild BM25 index from chunks table for a specific collection. pub fn rebuild_chunk_bm25_index_for_collection(collection_id: String) -> Result<(), RagError> { + let start = Instant::now(); + let result = rebuild_chunk_bm25_index_for_collection_inner(collection_id); + activation_metrics::record_bm25_rebuild_nanos(elapsed_nanos_u64(start)); + result +} + +fn rebuild_chunk_bm25_index_for_collection_inner(collection_id: String) -> Result<(), RagError> { let collection_id = normalize_collection_id(collection_id); info!( "[rebuild_chunk_bm25] Starting for collection={}", @@ -979,7 +997,10 @@ pub fn save_collection_hnsw_index( base_path: String, ) -> Result<(), RagError> { let collection_id = normalize_collection_id(collection_id); - save_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string()))?; + let start = Instant::now(); + let result = save_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string())); + activation_metrics::record_hnsw_save_nanos(elapsed_nanos_u64(start)); + result?; set_active_hnsw_collection(&collection_id); Ok(()) } @@ -990,7 +1011,18 @@ pub fn load_collection_hnsw_index( base_path: String, ) -> Result { let collection_id = normalize_collection_id(collection_id); - let loaded = load_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string()))?; + let start = Instant::now(); + let load_result = load_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string())); + let loaded = match load_result { + Ok(loaded) => { + activation_metrics::record_hnsw_load_nanos(elapsed_nanos_u64(start), loaded); + loaded + } + Err(err) => { + activation_metrics::record_hnsw_load_nanos(elapsed_nanos_u64(start), false); + return Err(err); + } + }; if loaded { set_active_hnsw_collection(&collection_id); let conn = get_connection().map_err(|e| RagError::DatabaseError(e.to_string()))?; @@ -1006,6 +1038,16 @@ pub fn load_collection_hnsw_index( pub fn activate_collection_for_hybrid_search( collection_id: String, base_path: String, +) -> Result<(), RagError> { + let total_start = Instant::now(); + let result = activate_collection_for_hybrid_search_inner(collection_id, base_path); + activation_metrics::record_activate_total_nanos(elapsed_nanos_u64(total_start)); + result +} + +fn activate_collection_for_hybrid_search_inner( + collection_id: String, + base_path: String, ) -> Result<(), RagError> { let collection_id = normalize_collection_id(collection_id); let conn = get_connection().map_err(|e| RagError::DatabaseError(e.to_string()))?; @@ -1016,13 +1058,28 @@ pub fn activate_collection_for_hybrid_search( } if !is_hnsw_index_loaded() || !is_active_hnsw_collection(&collection_id) { - let loaded = load_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string()))?; + let load_start = Instant::now(); + let load_result = load_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string())); + let loaded = match load_result { + Ok(loaded) => { + activation_metrics::record_hnsw_load_nanos(elapsed_nanos_u64(load_start), loaded); + loaded + } + Err(err) => { + activation_metrics::record_hnsw_load_nanos(elapsed_nanos_u64(load_start), false); + return Err(err); + } + }; if loaded { set_active_hnsw_collection(&collection_id); let _ = mark_collection_hnsw_clean(&conn, &collection_id); } else { rebuild_chunk_hnsw_index_for_collection(collection_id.clone())?; - save_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string()))?; + let save_start = Instant::now(); + let save_result = + save_hnsw_index(&base_path).map_err(|e| RagError::IoError(e.to_string())); + activation_metrics::record_hnsw_save_nanos(elapsed_nanos_u64(save_start)); + save_result?; } } @@ -1203,12 +1260,8 @@ impl SearchHandle { // returns from the cache and bypasses SQLite entirely. let (from_cache, missing) = partition_by_cache(&self.content_cache, &requested_ids); - let (newly_fetched, stale_missing) = hydrate_chunk_search_results( - &conn, - &self.collection_id, - missing, - &self.ordered_hits, - )?; + let (newly_fetched, stale_missing) = + hydrate_chunk_search_results(&conn, &self.collection_id, missing, &self.ordered_hits)?; self.ensure_generation_unchanged_with_conn(&conn, start_generation)?; if let Some(missing) = stale_missing.first() { return Err(RagError::StaleSearchHandle(format!( @@ -1218,10 +1271,8 @@ impl SearchHandle { } populate_cache(&self.content_cache, &newly_fetched); - let mut by_id: HashMap = from_cache - .into_iter() - .map(|c| (c.chunk_id, c)) - .collect(); + let mut by_id: HashMap = + from_cache.into_iter().map(|c| (c.chunk_id, c)).collect(); for chunk in newly_fetched { by_id.insert(chunk.chunk_id, chunk); } @@ -1268,10 +1319,8 @@ impl SearchHandle { ))); } - let mut by_id: HashMap = from_cache - .into_iter() - .map(|c| (c.chunk_id, c)) - .collect(); + let mut by_id: HashMap = + from_cache.into_iter().map(|c| (c.chunk_id, c)).collect(); for chunk in newly_fetched { by_id.insert(chunk.chunk_id, chunk); } @@ -1332,12 +1381,7 @@ pub fn search_meta_hybrid( // `search_meta_hybrid_once` constructs the owned `SearchHandle` // payload internally, cloning only what the handle actually stores. for _attempt in 0..=1 { - match search_meta_hybrid_once( - &collection_id, - &query_text, - &query_embedding, - &options, - ) { + match search_meta_hybrid_once(&collection_id, &query_text, &query_embedding, &options) { Ok(handle) => return Ok(RustAutoOpaque::new(handle)), Err(err @ RagError::ConcurrentMutation(_)) => last_error = Some(err), Err(err) => return Err(err), @@ -1614,15 +1658,10 @@ fn partition_by_cache( /// Insert newly-fetched full-content rows into the cache. `or_insert_with` /// keeps the first writer's value if two calls race for the same id. -fn populate_cache( - cache: &Mutex>, - rows: &[ChunkSearchResult], -) { +fn populate_cache(cache: &Mutex>, rows: &[ChunkSearchResult]) { let mut guard = cache.lock().expect("content_cache mutex poisoned"); for row in rows { - guard - .entry(row.chunk_id) - .or_insert_with(|| row.clone()); + guard.entry(row.chunk_id).or_insert_with(|| row.clone()); } } @@ -2046,10 +2085,8 @@ fn hydrate_rows_for_assembly( hydrate_chunk_search_results(conn, collection_id, missing, hits)?; populate_cache(cache, &newly_fetched); - let mut by_id: HashMap = from_cache - .into_iter() - .map(|c| (c.chunk_id, c)) - .collect(); + let mut by_id: HashMap = + from_cache.into_iter().map(|c| (c.chunk_id, c)).collect(); for chunk in newly_fetched { by_id.insert(chunk.chunk_id, chunk); } diff --git a/rust_builder/rust/src/frb_generated.rs b/rust_builder/rust/src/frb_generated.rs index 4e8381e..85c8513 100644 --- a/rust_builder/rust/src/frb_generated.rs +++ b/rust_builder/rust/src/frb_generated.rs @@ -39,7 +39,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_auto_opaque = RustAutoOpaqueMoi, ); pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.11.1"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 907237406; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1086205755; // Section: executor @@ -872,6 +872,36 @@ fn wire__crate__api__source_rag__activate_collection_for_hybrid_search_impl( }, ) } +fn wire__crate__api__activation_metrics__activation_timing_stats_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "activation_timing_stats", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse::<_, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::activation_metrics::activation_timing_stats())?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__source_rag__add_chunks_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -3729,6 +3759,36 @@ fn wire__crate__api__semantic_chunker__markdown_chunk_impl( }, ) } +fn wire__crate__api__runtime_info__native_runtime_info_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "native_runtime_info", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse::<_, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::runtime_info::native_runtime_info())?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__incremental_index__needs_merge_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -4361,6 +4421,37 @@ fn wire__crate__api__simple_rag__rebuild_hnsw_index_impl( }, ) } +fn wire__crate__api__activation_metrics__reset_activation_timing_stats_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "reset_activation_timing_stats", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse::<_, ()>((move || { + let output_ok = Result::<_, ()>::Ok({ + crate::api::activation_metrics::reset_activation_timing_stats(); + })?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__ingest_metrics__reset_ingest_traffic_stats_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -5064,6 +5155,37 @@ fn wire__crate__api__compression_utils__split_sentences_impl( }, ) } +fn wire__crate__api__activation_metrics__take_activation_timing_stats_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "take_activation_timing_stats", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse::<_, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::activation_metrics::take_activation_timing_stats(), + )?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__query_metrics__take_query_content_read_stats_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -5438,6 +5560,38 @@ impl SseDecode for String { } } +impl SseDecode for crate::api::activation_metrics::ActivationTimingStats { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_activateTotalNanos = ::sse_decode(deserializer); + let mut var_activateCount = ::sse_decode(deserializer); + let mut var_bm25RebuildNanos = ::sse_decode(deserializer); + let mut var_bm25RebuildCount = ::sse_decode(deserializer); + let mut var_hnswLoadNanos = ::sse_decode(deserializer); + let mut var_hnswLoadCount = ::sse_decode(deserializer); + let mut var_hnswLoadSuccessCount = ::sse_decode(deserializer); + let mut var_hnswLoadMissCount = ::sse_decode(deserializer); + let mut var_hnswRebuildNanos = ::sse_decode(deserializer); + let mut var_hnswRebuildCount = ::sse_decode(deserializer); + let mut var_hnswSaveNanos = ::sse_decode(deserializer); + let mut var_hnswSaveCount = ::sse_decode(deserializer); + return crate::api::activation_metrics::ActivationTimingStats { + activate_total_nanos: var_activateTotalNanos, + activate_count: var_activateCount, + bm25_rebuild_nanos: var_bm25RebuildNanos, + bm25_rebuild_count: var_bm25RebuildCount, + hnsw_load_nanos: var_hnswLoadNanos, + hnsw_load_count: var_hnswLoadCount, + hnsw_load_success_count: var_hnswLoadSuccessCount, + hnsw_load_miss_count: var_hnswLoadMissCount, + hnsw_rebuild_nanos: var_hnswRebuildNanos, + hnsw_rebuild_count: var_hnswRebuildCount, + hnsw_save_nanos: var_hnswSaveNanos, + hnsw_save_count: var_hnswSaveCount, + }; + } +} + impl SseDecode for crate::api::simple_rag::AddDocumentResult { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -6171,6 +6325,18 @@ impl SseDecode for crate::api::migration_meta::MigrationAxes { } } +impl SseDecode for crate::api::runtime_info::NativeRuntimeInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_nativeAllocator = ::sse_decode(deserializer); + let mut var_rustFeatures = ::sse_decode(deserializer); + return crate::api::runtime_info::NativeRuntimeInfo { + native_allocator: var_nativeAllocator, + rust_features: var_rustFeatures, + }; + } +} + impl SseDecode for Option> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -6705,114 +6871,114 @@ fn pde_ffi_dispatcher_primary_impl( 15 => wire__crate__api__source_rag__SearchHandle_hydrate_chunks_impl(port, ptr, rust_vec_len, data_len), 16 => wire__crate__api__migration_meta__acknowledge_and_clear_embeddings_impl(port, ptr, rust_vec_len, data_len), 17 => wire__crate__api__source_rag__activate_collection_for_hybrid_search_impl(port, ptr, rust_vec_len, data_len), -18 => wire__crate__api__source_rag__add_chunks_impl(port, ptr, rust_vec_len, data_len), -19 => wire__crate__api__simple_rag__add_document_impl(port, ptr, rust_vec_len, data_len), -20 => wire__crate__api__simple_rag__add_document_simple_impl(port, ptr, rust_vec_len, data_len), -21 => wire__crate__api__source_rag__add_source_impl(port, ptr, rust_vec_len, data_len), -22 => wire__crate__api__source_rag__add_source_in_collection_impl(port, ptr, rust_vec_len, data_len), -23 => wire__crate__api__migration_meta__begin_embedding_reembed_impl(port, ptr, rust_vec_len, data_len), -24 => wire__crate__api__source_rag__benchmark_search_chunks_linear_in_collection_impl(port, ptr, rust_vec_len, data_len), -25 => wire__crate__api__simple_rag__benchmark_search_linear_scan_impl(port, ptr, rust_vec_len, data_len), -26 => wire__crate__api__bm25_search__bm25_add_document_impl(port, ptr, rust_vec_len, data_len), -27 => wire__crate__api__bm25_search__bm25_add_documents_impl(port, ptr, rust_vec_len, data_len), -28 => wire__crate__api__bm25_search__bm25_clear_index_impl(port, ptr, rust_vec_len, data_len), -29 => wire__crate__api__bm25_search__bm25_get_document_count_impl(port, ptr, rust_vec_len, data_len), -30 => wire__crate__api__bm25_search__bm25_remove_document_impl(port, ptr, rust_vec_len, data_len), -31 => wire__crate__api__bm25_search__bm25_search_impl(port, ptr, rust_vec_len, data_len), -32 => wire__crate__api__hnsw_index__build_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -34 => wire__crate__api__semantic_chunker__chunk_type_as_str_impl(port, ptr, rust_vec_len, data_len), -35 => wire__crate__api__semantic_chunker__chunk_type_from_str_impl(port, ptr, rust_vec_len, data_len), -36 => wire__crate__api__source_rag__claim_source_for_ingestion_impl(port, ptr, rust_vec_len, data_len), -38 => wire__crate__api__simple_rag__clear_all_documents_impl(port, ptr, rust_vec_len, data_len), -39 => wire__crate__api__incremental_index__clear_buffer_impl(port, ptr, rust_vec_len, data_len), -40 => wire__crate__api__hnsw_index__clear_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -41 => wire__crate__api__source_rag__clear_source_chunks_impl(port, ptr, rust_vec_len, data_len), -42 => wire__crate__api__db_pool__close_db_pool_impl(port, ptr, rust_vec_len, data_len), -44 => wire__crate__api__compression_utils__compress_text_impl(port, ptr, rust_vec_len, data_len), -45 => wire__crate__api__compression_utils__compress_text_simple_impl(port, ptr, rust_vec_len, data_len), -46 => wire__crate__api__compression_utils__compression_options_default_impl(port, ptr, rust_vec_len, data_len), -47 => wire__crate__api__migration_meta__count_chunks_needing_reembed_impl(port, ptr, rust_vec_len, data_len), -50 => wire__crate__api__source_rag__delete_source_impl(port, ptr, rust_vec_len, data_len), -51 => wire__crate__api__source_rag__delete_source_in_collection_impl(port, ptr, rust_vec_len, data_len), -52 => wire__crate__api__source_rag__derive_context_budget_for_prompt_v2_impl(port, ptr, rust_vec_len, data_len), -53 => wire__crate__api__migration_meta__detect_embedding_fingerprint_gate_impl(port, ptr, rust_vec_len, data_len), -54 => wire__crate__api__hnsw_index__embedding_point_new_impl(port, ptr, rust_vec_len, data_len), -55 => wire__crate__api__document_parser__extract_text_from_document_impl(port, ptr, rust_vec_len, data_len), -56 => wire__crate__api__document_parser__extract_text_from_docx_impl(port, ptr, rust_vec_len, data_len), -57 => wire__crate__api__document_parser__extract_text_from_file_impl(port, ptr, rust_vec_len, data_len), -58 => wire__crate__api__document_parser__extract_text_from_pdf_impl(port, ptr, rust_vec_len, data_len), -59 => wire__crate__api__document_parser__extract_text_from_utf8_impl(port, ptr, rust_vec_len, data_len), -60 => wire__crate__api__migration_meta__finalize_embedding_reembed_impl(port, ptr, rust_vec_len, data_len), -61 => wire__crate__api__source_rag__get_adjacent_chunks_impl(port, ptr, rust_vec_len, data_len), -62 => wire__crate__api__source_rag__get_all_chunk_ids_and_contents_impl(port, ptr, rust_vec_len, data_len), -63 => wire__crate__api__source_rag__get_all_chunk_ids_and_contents_in_collection_impl(port, ptr, rust_vec_len, data_len), -64 => wire__crate__api__incremental_index__get_buffer_for_merge_impl(port, ptr, rust_vec_len, data_len), -65 => wire__crate__api__incremental_index__get_buffer_stats_impl(port, ptr, rust_vec_len, data_len), -66 => wire__crate__api__simple_rag__get_document_count_impl(port, ptr, rust_vec_len, data_len), -67 => wire__crate__api__db_pool__get_pool_stats_impl(port, ptr, rust_vec_len, data_len), -68 => wire__crate__api__source_rag__get_source_impl(port, ptr, rust_vec_len, data_len), -69 => wire__crate__api__source_rag__get_source_chunk_count_impl(port, ptr, rust_vec_len, data_len), -70 => wire__crate__api__source_rag__get_source_chunks_impl(port, ptr, rust_vec_len, data_len), -71 => wire__crate__api__source_rag__get_source_stats_impl(port, ptr, rust_vec_len, data_len), -72 => wire__crate__api__source_rag__get_source_stats_in_collection_impl(port, ptr, rust_vec_len, data_len), -73 => wire__crate__api__source_rag__get_source_status_impl(port, ptr, rust_vec_len, data_len), -76 => wire__crate__api__incremental_index__incremental_add_impl(port, ptr, rust_vec_len, data_len), -77 => wire__crate__api__incremental_index__incremental_add_batch_impl(port, ptr, rust_vec_len, data_len), -78 => wire__crate__api__incremental_index__incremental_remove_impl(port, ptr, rust_vec_len, data_len), -79 => wire__crate__api__incremental_index__incremental_search_impl(port, ptr, rust_vec_len, data_len), -81 => wire__crate__api__ingest_metrics__ingest_traffic_stats_legacy_text_traffic_total_impl(port, ptr, rust_vec_len, data_len), -82 => wire__crate__api__ingest_metrics__ingest_traffic_stats_session_text_traffic_total_impl(port, ptr, rust_vec_len, data_len), -83 => wire__crate__api__simple__init_app_impl(port, ptr, rust_vec_len, data_len), -84 => wire__crate__api__simple_rag__init_db_impl(port, ptr, rust_vec_len, data_len), -85 => wire__crate__api__db_pool__init_db_pool_impl(port, ptr, rust_vec_len, data_len), -87 => wire__crate__api__logger__init_logger_impl(port, ptr, rust_vec_len, data_len), -88 => wire__crate__api__source_rag__init_source_db_impl(port, ptr, rust_vec_len, data_len), -89 => wire__crate__api__tokenizer__init_tokenizer_impl(port, ptr, rust_vec_len, data_len), -90 => wire__crate__api__bm25_search__is_bm25_index_loaded_impl(port, ptr, rust_vec_len, data_len), -91 => wire__crate__api__source_rag__is_chunk_bm25_index_loaded_impl(port, ptr, rust_vec_len, data_len), -92 => wire__crate__api__hnsw_index__is_hnsw_index_loaded_impl(port, ptr, rust_vec_len, data_len), -93 => wire__crate__api__db_pool__is_pool_initialized_impl(port, ptr, rust_vec_len, data_len), -94 => wire__crate__api__source_rag__list_chunks_needing_reembed_impl(port, ptr, rust_vec_len, data_len), -95 => wire__crate__api__source_rag__list_sources_impl(port, ptr, rust_vec_len, data_len), -96 => wire__crate__api__source_rag__list_sources_in_collection_impl(port, ptr, rust_vec_len, data_len), -97 => wire__crate__api__source_rag__load_collection_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -98 => wire__crate__api__hnsw_index__load_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -100 => wire__crate__api__incremental_index__needs_merge_impl(port, ptr, rust_vec_len, data_len), -103 => wire__crate__api__ingest_session__prepare_source_ingestion_impl(port, ptr, rust_vec_len, data_len), -104 => wire__crate__api__ingest_session__prepare_source_ingestion_from_file_impl(port, ptr, rust_vec_len, data_len), -105 => wire__crate__api__ingest_session__prepare_source_ingestion_from_utf8_impl(port, ptr, rust_vec_len, data_len), -107 => wire__crate__api__query_metrics__query_content_read_stats_content_bytes_total_impl(port, ptr, rust_vec_len, data_len), -108 => wire__crate__api__query_metrics__query_content_read_stats_hydration_content_bytes_total_impl(port, ptr, rust_vec_len, data_len), -109 => wire__crate__api__query_metrics__query_content_read_stats_hydration_rows_total_impl(port, ptr, rust_vec_len, data_len), -110 => wire__crate__api__query_metrics__query_content_read_stats_rows_total_impl(port, ptr, rust_vec_len, data_len), -111 => wire__crate__api__migration_meta__read_migration_axes_impl(port, ptr, rust_vec_len, data_len), -112 => wire__crate__api__simple_rag__rebuild_bm25_index_impl(port, ptr, rust_vec_len, data_len), -113 => wire__crate__api__source_rag__rebuild_chunk_bm25_index_impl(port, ptr, rust_vec_len, data_len), -114 => wire__crate__api__source_rag__rebuild_chunk_bm25_index_for_collection_impl(port, ptr, rust_vec_len, data_len), -115 => wire__crate__api__source_rag__rebuild_chunk_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -116 => wire__crate__api__source_rag__rebuild_chunk_hnsw_index_for_collection_impl(port, ptr, rust_vec_len, data_len), -117 => wire__crate__api__simple_rag__rebuild_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -120 => wire__crate__api__hybrid_search__rrf_config_default_impl(port, ptr, rust_vec_len, data_len), -121 => wire__crate__api__source_rag__save_collection_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -122 => wire__crate__api__hnsw_index__save_hnsw_index_impl(port, ptr, rust_vec_len, data_len), -123 => wire__crate__api__source_rag__search_chunks_impl(port, ptr, rust_vec_len, data_len), -124 => wire__crate__api__source_rag__search_chunks_in_collection_impl(port, ptr, rust_vec_len, data_len), -125 => wire__crate__api__hnsw_index__search_hnsw_impl(port, ptr, rust_vec_len, data_len), -126 => wire__crate__api__hnsw_index__search_hnsw_slice_impl(port, ptr, rust_vec_len, data_len), -127 => wire__crate__api__hybrid_search__search_hybrid_impl(port, ptr, rust_vec_len, data_len), -128 => wire__crate__api__hybrid_search__search_hybrid_simple_impl(port, ptr, rust_vec_len, data_len), -129 => wire__crate__api__hybrid_search__search_hybrid_weighted_impl(port, ptr, rust_vec_len, data_len), -130 => wire__crate__api__source_rag__search_meta_hybrid_impl(port, ptr, rust_vec_len, data_len), -131 => wire__crate__api__simple_rag__search_similar_impl(port, ptr, rust_vec_len, data_len), -134 => wire__crate__api__compression_utils__sentence_hash_impl(port, ptr, rust_vec_len, data_len), -135 => wire__crate__api__compression_utils__should_compress_impl(port, ptr, rust_vec_len, data_len), -136 => wire__crate__api__compression_utils__split_sentences_impl(port, ptr, rust_vec_len, data_len), -139 => wire__crate__api__source_rag__update_chunk_embedding_impl(port, ptr, rust_vec_len, data_len), -140 => wire__crate__api__source_rag__update_chunk_reembedded_impl(port, ptr, rust_vec_len, data_len), -141 => wire__crate__api__source_rag__update_source_status_impl(port, ptr, rust_vec_len, data_len), -142 => wire__crate__api__user_intent__user_intent_get_query_impl(port, ptr, rust_vec_len, data_len), -143 => wire__crate__api__user_intent__user_intent_intent_type_impl(port, ptr, rust_vec_len, data_len), -144 => wire__crate__api__migration_meta__write_embedding_fingerprint_impl(port, ptr, rust_vec_len, data_len), +19 => wire__crate__api__source_rag__add_chunks_impl(port, ptr, rust_vec_len, data_len), +20 => wire__crate__api__simple_rag__add_document_impl(port, ptr, rust_vec_len, data_len), +21 => wire__crate__api__simple_rag__add_document_simple_impl(port, ptr, rust_vec_len, data_len), +22 => wire__crate__api__source_rag__add_source_impl(port, ptr, rust_vec_len, data_len), +23 => wire__crate__api__source_rag__add_source_in_collection_impl(port, ptr, rust_vec_len, data_len), +24 => wire__crate__api__migration_meta__begin_embedding_reembed_impl(port, ptr, rust_vec_len, data_len), +25 => wire__crate__api__source_rag__benchmark_search_chunks_linear_in_collection_impl(port, ptr, rust_vec_len, data_len), +26 => wire__crate__api__simple_rag__benchmark_search_linear_scan_impl(port, ptr, rust_vec_len, data_len), +27 => wire__crate__api__bm25_search__bm25_add_document_impl(port, ptr, rust_vec_len, data_len), +28 => wire__crate__api__bm25_search__bm25_add_documents_impl(port, ptr, rust_vec_len, data_len), +29 => wire__crate__api__bm25_search__bm25_clear_index_impl(port, ptr, rust_vec_len, data_len), +30 => wire__crate__api__bm25_search__bm25_get_document_count_impl(port, ptr, rust_vec_len, data_len), +31 => wire__crate__api__bm25_search__bm25_remove_document_impl(port, ptr, rust_vec_len, data_len), +32 => wire__crate__api__bm25_search__bm25_search_impl(port, ptr, rust_vec_len, data_len), +33 => wire__crate__api__hnsw_index__build_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +35 => wire__crate__api__semantic_chunker__chunk_type_as_str_impl(port, ptr, rust_vec_len, data_len), +36 => wire__crate__api__semantic_chunker__chunk_type_from_str_impl(port, ptr, rust_vec_len, data_len), +37 => wire__crate__api__source_rag__claim_source_for_ingestion_impl(port, ptr, rust_vec_len, data_len), +39 => wire__crate__api__simple_rag__clear_all_documents_impl(port, ptr, rust_vec_len, data_len), +40 => wire__crate__api__incremental_index__clear_buffer_impl(port, ptr, rust_vec_len, data_len), +41 => wire__crate__api__hnsw_index__clear_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +42 => wire__crate__api__source_rag__clear_source_chunks_impl(port, ptr, rust_vec_len, data_len), +43 => wire__crate__api__db_pool__close_db_pool_impl(port, ptr, rust_vec_len, data_len), +45 => wire__crate__api__compression_utils__compress_text_impl(port, ptr, rust_vec_len, data_len), +46 => wire__crate__api__compression_utils__compress_text_simple_impl(port, ptr, rust_vec_len, data_len), +47 => wire__crate__api__compression_utils__compression_options_default_impl(port, ptr, rust_vec_len, data_len), +48 => wire__crate__api__migration_meta__count_chunks_needing_reembed_impl(port, ptr, rust_vec_len, data_len), +51 => wire__crate__api__source_rag__delete_source_impl(port, ptr, rust_vec_len, data_len), +52 => wire__crate__api__source_rag__delete_source_in_collection_impl(port, ptr, rust_vec_len, data_len), +53 => wire__crate__api__source_rag__derive_context_budget_for_prompt_v2_impl(port, ptr, rust_vec_len, data_len), +54 => wire__crate__api__migration_meta__detect_embedding_fingerprint_gate_impl(port, ptr, rust_vec_len, data_len), +55 => wire__crate__api__hnsw_index__embedding_point_new_impl(port, ptr, rust_vec_len, data_len), +56 => wire__crate__api__document_parser__extract_text_from_document_impl(port, ptr, rust_vec_len, data_len), +57 => wire__crate__api__document_parser__extract_text_from_docx_impl(port, ptr, rust_vec_len, data_len), +58 => wire__crate__api__document_parser__extract_text_from_file_impl(port, ptr, rust_vec_len, data_len), +59 => wire__crate__api__document_parser__extract_text_from_pdf_impl(port, ptr, rust_vec_len, data_len), +60 => wire__crate__api__document_parser__extract_text_from_utf8_impl(port, ptr, rust_vec_len, data_len), +61 => wire__crate__api__migration_meta__finalize_embedding_reembed_impl(port, ptr, rust_vec_len, data_len), +62 => wire__crate__api__source_rag__get_adjacent_chunks_impl(port, ptr, rust_vec_len, data_len), +63 => wire__crate__api__source_rag__get_all_chunk_ids_and_contents_impl(port, ptr, rust_vec_len, data_len), +64 => wire__crate__api__source_rag__get_all_chunk_ids_and_contents_in_collection_impl(port, ptr, rust_vec_len, data_len), +65 => wire__crate__api__incremental_index__get_buffer_for_merge_impl(port, ptr, rust_vec_len, data_len), +66 => wire__crate__api__incremental_index__get_buffer_stats_impl(port, ptr, rust_vec_len, data_len), +67 => wire__crate__api__simple_rag__get_document_count_impl(port, ptr, rust_vec_len, data_len), +68 => wire__crate__api__db_pool__get_pool_stats_impl(port, ptr, rust_vec_len, data_len), +69 => wire__crate__api__source_rag__get_source_impl(port, ptr, rust_vec_len, data_len), +70 => wire__crate__api__source_rag__get_source_chunk_count_impl(port, ptr, rust_vec_len, data_len), +71 => wire__crate__api__source_rag__get_source_chunks_impl(port, ptr, rust_vec_len, data_len), +72 => wire__crate__api__source_rag__get_source_stats_impl(port, ptr, rust_vec_len, data_len), +73 => wire__crate__api__source_rag__get_source_stats_in_collection_impl(port, ptr, rust_vec_len, data_len), +74 => wire__crate__api__source_rag__get_source_status_impl(port, ptr, rust_vec_len, data_len), +77 => wire__crate__api__incremental_index__incremental_add_impl(port, ptr, rust_vec_len, data_len), +78 => wire__crate__api__incremental_index__incremental_add_batch_impl(port, ptr, rust_vec_len, data_len), +79 => wire__crate__api__incremental_index__incremental_remove_impl(port, ptr, rust_vec_len, data_len), +80 => wire__crate__api__incremental_index__incremental_search_impl(port, ptr, rust_vec_len, data_len), +82 => wire__crate__api__ingest_metrics__ingest_traffic_stats_legacy_text_traffic_total_impl(port, ptr, rust_vec_len, data_len), +83 => wire__crate__api__ingest_metrics__ingest_traffic_stats_session_text_traffic_total_impl(port, ptr, rust_vec_len, data_len), +84 => wire__crate__api__simple__init_app_impl(port, ptr, rust_vec_len, data_len), +85 => wire__crate__api__simple_rag__init_db_impl(port, ptr, rust_vec_len, data_len), +86 => wire__crate__api__db_pool__init_db_pool_impl(port, ptr, rust_vec_len, data_len), +88 => wire__crate__api__logger__init_logger_impl(port, ptr, rust_vec_len, data_len), +89 => wire__crate__api__source_rag__init_source_db_impl(port, ptr, rust_vec_len, data_len), +90 => wire__crate__api__tokenizer__init_tokenizer_impl(port, ptr, rust_vec_len, data_len), +91 => wire__crate__api__bm25_search__is_bm25_index_loaded_impl(port, ptr, rust_vec_len, data_len), +92 => wire__crate__api__source_rag__is_chunk_bm25_index_loaded_impl(port, ptr, rust_vec_len, data_len), +93 => wire__crate__api__hnsw_index__is_hnsw_index_loaded_impl(port, ptr, rust_vec_len, data_len), +94 => wire__crate__api__db_pool__is_pool_initialized_impl(port, ptr, rust_vec_len, data_len), +95 => wire__crate__api__source_rag__list_chunks_needing_reembed_impl(port, ptr, rust_vec_len, data_len), +96 => wire__crate__api__source_rag__list_sources_impl(port, ptr, rust_vec_len, data_len), +97 => wire__crate__api__source_rag__list_sources_in_collection_impl(port, ptr, rust_vec_len, data_len), +98 => wire__crate__api__source_rag__load_collection_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +99 => wire__crate__api__hnsw_index__load_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +102 => wire__crate__api__incremental_index__needs_merge_impl(port, ptr, rust_vec_len, data_len), +105 => wire__crate__api__ingest_session__prepare_source_ingestion_impl(port, ptr, rust_vec_len, data_len), +106 => wire__crate__api__ingest_session__prepare_source_ingestion_from_file_impl(port, ptr, rust_vec_len, data_len), +107 => wire__crate__api__ingest_session__prepare_source_ingestion_from_utf8_impl(port, ptr, rust_vec_len, data_len), +109 => wire__crate__api__query_metrics__query_content_read_stats_content_bytes_total_impl(port, ptr, rust_vec_len, data_len), +110 => wire__crate__api__query_metrics__query_content_read_stats_hydration_content_bytes_total_impl(port, ptr, rust_vec_len, data_len), +111 => wire__crate__api__query_metrics__query_content_read_stats_hydration_rows_total_impl(port, ptr, rust_vec_len, data_len), +112 => wire__crate__api__query_metrics__query_content_read_stats_rows_total_impl(port, ptr, rust_vec_len, data_len), +113 => wire__crate__api__migration_meta__read_migration_axes_impl(port, ptr, rust_vec_len, data_len), +114 => wire__crate__api__simple_rag__rebuild_bm25_index_impl(port, ptr, rust_vec_len, data_len), +115 => wire__crate__api__source_rag__rebuild_chunk_bm25_index_impl(port, ptr, rust_vec_len, data_len), +116 => wire__crate__api__source_rag__rebuild_chunk_bm25_index_for_collection_impl(port, ptr, rust_vec_len, data_len), +117 => wire__crate__api__source_rag__rebuild_chunk_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +118 => wire__crate__api__source_rag__rebuild_chunk_hnsw_index_for_collection_impl(port, ptr, rust_vec_len, data_len), +119 => wire__crate__api__simple_rag__rebuild_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +123 => wire__crate__api__hybrid_search__rrf_config_default_impl(port, ptr, rust_vec_len, data_len), +124 => wire__crate__api__source_rag__save_collection_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +125 => wire__crate__api__hnsw_index__save_hnsw_index_impl(port, ptr, rust_vec_len, data_len), +126 => wire__crate__api__source_rag__search_chunks_impl(port, ptr, rust_vec_len, data_len), +127 => wire__crate__api__source_rag__search_chunks_in_collection_impl(port, ptr, rust_vec_len, data_len), +128 => wire__crate__api__hnsw_index__search_hnsw_impl(port, ptr, rust_vec_len, data_len), +129 => wire__crate__api__hnsw_index__search_hnsw_slice_impl(port, ptr, rust_vec_len, data_len), +130 => wire__crate__api__hybrid_search__search_hybrid_impl(port, ptr, rust_vec_len, data_len), +131 => wire__crate__api__hybrid_search__search_hybrid_simple_impl(port, ptr, rust_vec_len, data_len), +132 => wire__crate__api__hybrid_search__search_hybrid_weighted_impl(port, ptr, rust_vec_len, data_len), +133 => wire__crate__api__source_rag__search_meta_hybrid_impl(port, ptr, rust_vec_len, data_len), +134 => wire__crate__api__simple_rag__search_similar_impl(port, ptr, rust_vec_len, data_len), +137 => wire__crate__api__compression_utils__sentence_hash_impl(port, ptr, rust_vec_len, data_len), +138 => wire__crate__api__compression_utils__should_compress_impl(port, ptr, rust_vec_len, data_len), +139 => wire__crate__api__compression_utils__split_sentences_impl(port, ptr, rust_vec_len, data_len), +143 => wire__crate__api__source_rag__update_chunk_embedding_impl(port, ptr, rust_vec_len, data_len), +144 => wire__crate__api__source_rag__update_chunk_reembedded_impl(port, ptr, rust_vec_len, data_len), +145 => wire__crate__api__source_rag__update_source_status_impl(port, ptr, rust_vec_len, data_len), +146 => wire__crate__api__user_intent__user_intent_get_query_impl(port, ptr, rust_vec_len, data_len), +147 => wire__crate__api__user_intent__user_intent_intent_type_impl(port, ptr, rust_vec_len, data_len), +148 => wire__crate__api__migration_meta__write_embedding_fingerprint_impl(port, ptr, rust_vec_len, data_len), _ => unreachable!(), } } @@ -6825,51 +6991,69 @@ fn pde_ffi_dispatcher_sync_impl( ) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { // Codec=Pde (Serialization + dispatch), see doc to use other codecs match func_id { - 33 => wire__crate__api__simple_rag__calculate_cosine_similarity_impl( + 18 => wire__crate__api__activation_metrics__activation_timing_stats_impl( + ptr, + rust_vec_len, + data_len, + ), + 34 => wire__crate__api__simple_rag__calculate_cosine_similarity_impl( ptr, rust_vec_len, data_len, ), - 37 => wire__crate__api__semantic_chunker__classify_chunk_impl(ptr, rust_vec_len, data_len), - 43 => wire__crate__api__logger__close_log_stream_impl(ptr, rust_vec_len, data_len), - 48 => wire__crate__api__tokenizer__count_tokens_impl(ptr, rust_vec_len, data_len), - 49 => wire__crate__api__tokenizer__decode_tokens_impl(ptr, rust_vec_len, data_len), - 74 => wire__crate__api__tokenizer__get_vocab_size_impl(ptr, rust_vec_len, data_len), - 75 => wire__crate__api__simple__greet_impl(ptr, rust_vec_len, data_len), - 80 => { + 38 => wire__crate__api__semantic_chunker__classify_chunk_impl(ptr, rust_vec_len, data_len), + 44 => wire__crate__api__logger__close_log_stream_impl(ptr, rust_vec_len, data_len), + 49 => wire__crate__api__tokenizer__count_tokens_impl(ptr, rust_vec_len, data_len), + 50 => wire__crate__api__tokenizer__decode_tokens_impl(ptr, rust_vec_len, data_len), + 75 => wire__crate__api__tokenizer__get_vocab_size_impl(ptr, rust_vec_len, data_len), + 76 => wire__crate__api__simple__greet_impl(ptr, rust_vec_len, data_len), + 81 => { wire__crate__api__ingest_metrics__ingest_traffic_stats_impl(ptr, rust_vec_len, data_len) } - 86 => wire__crate__api__logger__init_log_stream_impl(ptr, rust_vec_len, data_len), - 99 => wire__crate__api__semantic_chunker__markdown_chunk_impl(ptr, rust_vec_len, data_len), - 101 => wire__crate__api__user_intent__parse_intent_impl(ptr, rust_vec_len, data_len), - 102 => wire__crate__api__user_intent__parse_user_intent_impl(ptr, rust_vec_len, data_len), - 106 => wire__crate__api__query_metrics__query_content_read_stats_impl( + 87 => wire__crate__api__logger__init_log_stream_impl(ptr, rust_vec_len, data_len), + 100 => wire__crate__api__semantic_chunker__markdown_chunk_impl(ptr, rust_vec_len, data_len), + 101 => { + wire__crate__api__runtime_info__native_runtime_info_impl(ptr, rust_vec_len, data_len) + } + 103 => wire__crate__api__user_intent__parse_intent_impl(ptr, rust_vec_len, data_len), + 104 => wire__crate__api__user_intent__parse_user_intent_impl(ptr, rust_vec_len, data_len), + 108 => wire__crate__api__query_metrics__query_content_read_stats_impl( + ptr, + rust_vec_len, + data_len, + ), + 120 => wire__crate__api__activation_metrics__reset_activation_timing_stats_impl( + ptr, + rust_vec_len, + data_len, + ), + 121 => wire__crate__api__ingest_metrics__reset_ingest_traffic_stats_impl( ptr, rust_vec_len, data_len, ), - 118 => wire__crate__api__ingest_metrics__reset_ingest_traffic_stats_impl( + 122 => wire__crate__api__query_metrics__reset_query_content_read_stats_impl( ptr, rust_vec_len, data_len, ), - 119 => wire__crate__api__query_metrics__reset_query_content_read_stats_impl( + 135 => wire__crate__api__semantic_chunker__semantic_chunk_impl(ptr, rust_vec_len, data_len), + 136 => wire__crate__api__semantic_chunker__semantic_chunk_with_overlap_impl( ptr, rust_vec_len, data_len, ), - 132 => wire__crate__api__semantic_chunker__semantic_chunk_impl(ptr, rust_vec_len, data_len), - 133 => wire__crate__api__semantic_chunker__semantic_chunk_with_overlap_impl( + 140 => wire__crate__api__activation_metrics__take_activation_timing_stats_impl( ptr, rust_vec_len, data_len, ), - 137 => wire__crate__api__query_metrics__take_query_content_read_stats_impl( + 141 => wire__crate__api__query_metrics__take_query_content_read_stats_impl( ptr, rust_vec_len, data_len, ), - 138 => wire__crate__api__tokenizer__tokenize_impl(ptr, rust_vec_len, data_len), + 142 => wire__crate__api__tokenizer__tokenize_impl(ptr, rust_vec_len, data_len), _ => unreachable!(), } } @@ -6906,6 +7090,37 @@ impl flutter_rust_bridge::IntoIntoDart> for SearchHandl } } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::activation_metrics::ActivationTimingStats { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.activate_total_nanos.into_into_dart().into_dart(), + self.activate_count.into_into_dart().into_dart(), + self.bm25_rebuild_nanos.into_into_dart().into_dart(), + self.bm25_rebuild_count.into_into_dart().into_dart(), + self.hnsw_load_nanos.into_into_dart().into_dart(), + self.hnsw_load_count.into_into_dart().into_dart(), + self.hnsw_load_success_count.into_into_dart().into_dart(), + self.hnsw_load_miss_count.into_into_dart().into_dart(), + self.hnsw_rebuild_nanos.into_into_dart().into_dart(), + self.hnsw_rebuild_count.into_into_dart().into_dart(), + self.hnsw_save_nanos.into_into_dart().into_dart(), + self.hnsw_save_count.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::activation_metrics::ActivationTimingStats +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::activation_metrics::ActivationTimingStats +{ + fn into_into_dart(self) -> crate::api::activation_metrics::ActivationTimingStats { + self + } +} // Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::simple_rag::AddDocumentResult { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { @@ -7508,6 +7723,27 @@ impl flutter_rust_bridge::IntoIntoDart flutter_rust_bridge::for_generated::DartAbi { + [ + self.native_allocator.into_into_dart().into_dart(), + self.rust_features.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::runtime_info::NativeRuntimeInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::runtime_info::NativeRuntimeInfo +{ + fn into_into_dart(self) -> crate::api::runtime_info::NativeRuntimeInfo { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::user_intent::ParsedIntent { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -7982,6 +8218,24 @@ impl SseEncode for String { } } +impl SseEncode for crate::api::activation_metrics::ActivationTimingStats { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.activate_total_nanos, serializer); + ::sse_encode(self.activate_count, serializer); + ::sse_encode(self.bm25_rebuild_nanos, serializer); + ::sse_encode(self.bm25_rebuild_count, serializer); + ::sse_encode(self.hnsw_load_nanos, serializer); + ::sse_encode(self.hnsw_load_count, serializer); + ::sse_encode(self.hnsw_load_success_count, serializer); + ::sse_encode(self.hnsw_load_miss_count, serializer); + ::sse_encode(self.hnsw_rebuild_nanos, serializer); + ::sse_encode(self.hnsw_rebuild_count, serializer); + ::sse_encode(self.hnsw_save_nanos, serializer); + ::sse_encode(self.hnsw_save_count, serializer); + } +} + impl SseEncode for crate::api::simple_rag::AddDocumentResult { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -8522,6 +8776,14 @@ impl SseEncode for crate::api::migration_meta::MigrationAxes { } } +impl SseEncode for crate::api::runtime_info::NativeRuntimeInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.native_allocator, serializer); + ::sse_encode(self.rust_features, serializer); + } +} + impl SseEncode for Option> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { diff --git a/rust_builder/rust/src/lib.rs b/rust_builder/rust/src/lib.rs index ae8fa13..b845664 100644 --- a/rust_builder/rust/src/lib.rs +++ b/rust_builder/rust/src/lib.rs @@ -5,6 +5,13 @@ // This file is part of the core engine. Any modifications require owner approval. // Please submit a PR with detailed explanation of changes before modifying. +#[cfg(feature = "allocator_mimalloc")] +use mimalloc::MiMalloc; + +#[cfg(feature = "allocator_mimalloc")] +#[global_allocator] +static GLOBAL_ALLOCATOR: MiMalloc = MiMalloc; + pub mod api; mod frb_generated; From 588e65ed3dfa56744df37426669d84b17c0a5728 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:50:40 +0900 Subject: [PATCH 3/8] docs(perf): record mimalloc allocator evidence --- docs/perf/mimalloc-allocator-ab/README.md | 112 +++++++++ docs/perf/mimalloc-allocator-ab/RESULTS.md | 89 ++++++++ ...indexing_profile_latest_mimalloc_500.jsonl | 1 + ...g_profile_mimalloc_10000_20000_50000.jsonl | 3 + ...exing_profile_mimalloc_500_2000_5000.jsonl | 3 + .../crashlogs/system_crashlogs_list.txt | 77 +++++++ .../profile_mimalloc_10000_rep1.jsonl | 1 + .../profile_mimalloc_10000_rep2.jsonl | 1 + .../profile_mimalloc_10000_rep3.jsonl | 1 + .../profile_mimalloc_10000_rep4.jsonl | 1 + .../profile_mimalloc_10000_rep5.jsonl | 1 + .../profile_mimalloc_20000_rep1.jsonl | 1 + .../profile_mimalloc_20000_rep2.jsonl | 1 + .../profile_mimalloc_20000_rep3.jsonl | 1 + .../profile_mimalloc_20000_rep4.jsonl | 1 + .../profile_mimalloc_20000_rep5.jsonl | 1 + .../profile_mimalloc_50000_rep1.jsonl | 1 + .../profile_mimalloc_50000_rep2.jsonl | 1 + .../profile_mimalloc_50000_rep3.jsonl | 1 + .../profile_mimalloc_50000_rep4.jsonl | 1 + .../profile_mimalloc_50000_rep5.jsonl | 1 + .../summary_medians.json | 215 ++++++++++++++++++ .../system/profile_system_10000_rep1.jsonl | 1 + .../system/profile_system_10000_rep2.jsonl | 1 + .../system/profile_system_10000_rep3.jsonl | 1 + .../system/profile_system_10000_rep4.jsonl | 1 + .../system/profile_system_10000_rep5.jsonl | 1 + .../system/profile_system_20000_rep1.jsonl | 1 + .../system/profile_system_20000_rep2.jsonl | 1 + .../system/profile_system_20000_rep3.jsonl | 1 + .../system/profile_system_20000_rep4.jsonl | 1 + .../system/profile_system_20000_rep5.jsonl | 1 + .../system/profile_system_50000_rep1.jsonl | 1 + .../system/profile_system_50000_rep2.jsonl | 1 + .../system/profile_system_50000_rep3.jsonl | 1 + .../system/profile_system_50000_rep4.jsonl | 1 + .../system/profile_system_50000_rep5.jsonl | 1 + ...r_indexing_profile_latest_system_500.jsonl | 1 + ...ing_profile_system_10000_20000_50000.jsonl | 3 + ...ndexing_profile_system_500_2000_5000.jsonl | 3 + ...g_profile_mimalloc_10000_20000_50000.jsonl | 3 + .../profile_mimalloc_10000_rep1.jsonl | 1 + .../profile_mimalloc_10000_rep2.jsonl | 1 + .../profile_mimalloc_10000_rep3.jsonl | 1 + .../profile_mimalloc_10000_rep4.jsonl | 1 + .../profile_mimalloc_10000_rep5.jsonl | 1 + .../profile_mimalloc_20000_rep1.jsonl | 1 + .../profile_mimalloc_20000_rep2.jsonl | 1 + .../profile_mimalloc_20000_rep3.jsonl | 1 + .../profile_mimalloc_20000_rep4.jsonl | 1 + .../profile_mimalloc_20000_rep5.jsonl | 1 + .../profile_mimalloc_50000_rep1.jsonl | 1 + .../profile_mimalloc_50000_rep2.jsonl | 1 + .../profile_mimalloc_50000_rep3.jsonl | 1 + .../profile_mimalloc_50000_rep4.jsonl | 1 + .../profile_mimalloc_50000_rep5.jsonl | 1 + .../summary_medians.json | 215 ++++++++++++++++++ .../system/profile_system_10000_rep1.jsonl | 1 + .../system/profile_system_10000_rep2.jsonl | 1 + .../system/profile_system_10000_rep3.jsonl | 1 + .../system/profile_system_10000_rep4.jsonl | 1 + .../system/profile_system_10000_rep5.jsonl | 1 + .../system/profile_system_20000_rep1.jsonl | 1 + .../system/profile_system_20000_rep2.jsonl | 1 + .../system/profile_system_20000_rep3.jsonl | 1 + .../system/profile_system_20000_rep4.jsonl | 1 + .../system/profile_system_20000_rep5.jsonl | 1 + .../system/profile_system_50000_rep1.jsonl | 1 + .../system/profile_system_50000_rep2.jsonl | 1 + .../system/profile_system_50000_rep3.jsonl | 1 + .../system/profile_system_50000_rep4.jsonl | 1 + .../system/profile_system_50000_rep5.jsonl | 1 + ...ing_profile_system_10000_20000_50000.jsonl | 3 + 73 files changed, 788 insertions(+) create mode 100644 docs/perf/mimalloc-allocator-ab/README.md create mode 100644 docs/perf/mimalloc-allocator-ab/RESULTS.md create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_latest_mimalloc_500.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_500_2000_5000.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/crashlogs/system_crashlogs_list.txt create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/summary_medians.json create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_latest_system_500.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_10000_20000_50000.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_500_2000_5000.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/summary_medians.json create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-system/allocator_indexing_profile_system_10000_20000_50000.jsonl diff --git a/docs/perf/mimalloc-allocator-ab/README.md b/docs/perf/mimalloc-allocator-ab/README.md new file mode 100644 index 0000000..e291fec --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/README.md @@ -0,0 +1,112 @@ +# Mimalloc Allocator A/B Runbook + +This runbook validates whether `allocator_mimalloc` should remain feature-gated, +become a default-enable candidate, or be dropped. + +## Principle + +Compare two builds from the same instrumentation commit: + +- System allocator: native Rust features without `allocator_mimalloc`. +- Mimalloc: same features plus `allocator_mimalloc`. + +Do not compare `main` against an instrumented branch. The allocator feature must +be the only intended difference between the two measured variants. + +## Scope + +`#[global_allocator]` affects Rust global allocations in this native crate and +Rust dependencies. It does not replace Dart VM, Flutter engine, ONNX Runtime, +SQLite C pager/cache, OS file cache, or arbitrary C/C++ allocators. + +RSS metrics are full-process directional evidence only. + +## Required Variants + +System allocator expected values: + +```bash +--dart-define=EXPECTED_NATIVE_ALLOCATOR=system +--dart-define=EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8 +``` + +Mimalloc expected values: + +```bash +--dart-define=EXPECTED_NATIVE_ALLOCATOR=mimalloc +--dart-define=EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8,allocator_mimalloc +``` + +## Measurement Commands + +Query profile: + +```bash +cd example +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/query_profile_measure_test.dart \ + --profile -d \ + --dart-define=EXPECTED_NATIVE_ALLOCATOR= \ + --dart-define=EXPECTED_RUST_FEATURES= +``` + +Allocator-sensitive indexing macro: + +```bash +cd example +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/allocator_indexing_measure_test.dart \ + --profile -d \ + --dart-define=EXPECTED_NATIVE_ALLOCATOR= \ + --dart-define=EXPECTED_RUST_FEATURES= \ + --dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 +``` + +`ALLOCATOR_INDEXING_TEXT_MB` controls generated text scale in decimal MB. The +current macro uses 500-char chunks, 30-char overlap metadata, and 384-dim stub +embeddings. A 5/10/25 MB run maps to 10k/20k/50k generated chunks. + +Android arm64 build smoke: + +```bash +flutter build apk --profile --target-platform android-arm64 +``` + +## Run Order + +Use paired, counterbalanced runs on the same physical device and OS: + +```text +system, mimalloc, system, mimalloc, system, mimalloc +``` + +Collect at least three valid runs per variant. + +## Required Evidence + +- Device model, OS version, battery/thermal state. +- Git SHA and native artifact hash. +- APK/app/framework size. +- `native_allocator` and exact `rust_features`. +- Query profile CSV/JSON exports. +- `INDEXING_PROFILE` log rows. In older run artifacts, treat the `docs` field + as chunk/vector-point count, not source-document count. +- Crash, test failure, or FRB content-hash mismatch notes. + +## Decision Threshold + +`DEFAULT_ENABLE_CANDIDATE` requires all of the following: + +- Android physical-device and iOS physical-device profile runs complete. +- No crash, no FRB content-hash mismatch, no test regression. +- At least one allocator-sensitive win: + - activation p50 improves by at least 10%, or + - large indexing/reindexing macro time improves by at least 10%, or + - peak RSS improves by at least 8%. +- Warm `search` and `hydrate` p95 do not regress by more than 5%. +- Binary size delta is acceptable for the package release. + +If results are noise-level, keep the feature gate but do not default-enable +mimalloc. diff --git a/docs/perf/mimalloc-allocator-ab/RESULTS.md b/docs/perf/mimalloc-allocator-ab/RESULTS.md new file mode 100644 index 0000000..29414b2 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/RESULTS.md @@ -0,0 +1,89 @@ +# Mimalloc Allocator A/B Results + +Status: feature-gated candidate, not default-enable. + +## Scope Correction + +The current allocator indexing macro is text-scale based: + +- `ALLOCATOR_INDEXING_TEXT_MB=5,10,25` +- 500-char generated chunks. +- 30-char overlap metadata. +- 384-dim stub embeddings. + +That maps to 10k/20k/50k generated chunks. Older run artifacts in this folder +used a legacy `docs` field with 32-dim embeddings and roughly 50-byte synthetic +chunks. In those older artifacts, `docs` means chunk/vector-point count, not +source-document count. + +## Decision + +Keep `allocator_mimalloc` behind a feature gate. The repeated iOS and macOS +legacy macro runs show a consistent rebuild-time win, but peak RSS rises with +mimalloc and those runs used the older 32-dim synthetic corpus. + +Do not default-enable mimalloc until the current realistic macro has paired +physical-device results: + +- 5/10/25 MB text scale, mapping to 10k/20k/50k chunks. +- Physical iOS and Android profile runs. +- Warm query/search/hydrate regression guard. + +## Legacy Repeated Indexing Macro Medians + +Each row uses 5 runs per variant. These are legacy synthetic runs retained as +allocator-pressure evidence, not final product-scale evidence. + +### iPad 10, iOS 26.5 + +Run folder: +`docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/` + +| Chunks | System total ms | Mimalloc total ms | Delta | System peak RSS MiB | Mimalloc peak RSS MiB | Peak delta | +| ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| 10,000 | 1345.418 | 1158.844 | -13.9% | 83.66 | 94.50 | +13.0% | +| 20,000 | 3816.418 | 3217.003 | -15.7% | 113.55 | 133.63 | +17.7% | +| 50,000 | 10483.004 | 8393.048 | -19.9% | 182.02 | 218.25 | +19.9% | + +### macOS + +Run folder: +`docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/` + +| Chunks | System total ms | Mimalloc total ms | Delta | System peak RSS MiB | Mimalloc peak RSS MiB | Peak delta | +| ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| 10,000 | 1006.692 | 881.308 | -12.5% | 139.11 | 146.61 | +5.4% | +| 20,000 | 2997.313 | 2796.225 | -6.7% | 175.25 | 181.44 | +3.5% | +| 50,000 | 7975.187 | 6565.609 | -17.7% | 253.64 | 268.45 | +5.8% | + +## Interpretation + +The timing win is concentrated in HNSW rebuild. That makes mimalloc a valid +candidate for activation/indexing/reindexing pressure, but the RSS tradeoff is +real enough that the branch should not convert it into a default release choice +yet. + +The safer near-term optimization is to reduce peak allocation in the rebuild +pipeline itself instead of relying only on allocator behavior. + +## Safe Optimization Shortlist + +1. Stream HNSW rebuild rows instead of collecting `Vec<(i64, Vec)>`. + Count rows first to size the HNSW index, then insert while iterating SQLite + rows. This targets peak RSS directly. + +2. Stream BM25 rebuild rows instead of collecting `Vec<(i64, String)>`. + Add each document to the in-memory BM25 index as rows are read from SQLite. + +3. Reduce BM25 tokenization allocation. + Build per-document term frequencies without first materializing a full + `Vec` and then cloning tokens into a second map. + +4. Run the current realistic indexing macro. + The harness now emits text scale, chunk count, 500-char chunk size, 384-dim + embedding payload, allocator label, feature label, rebuild timings, and RSS. + +5. Evaluate SQLite PRAGMAs as a separate track. + `mmap_size`, `cache_size`, `temp_store`, WAL, and checkpoint behavior should + be A/B tested separately. Do not wire a SQLite custom allocator to mimalloc + in this branch; it is process-global and higher risk on Apple platforms. diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_latest_mimalloc_500.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_latest_mimalloc_500.jsonl new file mode 100644 index 0000000..2ca5f00 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_latest_mimalloc_500.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":500,"embedding_dim":32,"seed_ms":5.177,"rebuild_total_ms":34.043,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":22998875,"hnsw_rebuild_count":1,"hnsw_save_nanos":4679958,"hnsw_save_count":1,"bm25_rebuild_nanos":5005333,"bm25_rebuild_count":1,"rss_start_bytes":85622784,"rss_end_bytes":87670784,"rss_peak_bytes":87670784,"rss_delta_bytes":2048000,"rss_samples_bytes":[85622784,87064576,87670784]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl new file mode 100644 index 0000000..5c33f95 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":66.025,"rebuild_total_ms":1089.14,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1059391375,"hnsw_rebuild_count":1,"hnsw_save_nanos":9341000,"hnsw_save_count":1,"bm25_rebuild_nanos":19858083,"bm25_rebuild_count":1,"rss_start_bytes":109084672,"rss_end_bytes":119685120,"rss_peak_bytes":119685120,"rss_delta_bytes":10600448,"rss_samples_bytes":[109084672,119013376,119685120]} +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":117.724,"rebuild_total_ms":3022.769,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2974116375,"hnsw_rebuild_count":1,"hnsw_save_nanos":11395625,"hnsw_save_count":1,"bm25_rebuild_nanos":36660833,"bm25_rebuild_count":1,"rss_start_bytes":176619520,"rss_end_bytes":201900032,"rss_peak_bytes":201900032,"rss_delta_bytes":25280512,"rss_samples_bytes":[176619520,201883648,201900032]} +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":308.199,"rebuild_total_ms":9211.633,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":9092136292,"hnsw_rebuild_count":1,"hnsw_save_nanos":27282708,"hnsw_save_count":1,"bm25_rebuild_nanos":91663500,"bm25_rebuild_count":1,"rss_start_bytes":276987904,"rss_end_bytes":322519040,"rss_peak_bytes":322519040,"rss_delta_bytes":45531136,"rss_samples_bytes":[276987904,322519040,322519040]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_500_2000_5000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_500_2000_5000.jsonl new file mode 100644 index 0000000..7c40385 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/allocator_indexing_profile_mimalloc_500_2000_5000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":500,"embedding_dim":32,"seed_ms":4.75,"rebuild_total_ms":41.012,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":28190125,"hnsw_rebuild_count":1,"hnsw_save_nanos":4864667,"hnsw_save_count":1,"bm25_rebuild_nanos":2778500,"bm25_rebuild_count":1,"rss_start_bytes":83132416,"rss_end_bytes":87687168,"rss_peak_bytes":87687168,"rss_delta_bytes":4554752,"rss_samples_bytes":[83132416,86818816,87687168]} +{"cell":"indexing_rebuild","docs":2000,"embedding_dim":32,"seed_ms":12.975,"rebuild_total_ms":178.57,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":172903167,"hnsw_rebuild_count":1,"hnsw_save_nanos":1531750,"hnsw_save_count":1,"bm25_rebuild_nanos":3801333,"bm25_rebuild_count":1,"rss_start_bytes":93896704,"rss_end_bytes":96894976,"rss_peak_bytes":96894976,"rss_delta_bytes":2998272,"rss_samples_bytes":[93896704,96845824,96894976]} +{"cell":"indexing_rebuild","docs":5000,"embedding_dim":32,"seed_ms":26.331,"rebuild_total_ms":500.738,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":488614917,"hnsw_rebuild_count":1,"hnsw_save_nanos":2514792,"hnsw_save_count":1,"bm25_rebuild_nanos":9293417,"bm25_rebuild_count":1,"rss_start_bytes":108724224,"rss_end_bytes":111689728,"rss_peak_bytes":111689728,"rss_delta_bytes":2965504,"rss_samples_bytes":[108724224,111689728,111689728]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/crashlogs/system_crashlogs_list.txt b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/crashlogs/system_crashlogs_list.txt new file mode 100644 index 0000000..cdd4b8a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-mimalloc/crashlogs/system_crashlogs_list.txt @@ -0,0 +1,77 @@ +Failed to load provisioning paramter list due to error: Error Domain=com.apple.dt.CoreDeviceError Code=1002 "No provider was found." UserInfo={NSLocalizedDescription=No provider was found.}. +`devicectl manage create` may support a reduced set of arguments. +02:30:29 Acquired tunnel connection to device. +02:30:29 Enabling developer disk image services. +02:30:30 Acquired usage assertion. +69 files: +Name URL Resources Size Modification date +------------------------------------------------------------------------------- ----------------------------- --------- ----------------- +Assistant/SpeechLogs Writable, Readable, Directory 64 bytes 1/12/26, 5:35 PM +DiagnosticLogs Writable, Readable, Directory 96 bytes 1/13/26, 11:10 PM +Retired Writable, Readable, Directory 64 bytes 1/13/26, 2:22 AM +ExcUserFault_ChatGPT-2026-06-01-194151.ips Writable, Readable 5 KB 6/1/26, 7:41 PM +JetsamEvent-2026-06-10-103809.ips Writable, Readable 139 KB 6/10/26, 10:38 AM +spotlightknowledged.cpu_resource-2026-06-10-104328.ips Writable, Readable 43 KB 6/10/26, 10:43 AM +spotlightknowledged.cpu_resource-2026-06-10-122341.ips Writable, Readable 23 KB 6/10/26, 12:23 PM +LowBatteryLog-2026-06-11-090411.ips Writable, Readable 23 KB 6/11/26, 9:04 AM +gpuEvent-MobileSafari-2026-06-14-185042.ips Writable, Readable 953 bytes 6/14/26, 6:50 PM +biomesyncd.diskwrites_resource-2026-06-14-194440.ips Writable, Readable 106 KB 6/14/26, 7:44 PM +ota_patch.txt Writable, Readable 29 KB 6/16/26, 1:10 PM +JetsamEvent-2026-06-16-131520.ips Writable, Readable 259 KB 6/16/26, 1:15 PM +lsd.diskwrites_resource-2026-06-16-025806.ips Writable, Readable 115 KB 6/16/26, 2:58 AM +STExtractionService.privileged.diskwrites_resource-2026-06-16-051510.ips Writable, Readable 144 KB 6/16/26, 5:15 AM +com.apple.WebKit.WebContent.EnhancedSecurity.cpu_resource-2026-06-19-223254.ips Writable, Readable 98 KB 6/19/26, 10:32 PM +SiriSearchFeedback-2026-06-19-234234.ips Writable, Readable 350 bytes 6/19/26, 11:42 PM +SiriSearchFeedback-2026-06-19-234226.ips Writable, Readable 338 bytes 6/19/26, 11:42 PM +duetexpertd.cpu_resource-2026-06-19-234709.ips Writable, Readable 52 KB 6/19/26, 11:47 PM +lsd.diskwrites_resource-2026-06-19-011448.ips Writable, Readable 68 KB 6/19/26, 1:14 AM +PerfPowerServices.diskwrites_resource-2026-06-19-022246.ips Writable, Readable 66 KB 6/19/26, 2:22 AM +searchd.diskwrites_resource-2026-06-19-191231.ips Writable, Readable 147 KB 6/19/26, 7:12 PM +SiriSearchFeedback-2026-06-19-194859.ips Writable, Readable 350 bytes 6/19/26, 7:48 PM +SiriSearchFeedback-2026-06-19-194818.ips Writable, Readable 338 bytes 6/19/26, 7:48 PM +SiriSearchFeedback-2026-06-19-200724.ips Writable, Readable 350 bytes 6/19/26, 8:07 PM +gpuEvent-MobileSafari-2026-06-02-021051.ips Writable, Readable 953 bytes 6/2/26, 2:10 AM +SiriSearchFeedback-2026-06-20-204124.ips Writable, Readable 338 bytes 6/20/26, 8:41 PM +SiriSearchFeedback-2026-06-23-012530.ips Writable, Readable 350 bytes 6/23/26, 1:25 AM +SiriSearchFeedback-2026-06-23-012529.ips Writable, Readable 338 bytes 6/23/26, 1:25 AM +JetsamEvent-2026-06-23-133122.ips Writable, Readable 198 KB 6/23/26, 1:31 PM +SiriSearchFeedback-2026-06-23-133150.ips Writable, Readable 349 bytes 6/23/26, 1:31 PM +SiriSearchFeedback-2026-06-23-013312.ips Writable, Readable 350 bytes 6/23/26, 1:33 AM +SiriSearchFeedback-2026-06-23-014634.ips Writable, Readable 350 bytes 6/23/26, 1:46 AM +SiriSearchFeedback-2026-06-23-015404.ips Writable, Readable 350 bytes 6/23/26, 1:54 AM +SiriSearchFeedback-2026-06-23-021138.ips Writable, Readable 350 bytes 6/23/26, 2:11 AM +SiriSearchFeedback-2026-06-23-024111.ips Writable, Readable 350 bytes 6/23/26, 2:41 AM +SiriSearchFeedback-2026-06-27-230102.ips Writable, Readable 350 bytes 6/27/26, 11:01 PM +SiriSearchFeedback-2026-06-27-230607.ips Writable, Readable 350 bytes 6/27/26, 11:06 PM +SiriSearchFeedback-2026-06-27-232247.ips Writable, Readable 350 bytes 6/27/26, 11:22 PM +SiriSearchFeedback-2026-06-27-233502.ips Writable, Readable 350 bytes 6/27/26, 11:35 PM +SiriSearchFeedback-2026-06-27-235507.ips Writable, Readable 350 bytes 6/27/26, 11:55 PM +spotlightknowledged.cpu_resource-2026-06-27-192741.ips Writable, Readable 65 KB 6/27/26, 7:27 PM +SiriSearchFeedback-2026-06-28-000005.ips Writable, Readable 350 bytes 6/28/26, 12:00 AM +com.apple.WebKit.WebContent.cpu_resource-2026-06-28-000805.ips Writable, Readable 705 KB 6/28/26, 12:08 AM +SiriSearchFeedback-2026-06-28-001255.ips Writable, Readable 350 bytes 6/28/26, 12:12 AM +com.apple.WebKit.WebContent.cpu_resource-2026-06-28-002124.ips Writable, Readable 549 KB 6/28/26, 12:21 AM +SiriSearchFeedback-2026-06-28-002352.ips Writable, Readable 350 bytes 6/28/26, 12:23 AM +SiriSearchFeedback-2026-06-28-005126.ips Writable, Readable 350 bytes 6/28/26, 12:51 AM +SiriSearchFeedback-2026-06-28-005500.ips Writable, Readable 350 bytes 6/28/26, 12:55 AM +SiriSearchFeedback-2026-06-28-011254.ips Writable, Readable 350 bytes 6/28/26, 1:12 AM +DiagnosticLogs/Search Writable, Readable, Directory 96 bytes 6/29/26, 1:06 AM +DiagnosticLogs/Search/spotlight_heartbeat_last.log Writable, Readable 16 KB 6/29/26, 1:06 AM +Assistant Writable, Readable, Directory 96 bytes 6/29/26, 2:29 AM +JetsamEvent-2026-06-04-230041.ips Writable, Readable 213 KB 6/4/26, 11:00 PM +JetsamEvent-2026-06-04-232150.ips Writable, Readable 200 KB 6/4/26, 11:21 PM +JetsamEvent-2026-06-04-233030.ips Writable, Readable 448 KB 6/4/26, 11:30 PM +JetsamEvent-2026-06-04-233118.ips Writable, Readable 134 KB 6/4/26, 11:31 PM +JetsamEvent-2026-06-04-233449.ips Writable, Readable 157 KB 6/4/26, 11:34 PM +JetsamEvent-2026-06-04-233941.ips Writable, Readable 212 KB 6/4/26, 11:39 PM +Runner.cpu_resource-2026-06-05-113905.ips Writable, Readable 20 KB 6/5/26, 11:39 AM +JetsamEvent-2026-06-05-000009.ips Writable, Readable 171 KB 6/5/26, 12:00 AM +JetsamEvent-2026-06-05-000119.ips Writable, Readable 144 KB 6/5/26, 12:01 AM +JetsamEvent-2026-06-05-000306.ips Writable, Readable 249 KB 6/5/26, 12:03 AM +JetsamEvent-2026-06-05-000341.ips Writable, Readable 140 KB 6/5/26, 12:03 AM +spotlightknowledged.cpu_resource-2026-06-05-163628.ips Writable, Readable 16 KB 6/5/26, 4:36 PM +spotlightknowledged.cpu_resource-2026-06-06-122448.ips Writable, Readable 25 KB 6/6/26, 12:24 PM +spotlightknowledged.cpu_resource-2026-06-07-122358.ips Writable, Readable 31 KB 6/7/26, 12:23 PM +spotlightknowledged.cpu_resource-2026-06-08-104246.ips Writable, Readable 37 KB 6/8/26, 10:42 AM +JetsamEvent-2026-06-08-225830.ips Writable, Readable 233 KB 6/8/26, 10:58 PM +spotlightknowledged.cpu_resource-2026-06-09-122345.ips Writable, Readable 33 KB 6/9/26, 12:23 PM diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep1.jsonl new file mode 100644 index 0000000..0d194aa --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":61.378,"rebuild_total_ms":1220.476,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1190087167,"hnsw_rebuild_count":1,"hnsw_save_nanos":8962542,"hnsw_save_count":1,"bm25_rebuild_nanos":20876084,"bm25_rebuild_count":1,"rss_start_bytes":90914816,"rss_end_bytes":106201088,"rss_peak_bytes":106201088,"rss_delta_bytes":15286272,"rss_samples_bytes":[90914816,105529344,106201088]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep2.jsonl new file mode 100644 index 0000000..fa88cd4 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":58.84,"rebuild_total_ms":1065.636,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1041333625,"hnsw_rebuild_count":1,"hnsw_save_nanos":4896250,"hnsw_save_count":1,"bm25_rebuild_nanos":19006875,"bm25_rebuild_count":1,"rss_start_bytes":83574784,"rss_end_bytes":99188736,"rss_peak_bytes":99188736,"rss_delta_bytes":15613952,"rss_samples_bytes":[83574784,98549760,99188736]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep3.jsonl new file mode 100644 index 0000000..4b8865a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":56.871,"rebuild_total_ms":1158.844,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1134032959,"hnsw_rebuild_count":1,"hnsw_save_nanos":5555333,"hnsw_save_count":1,"bm25_rebuild_nanos":18795416,"bm25_rebuild_count":1,"rss_start_bytes":83083264,"rss_end_bytes":99090432,"rss_peak_bytes":99090432,"rss_delta_bytes":16007168,"rss_samples_bytes":[83083264,98418688,99090432]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep4.jsonl new file mode 100644 index 0000000..3ce140f --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":55.675,"rebuild_total_ms":1163.35,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1139264666,"hnsw_rebuild_count":1,"hnsw_save_nanos":4838750,"hnsw_save_count":1,"bm25_rebuild_nanos":18742833,"bm25_rebuild_count":1,"rss_start_bytes":83066880,"rss_end_bytes":98664448,"rss_peak_bytes":98664448,"rss_delta_bytes":15597568,"rss_samples_bytes":[83066880,97976320,98664448]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep5.jsonl new file mode 100644 index 0000000..dd4966e --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_10000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":60.194,"rebuild_total_ms":1103.077,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1078925375,"hnsw_rebuild_count":1,"hnsw_save_nanos":4867083,"hnsw_save_count":1,"bm25_rebuild_nanos":18751833,"bm25_rebuild_count":1,"rss_start_bytes":83017728,"rss_end_bytes":98631680,"rss_peak_bytes":98631680,"rss_delta_bytes":15613952,"rss_samples_bytes":[83017728,97959936,98631680]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep1.jsonl new file mode 100644 index 0000000..23dc6c0 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":133.28,"rebuild_total_ms":3124.766,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":3068786791,"hnsw_rebuild_count":1,"hnsw_save_nanos":16587334,"hnsw_save_count":1,"bm25_rebuild_nanos":38757291,"bm25_rebuild_count":1,"rss_start_bytes":121389056,"rss_end_bytes":143360000,"rss_peak_bytes":143360000,"rss_delta_bytes":21970944,"rss_samples_bytes":[121389056,142884864,143360000]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep2.jsonl new file mode 100644 index 0000000..d83bcce --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":129.898,"rebuild_total_ms":3217.003,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":3166727833,"hnsw_rebuild_count":1,"hnsw_save_nanos":12028083,"hnsw_save_count":1,"bm25_rebuild_nanos":37649750,"bm25_rebuild_count":1,"rss_start_bytes":108249088,"rss_end_bytes":140115968,"rss_peak_bytes":140115968,"rss_delta_bytes":31866880,"rss_samples_bytes":[108249088,139427840,140115968]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep3.jsonl new file mode 100644 index 0000000..3d4b15d --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":126.398,"rebuild_total_ms":3281.746,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":3232232542,"hnsw_rebuild_count":1,"hnsw_save_nanos":11193708,"hnsw_save_count":1,"bm25_rebuild_nanos":37819542,"bm25_rebuild_count":1,"rss_start_bytes":108314624,"rss_end_bytes":142147584,"rss_peak_bytes":142147584,"rss_delta_bytes":33832960,"rss_samples_bytes":[108314624,141459456,142147584]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep4.jsonl new file mode 100644 index 0000000..e5d9c5a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":128.099,"rebuild_total_ms":3296.93,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":3246890791,"hnsw_rebuild_count":1,"hnsw_save_nanos":11593291,"hnsw_save_count":1,"bm25_rebuild_nanos":37924417,"bm25_rebuild_count":1,"rss_start_bytes":108347392,"rss_end_bytes":136085504,"rss_peak_bytes":136085504,"rss_delta_bytes":27738112,"rss_samples_bytes":[108347392,135397376,136085504]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep5.jsonl new file mode 100644 index 0000000..bea3d4f --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_20000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":129.317,"rebuild_total_ms":2480.785,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2431602791,"hnsw_rebuild_count":1,"hnsw_save_nanos":11058125,"hnsw_save_count":1,"bm25_rebuild_nanos":37606917,"bm25_rebuild_count":1,"rss_start_bytes":108576768,"rss_end_bytes":135938048,"rss_peak_bytes":135938048,"rss_delta_bytes":27361280,"rss_samples_bytes":[108576768,135462912,135938048]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep1.jsonl new file mode 100644 index 0000000..d99cb59 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":312.703,"rebuild_total_ms":8358.164,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":8232236250,"hnsw_rebuild_count":1,"hnsw_save_nanos":31106542,"hnsw_save_count":1,"bm25_rebuild_nanos":94334916,"bm25_rebuild_count":1,"rss_start_bytes":177487872,"rss_end_bytes":236486656,"rss_peak_bytes":236486656,"rss_delta_bytes":58998784,"rss_samples_bytes":[177487872,235831296,236486656]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep2.jsonl new file mode 100644 index 0000000..b2cf829 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":303.601,"rebuild_total_ms":8430.91,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":8309319000,"hnsw_rebuild_count":1,"hnsw_save_nanos":26267209,"hnsw_save_count":1,"bm25_rebuild_nanos":94821333,"bm25_rebuild_count":1,"rss_start_bytes":169639936,"rss_end_bytes":228851712,"rss_peak_bytes":228851712,"rss_delta_bytes":59211776,"rss_samples_bytes":[169639936,228376576,228851712]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep3.jsonl new file mode 100644 index 0000000..747d888 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":305.745,"rebuild_total_ms":8393.048,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":8272800000,"hnsw_rebuild_count":1,"hnsw_save_nanos":26336542,"hnsw_save_count":1,"bm25_rebuild_nanos":93389375,"bm25_rebuild_count":1,"rss_start_bytes":170000384,"rss_end_bytes":218873856,"rss_peak_bytes":218873856,"rss_delta_bytes":48873472,"rss_samples_bytes":[170000384,218185728,218873856]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep4.jsonl new file mode 100644 index 0000000..f9f741b --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":300.027,"rebuild_total_ms":7843.157,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":7717144292,"hnsw_rebuild_count":1,"hnsw_save_nanos":25463209,"hnsw_save_count":1,"bm25_rebuild_nanos":99958166,"bm25_rebuild_count":1,"rss_start_bytes":169984000,"rss_end_bytes":228671488,"rss_peak_bytes":228671488,"rss_delta_bytes":58687488,"rss_samples_bytes":[169984000,228130816,228671488]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep5.jsonl new file mode 100644 index 0000000..e4a0fce --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/mimalloc/profile_mimalloc_50000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":302.468,"rebuild_total_ms":9182.938,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":9063403750,"hnsw_rebuild_count":1,"hnsw_save_nanos":25314083,"hnsw_save_count":1,"bm25_rebuild_nanos":93671583,"bm25_rebuild_count":1,"rss_start_bytes":169836544,"rss_end_bytes":228900864,"rss_peak_bytes":228900864,"rss_delta_bytes":59064320,"rss_samples_bytes":[169836544,228425728,228900864]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/summary_medians.json new file mode 100644 index 0000000..61c185a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/summary_medians.json @@ -0,0 +1,215 @@ +[ + { + "docs": 10000, + "system_total_ms": { + "n": 5, + "median": 1345.418, + "min": 1284.053, + "max": 1487.788, + "p20": 1325.9, + "p80": 1467.267 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 1158.844, + "min": 1065.636, + "max": 1220.476, + "p20": 1103.077, + "p80": 1163.35 + }, + "total_delta_pct": -13.867363154053228, + "system_hnsw_ms": { + "n": 5, + "median": 1317.363167, + "min": 1256.736125, + "max": 1458.743917, + "p20": 1297.912958, + "p80": 1427.208916 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 1134.032959, + "min": 1041.333625, + "max": 1190.087167, + "p20": 1078.925375, + "p80": 1139.264666 + }, + "hnsw_delta_pct": -13.916451635542055, + "system_peak_mb": { + "n": 5, + "median": 83.65625, + "min": 78.140625, + "max": 89.609375, + "p20": 83.1875, + "p80": 83.875 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 94.5, + "min": 94.0625, + "max": 101.28125, + "p20": 94.09375, + "p80": 94.59375 + }, + "peak_delta_pct": 12.962271199103473, + "system_rss_delta_mb": { + "n": 5, + "median": 14.984375, + "min": 9.78125, + "max": 15.59375, + "p20": 14, + "p80": 15.34375 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 14.890625, + "min": 14.578125, + "max": 15.265625, + "p20": 14.875, + "p80": 14.890625 + }, + "rss_delta_delta_pct": -0.6256517205422315 + }, + { + "docs": 20000, + "system_total_ms": { + "n": 5, + "median": 3816.418, + "min": 3443.194, + "max": 3918.69, + "p20": 3759.574, + "p80": 3858.13 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 3217.003, + "min": 2480.785, + "max": 3296.93, + "p20": 3124.766, + "p80": 3281.746 + }, + "total_delta_pct": -15.706219811351898, + "system_hnsw_ms": { + "n": 5, + "median": 3760.379875, + "min": 3386.702209, + "max": 3861.155709, + "p20": 3703.374084, + "p80": 3795.685458 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 3166.727833, + "min": 2431.602791, + "max": 3246.890791, + "p20": 3068.786791, + "p80": 3232.232542 + }, + "hnsw_delta_pct": -15.787023166110318, + "system_peak_mb": { + "n": 5, + "median": 113.546875, + "min": 112.1875, + "max": 120.59375, + "p20": 113.265625, + "p80": 113.671875 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 133.625, + "min": 129.640625, + "max": 136.71875, + "p20": 129.78125, + "p80": 135.5625 + }, + "peak_delta_pct": 17.682675106646485, + "system_rss_delta_mb": { + "n": 5, + "median": 31.109375, + "min": 29.96875, + "max": 31.328125, + "p20": 30.890625, + "p80": 31.328125 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 26.453125, + "min": 20.953125, + "max": 32.265625, + "p20": 26.09375, + "p80": 30.390625 + }, + "rss_delta_delta_pct": -14.967353088900051 + }, + { + "docs": 50000, + "system_total_ms": { + "n": 5, + "median": 10483.004, + "min": 10129.68, + "max": 12126.455, + "p20": 10319.228, + "p80": 10772.527 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 8393.048, + "min": 7843.157, + "max": 9182.938, + "p20": 8358.164, + "p80": 8430.91 + }, + "total_delta_pct": -19.936613589005596, + "system_hnsw_ms": { + "n": 5, + "median": 10341.2475, + "min": 9996.212417, + "max": 11991.28125, + "p20": 10178.759334, + "p80": 10628.487792 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 8272.8, + "min": 7717.144292, + "max": 9063.40375, + "p20": 8232.23625, + "p80": 8309.319 + }, + "hnsw_delta_pct": -20.00191466261687, + "system_peak_mb": { + "n": 5, + "median": 182.015625, + "min": 176.71875, + "max": 194.71875, + "p20": 180.8125, + "p80": 190.609375 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 218.25, + "min": 208.734375, + "max": 225.53125, + "p20": 218.078125, + "p80": 218.296875 + }, + "peak_delta_pct": 19.907288179242855, + "system_rss_delta_mb": { + "n": 5, + "median": 62.03125, + "min": 52.71875, + "max": 71.90625, + "p20": 55.78125, + "p80": 70.765625 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 56.265625, + "min": 46.609375, + "max": 56.46875, + "p20": 55.96875, + "p80": 56.328125 + }, + "rss_delta_delta_pct": -9.29471032745592 + } +] \ No newline at end of file diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep1.jsonl new file mode 100644 index 0000000..49e0123 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":56.401,"rebuild_total_ms":1467.267,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1427208916,"hnsw_rebuild_count":1,"hnsw_save_nanos":14776334,"hnsw_save_count":1,"bm25_rebuild_nanos":24825500,"bm25_rebuild_count":1,"rss_start_bytes":79282176,"rss_end_bytes":93962240,"rss_peak_bytes":93962240,"rss_delta_bytes":14680064,"rss_samples_bytes":[79282176,93356032,93962240]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep2.jsonl new file mode 100644 index 0000000..9fb3cdb --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":68.011,"rebuild_total_ms":1345.418,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1317363167,"hnsw_rebuild_count":1,"hnsw_save_nanos":5815291,"hnsw_save_count":1,"bm25_rebuild_nanos":21730875,"bm25_rebuild_count":1,"rss_start_bytes":71516160,"rss_end_bytes":87228416,"rss_peak_bytes":87228416,"rss_delta_bytes":15712256,"rss_samples_bytes":[71516160,86638592,87228416]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep3.jsonl new file mode 100644 index 0000000..02b95df --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":115.765,"rebuild_total_ms":1487.788,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1458743917,"hnsw_rebuild_count":1,"hnsw_save_nanos":6858792,"hnsw_save_count":1,"bm25_rebuild_nanos":21717209,"bm25_rebuild_count":1,"rss_start_bytes":71680000,"rss_end_bytes":81936384,"rss_peak_bytes":81936384,"rss_delta_bytes":10256384,"rss_samples_bytes":[71680000,81330176,81936384]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep4.jsonl new file mode 100644 index 0000000..2f00989 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":60.592,"rebuild_total_ms":1325.9,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1297912958,"hnsw_rebuild_count":1,"hnsw_save_nanos":5974333,"hnsw_save_count":1,"bm25_rebuild_nanos":21484334,"bm25_rebuild_count":1,"rss_start_bytes":71598080,"rss_end_bytes":87949312,"rss_peak_bytes":87949312,"rss_delta_bytes":16351232,"rss_samples_bytes":[71598080,87359488,87949312]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep5.jsonl new file mode 100644 index 0000000..0283687 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_10000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":60.341,"rebuild_total_ms":1284.053,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1256736125,"hnsw_rebuild_count":1,"hnsw_save_nanos":5688875,"hnsw_save_count":1,"bm25_rebuild_nanos":21189333,"bm25_rebuild_count":1,"rss_start_bytes":71630848,"rss_end_bytes":87719936,"rss_peak_bytes":87719936,"rss_delta_bytes":16089088,"rss_samples_bytes":[71630848,87130112,87719936]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep1.jsonl new file mode 100644 index 0000000..19f95ac --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":134.929,"rebuild_total_ms":3858.13,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3795685458,"hnsw_rebuild_count":1,"hnsw_save_nanos":16936958,"hnsw_save_count":1,"bm25_rebuild_nanos":44982542,"bm25_rebuild_count":1,"rss_start_bytes":94060544,"rss_end_bytes":126451712,"rss_peak_bytes":126451712,"rss_delta_bytes":32391168,"rss_samples_bytes":[94060544,125861888,126451712]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep2.jsonl new file mode 100644 index 0000000..458c0db --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":137.094,"rebuild_total_ms":3759.574,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3703374084,"hnsw_rebuild_count":1,"hnsw_save_nanos":12767917,"hnsw_save_count":1,"bm25_rebuild_nanos":42806375,"bm25_rebuild_count":1,"rss_start_bytes":86212608,"rss_end_bytes":117637120,"rss_peak_bytes":117637120,"rss_delta_bytes":31424512,"rss_samples_bytes":[86212608,117047296,117637120]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep3.jsonl new file mode 100644 index 0000000..1f747e6 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":129.823,"rebuild_total_ms":3443.194,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3386702209,"hnsw_rebuild_count":1,"hnsw_save_nanos":12712625,"hnsw_save_count":1,"bm25_rebuild_nanos":43161584,"bm25_rebuild_count":1,"rss_start_bytes":86147072,"rss_end_bytes":118767616,"rss_peak_bytes":118767616,"rss_delta_bytes":32620544,"rss_samples_bytes":[86147072,118177792,118767616]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep4.jsonl new file mode 100644 index 0000000..d45ceaa --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":131.052,"rebuild_total_ms":3918.69,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3861155709,"hnsw_rebuild_count":1,"hnsw_save_nanos":13759958,"hnsw_save_count":1,"bm25_rebuild_nanos":43306000,"bm25_rebuild_count":1,"rss_start_bytes":86212608,"rss_end_bytes":119062528,"rss_peak_bytes":119062528,"rss_delta_bytes":32849920,"rss_samples_bytes":[86212608,118456320,119062528]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep5.jsonl new file mode 100644 index 0000000..da16ef4 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_20000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":130.138,"rebuild_total_ms":3816.418,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3760379875,"hnsw_rebuild_count":1,"hnsw_save_nanos":12510333,"hnsw_save_count":1,"bm25_rebuild_nanos":43015666,"bm25_rebuild_count":1,"rss_start_bytes":86343680,"rss_end_bytes":119193600,"rss_peak_bytes":119193600,"rss_delta_bytes":32849920,"rss_samples_bytes":[86343680,118603776,119193600]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep1.jsonl new file mode 100644 index 0000000..59f65be --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":316.266,"rebuild_total_ms":10319.228,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":10178759334,"hnsw_rebuild_count":1,"hnsw_save_nanos":33235084,"hnsw_save_count":1,"bm25_rebuild_nanos":106600417,"bm25_rebuild_count":1,"rss_start_bytes":132366336,"rss_end_bytes":190857216,"rss_peak_bytes":190857216,"rss_delta_bytes":58490880,"rss_samples_bytes":[132366336,190267392,190857216]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep2.jsonl new file mode 100644 index 0000000..fb137ff --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":316.384,"rebuild_total_ms":10483.004,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":10341247500,"hnsw_rebuild_count":1,"hnsw_save_nanos":29033625,"hnsw_save_count":1,"bm25_rebuild_nanos":112197250,"bm25_rebuild_count":1,"rss_start_bytes":129974272,"rss_end_bytes":204177408,"rss_peak_bytes":204177408,"rss_delta_bytes":74203136,"rss_samples_bytes":[129974272,203587584,204177408]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep3.jsonl new file mode 100644 index 0000000..b6b4abd --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":328.479,"rebuild_total_ms":12126.455,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":11991281250,"hnsw_rebuild_count":1,"hnsw_save_nanos":27452416,"hnsw_save_count":1,"bm25_rebuild_nanos":107091125,"bm25_rebuild_count":1,"rss_start_bytes":124469248,"rss_end_bytes":199868416,"rss_peak_bytes":199868416,"rss_delta_bytes":75399168,"rss_samples_bytes":[124469248,199262208,199868416]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep4.jsonl new file mode 100644 index 0000000..9fdc0a4 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":317.708,"rebuild_total_ms":10129.68,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":9996212417,"hnsw_rebuild_count":1,"hnsw_save_nanos":28502750,"hnsw_save_count":1,"bm25_rebuild_nanos":104374000,"bm25_rebuild_count":1,"rss_start_bytes":124551168,"rss_end_bytes":189595648,"rss_peak_bytes":189595648,"rss_delta_bytes":65044480,"rss_samples_bytes":[124551168,188973056,189595648]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep5.jsonl new file mode 100644 index 0000000..bdcf250 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-repeat-20260629-034322/system/profile_system_50000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":315.544,"rebuild_total_ms":10772.527,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":10628487792,"hnsw_rebuild_count":1,"hnsw_save_nanos":28747000,"hnsw_save_count":1,"bm25_rebuild_nanos":114706167,"bm25_rebuild_count":1,"rss_start_bytes":130023424,"rss_end_bytes":185303040,"rss_peak_bytes":185303040,"rss_delta_bytes":55279616,"rss_samples_bytes":[130023424,184713216,185303040]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_latest_system_500.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_latest_system_500.jsonl new file mode 100644 index 0000000..d3b74cd --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_latest_system_500.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":500,"embedding_dim":32,"seed_ms":5.663,"rebuild_total_ms":37.733,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":30890792,"hnsw_rebuild_count":1,"hnsw_save_nanos":4644083,"hnsw_save_count":1,"bm25_rebuild_nanos":1846250,"bm25_rebuild_count":1,"rss_start_bytes":80396288,"rss_end_bytes":84475904,"rss_peak_bytes":84475904,"rss_delta_bytes":4079616,"rss_samples_bytes":[80396288,83869696,84475904]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_10000_20000_50000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_10000_20000_50000.jsonl new file mode 100644 index 0000000..2a0232c --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_10000_20000_50000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":70.792,"rebuild_total_ms":1223.827,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1189743417,"hnsw_rebuild_count":1,"hnsw_save_nanos":10405459,"hnsw_save_count":1,"bm25_rebuild_nanos":23114000,"bm25_rebuild_count":1,"rss_start_bytes":97566720,"rss_end_bytes":106348544,"rss_peak_bytes":106348544,"rss_delta_bytes":8781824,"rss_samples_bytes":[97566720,105725952,106348544]} +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":119.139,"rebuild_total_ms":3354.513,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3300621875,"hnsw_rebuild_count":1,"hnsw_save_nanos":10888833,"hnsw_save_count":1,"bm25_rebuild_nanos":42531250,"bm25_rebuild_count":1,"rss_start_bytes":146423808,"rss_end_bytes":167952384,"rss_peak_bytes":167952384,"rss_delta_bytes":21528576,"rss_samples_bytes":[146423808,167936000,167952384]} +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":305.772,"rebuild_total_ms":8536.089,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":8401384208,"hnsw_rebuild_count":1,"hnsw_save_nanos":29747208,"hnsw_save_count":1,"bm25_rebuild_nanos":104407500,"bm25_rebuild_count":1,"rss_start_bytes":206209024,"rss_end_bytes":252788736,"rss_peak_bytes":252788736,"rss_delta_bytes":46579712,"rss_samples_bytes":[206209024,252788736,252788736]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_500_2000_5000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_500_2000_5000.jsonl new file mode 100644 index 0000000..fb4ea10 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-system/allocator_indexing_profile_system_500_2000_5000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":500,"embedding_dim":32,"seed_ms":4.475,"rebuild_total_ms":24.727,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":21327917,"hnsw_rebuild_count":1,"hnsw_save_nanos":1100834,"hnsw_save_count":1,"bm25_rebuild_nanos":1949542,"bm25_rebuild_count":1,"rss_start_bytes":76316672,"rss_end_bytes":77692928,"rss_peak_bytes":77692928,"rss_delta_bytes":1376256,"rss_samples_bytes":[76316672,77086720,77692928]} +{"cell":"indexing_rebuild","docs":2000,"embedding_dim":32,"seed_ms":12.118,"rebuild_total_ms":206.732,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":200400417,"hnsw_rebuild_count":1,"hnsw_save_nanos":1336708,"hnsw_save_count":1,"bm25_rebuild_nanos":4581334,"bm25_rebuild_count":1,"rss_start_bytes":82853888,"rss_end_bytes":84983808,"rss_peak_bytes":84983808,"rss_delta_bytes":2129920,"rss_samples_bytes":[82853888,84983808,84983808]} +{"cell":"indexing_rebuild","docs":5000,"embedding_dim":32,"seed_ms":27.134,"rebuild_total_ms":587.872,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":572716000,"hnsw_rebuild_count":1,"hnsw_save_nanos":4093917,"hnsw_save_count":1,"bm25_rebuild_nanos":10621333,"bm25_rebuild_count":1,"rss_start_bytes":93044736,"rss_end_bytes":96534528,"rss_peak_bytes":96534528,"rss_delta_bytes":3489792,"rss_samples_bytes":[93044736,96518144,96534528]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl new file mode 100644 index 0000000..65e21ed --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-mimalloc/allocator_indexing_profile_mimalloc_10000_20000_50000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":41.531,"rebuild_total_ms":1078.949,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":1059091583,"hnsw_rebuild_count":1,"hnsw_save_nanos":4468583,"hnsw_save_count":1,"bm25_rebuild_nanos":14816417,"bm25_rebuild_count":1,"rss_start_bytes":141541376,"rss_end_bytes":152174592,"rss_peak_bytes":152174592,"rss_delta_bytes":10633216,"rss_samples_bytes":[141541376,151306240,152174592]} +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":88.508,"rebuild_total_ms":2719.797,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2683075542,"hnsw_rebuild_count":1,"hnsw_save_nanos":7923250,"hnsw_save_count":1,"bm25_rebuild_nanos":28374291,"bm25_rebuild_count":1,"rss_start_bytes":209190912,"rss_end_bytes":234586112,"rss_peak_bytes":234586112,"rss_delta_bytes":25395200,"rss_samples_bytes":[209190912,234586112,234586112]} +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":209.574,"rebuild_total_ms":7078.981,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":6987995708,"hnsw_rebuild_count":1,"hnsw_save_nanos":19663917,"hnsw_save_count":1,"bm25_rebuild_nanos":70806333,"bm25_rebuild_count":1,"rss_start_bytes":309510144,"rss_end_bytes":360660992,"rss_peak_bytes":360660992,"rss_delta_bytes":51150848,"rss_samples_bytes":[309510144,360644608,360660992]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep1.jsonl new file mode 100644 index 0000000..25da60b --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":41.589,"rebuild_total_ms":873.461,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":854916125,"hnsw_rebuild_count":1,"hnsw_save_nanos":4028000,"hnsw_save_count":1,"bm25_rebuild_nanos":14029584,"bm25_rebuild_count":1,"rss_start_bytes":143736832,"rss_end_bytes":154091520,"rss_peak_bytes":154091520,"rss_delta_bytes":10354688,"rss_samples_bytes":[143736832,153223168,154091520]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep2.jsonl new file mode 100644 index 0000000..fecf9ed --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":41.201,"rebuild_total_ms":862.768,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":842510458,"hnsw_rebuild_count":1,"hnsw_save_nanos":5119917,"hnsw_save_count":1,"bm25_rebuild_nanos":14650583,"bm25_rebuild_count":1,"rss_start_bytes":143392768,"rss_end_bytes":153731072,"rss_peak_bytes":153731072,"rss_delta_bytes":10338304,"rss_samples_bytes":[143392768,152862720,153731072]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep3.jsonl new file mode 100644 index 0000000..cb73b9d --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":41.167,"rebuild_total_ms":881.308,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":862526666,"hnsw_rebuild_count":1,"hnsw_save_nanos":4240667,"hnsw_save_count":1,"bm25_rebuild_nanos":14121875,"bm25_rebuild_count":1,"rss_start_bytes":143130624,"rss_end_bytes":153370624,"rss_peak_bytes":153370624,"rss_delta_bytes":10240000,"rss_samples_bytes":[143130624,152502272,153370624]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep4.jsonl new file mode 100644 index 0000000..d19134f --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":40.85,"rebuild_total_ms":931.476,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":912710250,"hnsw_rebuild_count":1,"hnsw_save_nanos":4330917,"hnsw_save_count":1,"bm25_rebuild_nanos":13981750,"bm25_rebuild_count":1,"rss_start_bytes":142966784,"rss_end_bytes":153534464,"rss_peak_bytes":153534464,"rss_delta_bytes":10567680,"rss_samples_bytes":[142966784,152666112,153534464]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep5.jsonl new file mode 100644 index 0000000..9b86fd8 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_10000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":40.079,"rebuild_total_ms":913.153,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":894633250,"hnsw_rebuild_count":1,"hnsw_save_nanos":4305334,"hnsw_save_count":1,"bm25_rebuild_nanos":13813334,"bm25_rebuild_count":1,"rss_start_bytes":143294464,"rss_end_bytes":153862144,"rss_peak_bytes":153862144,"rss_delta_bytes":10567680,"rss_samples_bytes":[143294464,153010176,153862144]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep1.jsonl new file mode 100644 index 0000000..a32491b --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":91.724,"rebuild_total_ms":2305.583,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2270365708,"hnsw_rebuild_count":1,"hnsw_save_nanos":7083459,"hnsw_save_count":1,"bm25_rebuild_nanos":27679167,"bm25_rebuild_count":1,"rss_start_bytes":168361984,"rss_end_bytes":190054400,"rss_peak_bytes":190054400,"rss_delta_bytes":21692416,"rss_samples_bytes":[168361984,189169664,190054400]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep2.jsonl new file mode 100644 index 0000000..f11fe30 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":96.14,"rebuild_total_ms":2934.828,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2898083458,"hnsw_rebuild_count":1,"hnsw_save_nanos":7727833,"hnsw_save_count":1,"bm25_rebuild_nanos":28555291,"bm25_rebuild_count":1,"rss_start_bytes":168689664,"rss_end_bytes":196460544,"rss_peak_bytes":196460544,"rss_delta_bytes":27770880,"rss_samples_bytes":[168689664,195575808,196460544]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep3.jsonl new file mode 100644 index 0000000..12deba8 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":136.423,"rebuild_total_ms":2843.985,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2805279250,"hnsw_rebuild_count":1,"hnsw_save_nanos":7543917,"hnsw_save_count":1,"bm25_rebuild_nanos":30657041,"bm25_rebuild_count":1,"rss_start_bytes":168361984,"rss_end_bytes":190021632,"rss_peak_bytes":190021632,"rss_delta_bytes":21659648,"rss_samples_bytes":[168361984,189136896,190021632]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep4.jsonl new file mode 100644 index 0000000..9218193 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":91.914,"rebuild_total_ms":2574.398,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2538074500,"hnsw_rebuild_count":1,"hnsw_save_nanos":7459666,"hnsw_save_count":1,"bm25_rebuild_nanos":28361333,"bm25_rebuild_count":1,"rss_start_bytes":168132608,"rss_end_bytes":190578688,"rss_peak_bytes":190578688,"rss_delta_bytes":22446080,"rss_samples_bytes":[168132608,189693952,190578688]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep5.jsonl new file mode 100644 index 0000000..2531a77 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_20000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":95.48,"rebuild_total_ms":2796.225,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":2759067333,"hnsw_rebuild_count":1,"hnsw_save_nanos":7669166,"hnsw_save_count":1,"bm25_rebuild_nanos":28986000,"bm25_rebuild_count":1,"rss_start_bytes":168099840,"rss_end_bytes":190251008,"rss_peak_bytes":190251008,"rss_delta_bytes":22151168,"rss_samples_bytes":[168099840,189628416,190251008]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep1.jsonl new file mode 100644 index 0000000..8fd4561 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":210.722,"rebuild_total_ms":5283.897,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":5194839959,"hnsw_rebuild_count":1,"hnsw_save_nanos":19516708,"hnsw_save_count":1,"bm25_rebuild_nanos":69007500,"bm25_rebuild_count":1,"rss_start_bytes":223674368,"rss_end_bytes":281493504,"rss_peak_bytes":281493504,"rss_delta_bytes":57819136,"rss_samples_bytes":[223674368,280969216,281493504]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep2.jsonl new file mode 100644 index 0000000..fa8c74f --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":222.155,"rebuild_total_ms":6212.352,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":6124200709,"hnsw_rebuild_count":1,"hnsw_save_nanos":18379708,"hnsw_save_count":1,"bm25_rebuild_nanos":69254709,"bm25_rebuild_count":1,"rss_start_bytes":224231424,"rss_end_bytes":282443776,"rss_peak_bytes":282443776,"rss_delta_bytes":58212352,"rss_samples_bytes":[224231424,281919488,282443776]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep3.jsonl new file mode 100644 index 0000000..1b03d6b --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":219.255,"rebuild_total_ms":7169.964,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":7082010000,"hnsw_rebuild_count":1,"hnsw_save_nanos":18675042,"hnsw_save_count":1,"bm25_rebuild_nanos":68807667,"bm25_rebuild_count":1,"rss_start_bytes":224034816,"rss_end_bytes":274300928,"rss_peak_bytes":274300928,"rss_delta_bytes":50266112,"rss_samples_bytes":[224034816,273776640,274300928]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep4.jsonl new file mode 100644 index 0000000..231c905 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":219.242,"rebuild_total_ms":6565.609,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":6478369959,"hnsw_rebuild_count":1,"hnsw_save_nanos":18213541,"hnsw_save_count":1,"bm25_rebuild_nanos":68532167,"bm25_rebuild_count":1,"rss_start_bytes":223641600,"rss_end_bytes":282132480,"rss_peak_bytes":282132480,"rss_delta_bytes":58490880,"rss_samples_bytes":[223641600,281608192,282132480]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep5.jsonl new file mode 100644 index 0000000..2b43c3a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/mimalloc/profile_mimalloc_50000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":218.066,"rebuild_total_ms":7117.076,"native_allocator":"mimalloc","rust_features":"vector_faer,vector_quant_i8,allocator_mimalloc","build_mode":"profile","hnsw_rebuild_nanos":7030895625,"hnsw_rebuild_count":1,"hnsw_save_nanos":17015916,"hnsw_save_count":1,"bm25_rebuild_nanos":68657500,"bm25_rebuild_count":1,"rss_start_bytes":224378880,"rss_end_bytes":280969216,"rss_peak_bytes":280969216,"rss_delta_bytes":56590336,"rss_samples_bytes":[224378880,280150016,280969216]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/summary_medians.json new file mode 100644 index 0000000..4e32563 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/summary_medians.json @@ -0,0 +1,215 @@ +[ + { + "docs": 10000, + "system_total_ms": { + "n": 5, + "median": 1006.692, + "min": 929.203, + "max": 1088.823, + "p20": 951.992, + "p80": 1035.829 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 881.308, + "min": 862.768, + "max": 931.476, + "p20": 873.461, + "p80": 913.153 + }, + "total_delta_pct": -12.455050800046093, + "system_hnsw_ms": { + "n": 5, + "median": 984.558166, + "min": 906.969292, + "max": 1066.449167, + "p20": 930.173375, + "p80": 1014.636042 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 862.526666, + "min": 842.510458, + "max": 912.71025, + "p20": 854.916125, + "p80": 894.63325 + }, + "hnsw_delta_pct": -12.39454449865383, + "system_peak_mb": { + "n": 5, + "median": 139.109375, + "min": 139.046875, + "max": 139.78125, + "p20": 139.078125, + "p80": 139.6875 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 146.609375, + "min": 146.265625, + "max": 146.953125, + "p20": 146.421875, + "p80": 146.734375 + }, + "peak_delta_pct": 5.391441087273953, + "system_rss_delta_mb": { + "n": 5, + "median": 10.25, + "min": 10.09375, + "max": 11.140625, + "p20": 10.21875, + "p80": 10.6875 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 9.875, + "min": 9.765625, + "max": 10.078125, + "p20": 9.859375, + "p80": 10.078125 + }, + "rss_delta_delta_pct": -3.6585365853658534 + }, + { + "docs": 20000, + "system_total_ms": { + "n": 5, + "median": 2997.313, + "min": 2854.419, + "max": 3088.956, + "p20": 2881.45, + "p80": 3085.697 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 2796.225, + "min": 2305.583, + "max": 2934.828, + "p20": 2574.398, + "p80": 2843.985 + }, + "total_delta_pct": -6.708942309328394, + "system_hnsw_ms": { + "n": 5, + "median": 2953.511167, + "min": 2809.946709, + "max": 3044.21275, + "p20": 2838.9085, + "p80": 3042.983166 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 2759.067333, + "min": 2270.365708, + "max": 2898.083458, + "p20": 2538.0745, + "p80": 2805.27925 + }, + "hnsw_delta_pct": -6.583480576357684, + "system_peak_mb": { + "n": 5, + "median": 175.25, + "min": 174.5625, + "max": 176.203125, + "p20": 174.890625, + "p80": 175.8125 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 181.4375, + "min": 181.21875, + "max": 187.359375, + "p20": 181.25, + "p80": 181.75 + }, + "peak_delta_pct": 3.5306704707560628, + "system_rss_delta_mb": { + "n": 5, + "median": 27.46875, + "min": 27.015625, + "max": 28.21875, + "p20": 27.109375, + "p80": 28.046875 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 21.125, + "min": 20.65625, + "max": 26.484375, + "p20": 20.6875, + "p80": 21.40625 + }, + "rss_delta_delta_pct": -23.094425483503983 + }, + { + "docs": 50000, + "system_total_ms": { + "n": 5, + "median": 7975.187, + "min": 7229.517, + "max": 8165.512, + "p20": 7641.739, + "p80": 8114.261 + }, + "mimalloc_total_ms": { + "n": 5, + "median": 6565.609, + "min": 5283.897, + "max": 7169.964, + "p20": 6212.352, + "p80": 7117.076 + }, + "total_delta_pct": -17.674544810046456, + "system_hnsw_ms": { + "n": 5, + "median": 7866.198375, + "min": 7126.515083, + "max": 8050.221292, + "p20": 7537.801417, + "p80": 8007.3725 + }, + "mimalloc_hnsw_ms": { + "n": 5, + "median": 6478.369959, + "min": 5194.839959, + "max": 7082.01, + "p20": 6124.200709, + "p80": 7030.895625 + }, + "hnsw_delta_pct": -17.64293690343145, + "system_peak_mb": { + "n": 5, + "median": 253.640625, + "min": 250.0625, + "max": 257.40625, + "p20": 251.828125, + "p80": 254.4375 + }, + "mimalloc_peak_mb": { + "n": 5, + "median": 268.453125, + "min": 261.59375, + "max": 269.359375, + "p20": 267.953125, + "p80": 269.0625 + }, + "peak_delta_pct": 5.839955645906487, + "system_rss_delta_mb": { + "n": 5, + "median": 59.15625, + "min": 54.5, + "max": 62.65625, + "p20": 57.34375, + "p80": 59.859375 + }, + "mimalloc_rss_delta_mb": { + "n": 5, + "median": 55.140625, + "min": 47.9375, + "max": 55.78125, + "p20": 53.96875, + "p80": 55.515625 + }, + "rss_delta_delta_pct": -6.788166930797676 + } +] \ No newline at end of file diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep1.jsonl new file mode 100644 index 0000000..cea3007 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":42.68,"rebuild_total_ms":1035.829,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1014636042,"hnsw_rebuild_count":1,"hnsw_save_nanos":4246542,"hnsw_save_count":1,"bm25_rebuild_nanos":16537375,"bm25_rebuild_count":1,"rss_start_bytes":135266304,"rss_end_bytes":146472960,"rss_peak_bytes":146472960,"rss_delta_bytes":11206656,"rss_samples_bytes":[135266304,145997824,146472960]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep2.jsonl new file mode 100644 index 0000000..859b403 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":42.979,"rebuild_total_ms":951.992,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":930173375,"hnsw_rebuild_count":1,"hnsw_save_nanos":4629375,"hnsw_save_count":1,"bm25_rebuild_nanos":16771042,"bm25_rebuild_count":1,"rss_start_bytes":135118848,"rss_end_bytes":145833984,"rss_peak_bytes":145833984,"rss_delta_bytes":10715136,"rss_samples_bytes":[135118848,145375232,145833984]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep3.jsonl new file mode 100644 index 0000000..0437b36 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":43.435,"rebuild_total_ms":1006.692,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":984558166,"hnsw_rebuild_count":1,"hnsw_save_nanos":4370375,"hnsw_save_count":1,"bm25_rebuild_nanos":17277291,"bm25_rebuild_count":1,"rss_start_bytes":135053312,"rss_end_bytes":145801216,"rss_peak_bytes":145801216,"rss_delta_bytes":10747904,"rss_samples_bytes":[135053312,145342464,145801216]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep4.jsonl new file mode 100644 index 0000000..10f063c --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":44.769,"rebuild_total_ms":1088.823,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1066449167,"hnsw_rebuild_count":1,"hnsw_save_nanos":4570958,"hnsw_save_count":1,"bm25_rebuild_nanos":17351041,"bm25_rebuild_count":1,"rss_start_bytes":135282688,"rss_end_bytes":145866752,"rss_peak_bytes":145866752,"rss_delta_bytes":10584064,"rss_samples_bytes":[135282688,145375232,145866752]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep5.jsonl new file mode 100644 index 0000000..723d604 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_10000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":43.001,"rebuild_total_ms":929.203,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":906969292,"hnsw_rebuild_count":1,"hnsw_save_nanos":4757917,"hnsw_save_count":1,"bm25_rebuild_nanos":17052875,"bm25_rebuild_count":1,"rss_start_bytes":134889472,"rss_end_bytes":146571264,"rss_peak_bytes":146571264,"rss_delta_bytes":11681792,"rss_samples_bytes":[134889472,146096128,146571264]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep1.jsonl new file mode 100644 index 0000000..48ae66e --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":92.782,"rebuild_total_ms":3085.697,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3042983166,"hnsw_rebuild_count":1,"hnsw_save_nanos":8423292,"hnsw_save_count":1,"bm25_rebuild_nanos":33918834,"bm25_rebuild_count":1,"rss_start_bytes":155353088,"rss_end_bytes":184762368,"rss_peak_bytes":184762368,"rss_delta_bytes":29409280,"rss_samples_bytes":[155353088,184287232,184762368]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep2.jsonl new file mode 100644 index 0000000..057652e --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":95.432,"rebuild_total_ms":3088.956,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3044212750,"hnsw_rebuild_count":1,"hnsw_save_nanos":8280208,"hnsw_save_count":1,"bm25_rebuild_nanos":35929000,"bm25_rebuild_count":1,"rss_start_bytes":154959872,"rss_end_bytes":183762944,"rss_peak_bytes":183762944,"rss_delta_bytes":28803072,"rss_samples_bytes":[154959872,183255040,183762944]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep3.jsonl new file mode 100644 index 0000000..5e8dc1a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":114.294,"rebuild_total_ms":2881.45,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":2838908500,"hnsw_rebuild_count":1,"hnsw_save_nanos":7680542,"hnsw_save_count":1,"bm25_rebuild_nanos":34389834,"bm25_rebuild_count":1,"rss_start_bytes":154615808,"rss_end_bytes":183042048,"rss_peak_bytes":183042048,"rss_delta_bytes":28426240,"rss_samples_bytes":[154615808,182534144,183042048]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep4.jsonl new file mode 100644 index 0000000..401eca0 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":95.611,"rebuild_total_ms":2854.419,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":2809946709,"hnsw_rebuild_count":1,"hnsw_save_nanos":8023292,"hnsw_save_count":1,"bm25_rebuild_nanos":35974416,"bm25_rebuild_count":1,"rss_start_bytes":155058176,"rss_end_bytes":183386112,"rss_peak_bytes":183386112,"rss_delta_bytes":28327936,"rss_samples_bytes":[155058176,182910976,183386112]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep5.jsonl new file mode 100644 index 0000000..c5fc469 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_20000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":96.892,"rebuild_total_ms":2997.313,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":2953511167,"hnsw_rebuild_count":1,"hnsw_save_nanos":8477875,"hnsw_save_count":1,"bm25_rebuild_nanos":34828000,"bm25_rebuild_count":1,"rss_start_bytes":154763264,"rss_end_bytes":184352768,"rss_peak_bytes":184352768,"rss_delta_bytes":29589504,"rss_samples_bytes":[154763264,183877632,184352768]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep1.jsonl new file mode 100644 index 0000000..0667876 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep1.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":230.729,"rebuild_total_ms":7229.517,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":7126515083,"hnsw_rebuild_count":1,"hnsw_save_nanos":18119250,"hnsw_save_count":1,"bm25_rebuild_nanos":84416167,"bm25_rebuild_count":1,"rss_start_bytes":203931648,"rss_end_bytes":264060928,"rss_peak_bytes":264060928,"rss_delta_bytes":60129280,"rss_samples_bytes":[203931648,263569408,264060928]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep2.jsonl new file mode 100644 index 0000000..48d47bd --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep2.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":226.754,"rebuild_total_ms":8165.512,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":8050221292,"hnsw_rebuild_count":1,"hnsw_save_nanos":20808542,"hnsw_save_count":1,"bm25_rebuild_nanos":94018000,"bm25_rebuild_count":1,"rss_start_bytes":204210176,"rss_end_bytes":269910016,"rss_peak_bytes":269910016,"rss_delta_bytes":65699840,"rss_samples_bytes":[204210176,269434880,269910016]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep3.jsonl new file mode 100644 index 0000000..ee904b6 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep3.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":231.655,"rebuild_total_ms":7975.187,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":7866198375,"hnsw_rebuild_count":1,"hnsw_save_nanos":20710625,"hnsw_save_count":1,"bm25_rebuild_nanos":87831500,"bm25_rebuild_count":1,"rss_start_bytes":204029952,"rss_end_bytes":266797056,"rss_peak_bytes":266797056,"rss_delta_bytes":62767104,"rss_samples_bytes":[204029952,266321920,266797056]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep4.jsonl new file mode 100644 index 0000000..a719ef3 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep4.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":228.258,"rebuild_total_ms":7641.739,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":7537801417,"hnsw_rebuild_count":1,"hnsw_save_nanos":19820000,"hnsw_save_count":1,"bm25_rebuild_nanos":83643250,"bm25_rebuild_count":1,"rss_start_bytes":203931648,"rss_end_bytes":265961472,"rss_peak_bytes":265961472,"rss_delta_bytes":62029824,"rss_samples_bytes":[203931648,265502720,265961472]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep5.jsonl new file mode 100644 index 0000000..0d7e888 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-repeat-20260629-032925/system/profile_system_50000_rep5.jsonl @@ -0,0 +1 @@ +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":233.755,"rebuild_total_ms":8114.261,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":8007372500,"hnsw_rebuild_count":1,"hnsw_save_nanos":19511833,"hnsw_save_count":1,"bm25_rebuild_nanos":86898334,"bm25_rebuild_count":1,"rss_start_bytes":205062144,"rss_end_bytes":262209536,"rss_peak_bytes":262209536,"rss_delta_bytes":57147392,"rss_samples_bytes":[205062144,261734400,262209536]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-system/allocator_indexing_profile_system_10000_20000_50000.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-system/allocator_indexing_profile_system_10000_20000_50000.jsonl new file mode 100644 index 0000000..6181c11 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-system/allocator_indexing_profile_system_10000_20000_50000.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","docs":10000,"embedding_dim":32,"seed_ms":43.179,"rebuild_total_ms":1038.664,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":1014581292,"hnsw_rebuild_count":1,"hnsw_save_nanos":5412250,"hnsw_save_count":1,"bm25_rebuild_nanos":18173875,"bm25_rebuild_count":1,"rss_start_bytes":133316608,"rss_end_bytes":142655488,"rss_peak_bytes":142655488,"rss_delta_bytes":9338880,"rss_samples_bytes":[133316608,142163968,142655488]} +{"cell":"indexing_rebuild","docs":20000,"embedding_dim":32,"seed_ms":92.125,"rebuild_total_ms":3063.994,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3021818375,"hnsw_rebuild_count":1,"hnsw_save_nanos":8095583,"hnsw_save_count":1,"bm25_rebuild_nanos":33638917,"bm25_rebuild_count":1,"rss_start_bytes":191299584,"rss_end_bytes":216432640,"rss_peak_bytes":216432640,"rss_delta_bytes":25133056,"rss_samples_bytes":[191299584,216432640,216432640]} +{"cell":"indexing_rebuild","docs":50000,"embedding_dim":32,"seed_ms":217.17,"rebuild_total_ms":6790.853,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":6685703292,"hnsw_rebuild_count":1,"hnsw_save_nanos":21159334,"hnsw_save_count":1,"bm25_rebuild_nanos":83515041,"bm25_rebuild_count":1,"rss_start_bytes":253755392,"rss_end_bytes":306266112,"rss_peak_bytes":306266112,"rss_delta_bytes":52510720,"rss_samples_bytes":[253755392,306249728,306266112]} From 199038799f4f4078dc2d74ff17c5d1484e43af75 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Mon, 29 Jun 2026 12:27:39 +0900 Subject: [PATCH 4/8] perf(native): stream hnsw rebuild rows --- rust_builder/rust/src/api/hnsw_index.rs | 109 ++++++++++++++++++------ rust_builder/rust/src/api/source_rag.rs | 47 +++++++--- 2 files changed, 118 insertions(+), 38 deletions(-) diff --git a/rust_builder/rust/src/api/hnsw_index.rs b/rust_builder/rust/src/api/hnsw_index.rs index afb2979..92cd49b 100644 --- a/rust_builder/rust/src/api/hnsw_index.rs +++ b/rust_builder/rust/src/api/hnsw_index.rs @@ -47,46 +47,52 @@ impl EmbeddingPoint { static HNSW_INDEX: Lazy>>> = Lazy::new(|| RwLock::new(None)); -/// Build HNSW index from embedding points. -/// -/// Parameters are tuned for optimal recall vs speed tradeoff: -/// - M (max connections per node): 16-24 based on dataset size -/// - M0 (layer 0 connections): 2*M for better recall -/// - efConstruction: 100-200 based on dataset size -pub fn build_hnsw_index(points: Vec<(i64, Vec)>) -> anyhow::Result<()> { - info!("[hnsw] Building index with {} points", points.len()); - - if points.is_empty() { - warn!("[hnsw] No points provided"); - return Ok(()); +fn hnsw_build_params(count: usize) -> (usize, usize, usize, &'static str) { + if count > 10_000 { + (24, 48, 200, "large (>10K)") + } else if count > 1_000 { + (20, 40, 150, "medium (1K-10K)") + } else { + (16, 32, 100, "small (<1K)") } +} + +/// Build HNSW index from an iterator of embedding points. +pub(crate) fn build_hnsw_index_streaming( + point_count_hint: usize, + points: I, +) -> anyhow::Result +where + I: IntoIterator)>, +{ + info!( + "[hnsw] Building index with {} point capacity hint", + point_count_hint + ); - let count = points.len(); + let capacity = point_count_hint.max(1); // Adaptive parameters based on dataset size // - Small datasets (<1000): faster build, adequate recall // - Large datasets (>10000): higher quality, better recall - let (m, m0, ef_construction, _size_category) = if count > 10_000 { - (24, 48, 200, "large (>10K)") - } else if count > 1_000 { - (20, 40, 150, "medium (1K-10K)") - } else { - (16, 32, 100, "small (<1K)") - }; + let (m, m0, ef_construction, _size_category) = hnsw_build_params(capacity); // Debug output for Flutter console (only in debug builds) #[cfg(debug_assertions)] { - println!("[HNSW] Dataset size: {} points ({})", count, _size_category); + println!( + "[HNSW] Dataset size hint: {} points ({})", + point_count_hint, _size_category + ); println!( "[HNSW] Parameters: M={}, M0={}, efConstruction={}", m, m0, ef_construction ); println!( "[HNSW] Expected recall: ~{}%", - if count > 10_000 { + if capacity > 10_000 { "97" - } else if count > 1_000 { + } else if capacity > 1_000 { "95" } else { "92" @@ -99,22 +105,44 @@ pub fn build_hnsw_index(points: Vec<(i64, Vec)>) -> anyhow::Result<()> { m, m0, ef_construction ); - let hnsw = Hnsw::new(m, count, m0, ef_construction, DistCosine); + let hnsw = Hnsw::new(m, capacity, m0, ef_construction, DistCosine); + let mut inserted = 0usize; for (id, embedding) in points { + if embedding.is_empty() { + continue; + } hnsw.insert((&embedding, id as usize)); + inserted += 1; + } + + if inserted == 0 { + warn!("[hnsw] No points provided"); + return Ok(0); } let mut index_guard = HNSW_INDEX.write().unwrap(); *index_guard = Some(hnsw); #[cfg(debug_assertions)] - println!("[HNSW] ✅ Index build complete"); + println!("[HNSW] Index build complete"); info!( - "[hnsw] Index build complete (M={}, M0={}, efC={})", - m, m0, ef_construction + "[hnsw] Index build complete (inserted={}, M={}, M0={}, efC={})", + inserted, m, m0, ef_construction ); + Ok(inserted) +} + +/// Build HNSW index from embedding points. +/// +/// Parameters are tuned for optimal recall vs speed tradeoff: +/// - M (max connections per node): 16-24 based on dataset size +/// - M0 (layer 0 connections): 2*M for better recall +/// - efConstruction: 100-200 based on dataset size +pub fn build_hnsw_index(points: Vec<(i64, Vec)>) -> anyhow::Result<()> { + let point_count = points.len(); + let _ = build_hnsw_index_streaming(point_count, points)?; Ok(()) } @@ -319,6 +347,33 @@ mod tests { assert!(!is_hnsw_index_loaded()); } + #[test] + fn test_streaming_build_empty_index() { + clear_hnsw_index(); + + let inserted = build_hnsw_index_streaming(0, std::iter::empty()).unwrap(); + + assert_eq!(inserted, 0); + assert!(!is_hnsw_index_loaded()); + } + + #[test] + fn test_streaming_build_and_search() { + clear_hnsw_index(); + let points: Vec<(i64, Vec)> = (0..100) + .map(|i| (i, make_random_embedding(i as u64, 384))) + .collect(); + + let inserted = build_hnsw_index_streaming(points.len(), points.into_iter()).unwrap(); + + assert_eq!(inserted, 100); + assert!(is_hnsw_index_loaded()); + + let query = make_random_embedding(42, 384); + let results = search_hnsw(query, 5).unwrap(); + assert!(!results.is_empty()); + } + #[test] fn test_build_and_search() { clear_hnsw_index(); diff --git a/rust_builder/rust/src/api/source_rag.rs b/rust_builder/rust/src/api/source_rag.rs index a39e637..837a009 100644 --- a/rust_builder/rust/src/api/source_rag.rs +++ b/rust_builder/rust/src/api/source_rag.rs @@ -21,8 +21,8 @@ use crate::api::bm25_search::{bm25_add_documents, bm25_clear_index, is_bm25_inde use crate::api::db_pool::get_connection; use crate::api::error::RagError; use crate::api::hnsw_index::{ - build_hnsw_index, clear_hnsw_index, is_hnsw_index_loaded, load_hnsw_index, save_hnsw_index, - search_hnsw, + build_hnsw_index_streaming, clear_hnsw_index, is_hnsw_index_loaded, load_hnsw_index, + save_hnsw_index, search_hnsw, }; use crate::api::hybrid_search::{search_hybrid_meta_inner, RrfConfig, SearchFilter}; use crate::api::ingest_metrics::{ @@ -862,6 +862,26 @@ fn rebuild_chunk_hnsw_index_for_collection_inner(collection_id: String) -> Resul let conn = get_connection().map_err(|e| RagError::DatabaseError(e.to_string()))?; ensure_collection_row(&conn, &collection_id)?; + let point_count_hint: usize = conn + .query_row( + "SELECT COUNT(*) + FROM chunks c + JOIN sources s ON s.id = c.source_id + WHERE c.collection_id = ?1 + AND COALESCE(s.status, 'completed') = 'completed'", + params![&collection_id], + |row| row.get::<_, i64>(0), + ) + .map(|count| count.max(0) as usize) + .map_err(|e| RagError::DatabaseError(e.to_string()))?; + + if point_count_hint == 0 { + clear_hnsw_index(); + set_active_hnsw_collection(&collection_id); + mark_collection_hnsw_clean(&conn, &collection_id)?; + return Ok(()); + } + let has_chunk_embedding_i8: bool = conn .prepare("SELECT embedding_i8 FROM chunks LIMIT 1") .is_ok(); @@ -887,8 +907,8 @@ fn rebuild_chunk_hnsw_index_for_collection_inner(collection_id: String) -> Resul } .map_err(|e| RagError::DatabaseError(e.to_string()))?; - let points: Vec<(i64, Vec)> = stmt - .query_map(params![collection_id], |row| { + let rows = stmt + .query_map(params![&collection_id], |row| { let id: i64 = row.get(0)?; let embedding_blob: Vec = row.get(1)?; let embedding_i8_blob: Option> = row.get(2)?; @@ -916,16 +936,21 @@ fn rebuild_chunk_hnsw_index_for_collection_inner(collection_id: String) -> Resul }; Ok((id, embedding)) }) - .map_err(|e| RagError::DatabaseError(e.to_string()))? - .filter_map(|r| r.ok()) - .filter(|(_, embedding)| !embedding.is_empty()) - .collect(); + .map_err(|e| RagError::DatabaseError(e.to_string()))?; + + let points = rows + .filter_map(|row| row.ok()) + .filter(|(_, embedding)| !embedding.is_empty()); + let inserted = build_hnsw_index_streaming(point_count_hint, points) + .map_err(|e| RagError::InternalError(e.to_string()))?; - if points.is_empty() { + if inserted == 0 { clear_hnsw_index(); } else { - build_hnsw_index(points).map_err(|e| RagError::InternalError(e.to_string()))?; - info!("[rebuild_chunk_hnsw] Built index for {}", collection_id); + info!( + "[rebuild_chunk_hnsw] Built index for {} with {} chunks", + collection_id, inserted + ); } set_active_hnsw_collection(&collection_id); mark_collection_hnsw_clean(&conn, &collection_id)?; From e37d4fa1d76026802e44c055fcaaec654a95d466 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Sat, 4 Jul 2026 00:45:12 +0900 Subject: [PATCH 5/8] feat(native): restore HNSW recall & implement block-wise quantization (Q8_0) - Re-route HNSW rebuilds in simple/source RAG to original f32 embeddings, recovering semantic search recall to 1.000 (resolving compound distortion loop). - Implement block-wise quantization (GGML Q8_0 style, 24 blocks of 32 elements) to reduce outlier sensitivity. - dynamic cosine similarity kernel supporting dynamic fallback for legacy 768-byte uniform and 864-byte block-wise blobs. - Platform-gate HNSW streaming rebuild for macOS default, opt-in elsewhere. - Bump versions to 0.20.0 (root) and 0.19.2 (rust_builder). - Add support for Windows/Linux platforms. --- .gitignore | 9 + CHANGELOG.md | 9 + README.md | 8 +- docs/guides/quick_start.md | 4 +- docs/perf/mimalloc-allocator-ab/RESULTS.md | 32 +- .../profiles.jsonl | 15 + .../summary_medians.json | 104 +++ .../profile_rep1.jsonl | 3 + .../profiles.jsonl | 3 + .../profiles.jsonl | 15 + .../summary_medians.json | 104 +++ .../all_profiles.jsonl | 15 + .../profile_rep1.jsonl | 3 + .../profile_rep2.jsonl | 3 + .../profile_rep3.jsonl | 3 + .../profile_rep4.jsonl | 3 + .../profile_rep5.jsonl | 3 + .../summary_medians.json | 59 ++ .../all_profiles.jsonl | 15 + .../profile_rep1.jsonl | 3 + .../profile_rep2.jsonl | 3 + .../profile_rep3.jsonl | 3 + .../profile_rep4.jsonl | 3 + .../profile_rep5.jsonl | 3 + .../summary_medians.json | 62 ++ ...9-rebuild-streaming-memory-optimization.md | 666 ++++++++++++++++++ .../allocator_indexing_measure_test.dart | 235 +++--- example/pubspec.lock | 4 +- example/pubspec.yaml | 9 + pubspec.lock | 4 +- pubspec.yaml | 4 +- rust_builder/CHANGELOG.md | 7 + rust_builder/pubspec.yaml | 2 +- rust_builder/rust/Cargo.toml | 1 + rust_builder/rust/src/api/hybrid_search.rs | 8 +- rust_builder/rust/src/api/runtime_info.rs | 46 +- rust_builder/rust/src/api/simple_rag.rs | 32 +- rust_builder/rust/src/api/source_rag.rs | 88 ++- rust_builder/rust/src/api/vector_quant.rs | 273 +++++++ 39 files changed, 1688 insertions(+), 178 deletions(-) create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/profiles.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/summary_medians.json create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-20260629-150105/profile_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151357/profiles.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/profiles.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/summary_medians.json create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/all_profiles.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/summary_medians.json create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/all_profiles.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep1.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep2.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep3.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep4.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep5.jsonl create mode 100644 docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/summary_medians.json create mode 100644 docs/superpowers/plans/2026-06-29-rebuild-streaming-memory-optimization.md diff --git a/.gitignore b/.gitignore index a9e813b..c955680 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,14 @@ docs/reports/*.html docs/perf/ondevice-query-profiler/GOALS-P5-*.md docs/perf/ondevice-query-profiler/PR-P5-[2-9]*.html docs/perf/ondevice-query-profiler/artifacts/ +docs/architecture/managed-local-rag-final.png +docs/architecture/managed-local-rag-final.svg +docs/promo/flutter-rag-to-llm-workflow-part*-draft.* +docs/promo/package_guide_android_staging/ +docs/promo/package_guide_staging/ +docs/promo/package_guide_sample_document.txt +docs/promo/package_guide_validation_*.md +docs/promo/screenshots/ example/assets/corpus/ example/assets/evalsets/ example/assets/sample_data/*.pdf @@ -74,6 +82,7 @@ example/assets/sample_data/*.pdf !example/assets/sample_data/sample_kor.pdf # Example evaluation/performance runners (local only) +example/lib/onnx_runtime_smoke.dart example/lib/*_runner.dart example/lib/profiling/relevance_evalset.dart example/lib/profiling/relevance_metrics.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ad612..c373a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.20.0 +* **Block-wise Quantization**: + - Integrated block-wise scalar quantization (Q8_0 style, 32-dim blocks) for on-device exact-scans. + - Implemented backward-compatible dynamic fallback in distance similarity logic to search both legacy 768-byte uniform blobs and new 864-byte packed block-wise blobs. +* **Retrieval Quality**: + - Optimized HNSW index rebuild loops to load original high-precision f32 database embeddings directly, resolving the compound distortion loop and restoring semantic query recall to baseline parity. +* **Compatibility**: + - Bumped native dependency constraint to `rag_engine_flutter: ^0.19.2`. + ## 0.19.1 * **Packaging**: - Fixed the publish archive so `lib/models/*.dart` is included again. diff --git a/README.md b/README.md index acaecc8..5732ca3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ round-trip for retrieval. ![pub package](https://img.shields.io/pub/v/mobile_rag_engine) ![flutter](https://img.shields.io/badge/Flutter-3.9%2B-blue) ![rust](https://img.shields.io/badge/Core-Rust-orange) -![platform](https://img.shields.io/badge/Platform-iOS%20|%20Android%20|%20macOS-lightgrey) +![platform](https://img.shields.io/badge/Platform-iOS%20%7C%20Android%20%7C%20macOS%20%7C%20Windows%20%7C%20Linux-lightgrey) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Use it when you need a **Flutter local RAG engine** for private notes, document @@ -25,7 +25,7 @@ stay on the device. **You do NOT need to install Rust, Cargo, or Android NDK.** -This package includes **pre-compiled binaries** for iOS, Android, and macOS. Just `pub add` and run. +This package includes **pre-compiled binaries** for iOS, Android, macOS, Windows, and Linux. Just `pub add` and run. ### Performance @@ -91,6 +91,8 @@ Data never leaves the user's device. Perfect for privacy-focused apps (journals, | **iOS** | 16.0+ | | **Android** | API 21+ (Android 5.0 Lollipop) | | **macOS** | 14.0+ | +| **Windows** | Windows 10+ (x64) | +| **Linux** | glibc 2.31+ (x64) | > ONNX Runtime is provided through [`flutter_onnxruntime`](https://pub.dev/packages/flutter_onnxruntime). CocoaPods iOS builds require static framework linkage (`use_frameworks! :linkage => :static`), and Android release builds should keep ONNX Runtime classes in ProGuard/R8 rules. @@ -102,7 +104,7 @@ Data never leaves the user's device. Perfect for privacy-focused apps (journals, ```yaml dependencies: - mobile_rag_engine: ^0.19.0 + mobile_rag_engine: ^0.20.0 ``` ### 2. Download Model Files diff --git a/docs/guides/quick_start.md b/docs/guides/quick_start.md index 8d36263..bb6e5b8 100644 --- a/docs/guides/quick_start.md +++ b/docs/guides/quick_start.md @@ -7,7 +7,7 @@ Get started with `mobile_rag_engine` in 5 minutes. ## Prerequisites - Flutter 3.9+ -- iOS 16.0+ / Android API 21+ / macOS 14.0+ +- iOS 16.0+ / Android API 21+ / macOS 14.0+ / Windows 10+ / Linux --- @@ -16,7 +16,7 @@ Get started with `mobile_rag_engine` in 5 minutes. ```yaml # pubspec.yaml dependencies: - mobile_rag_engine: ^0.19.0 + mobile_rag_engine: ^0.20.0 ``` ```bash diff --git a/docs/perf/mimalloc-allocator-ab/RESULTS.md b/docs/perf/mimalloc-allocator-ab/RESULTS.md index 29414b2..9eb1a4f 100644 --- a/docs/perf/mimalloc-allocator-ab/RESULTS.md +++ b/docs/perf/mimalloc-allocator-ab/RESULTS.md @@ -66,11 +66,37 @@ yet. The safer near-term optimization is to reduce peak allocation in the rebuild pipeline itself instead of relying only on allocator behavior. +### HNSW Streaming Platform Gate + +The realistic system-allocator HNSW A/B changed the HNSW streaming conclusion: +it is not a universal package optimization. + +Benchmark shape: 384-dim f32 stub embeddings, 500-char chunks, 10k/20k/50k +chunk counts, five-run median, app/profile mode, system allocator only. + +macOS matched the expected memory model. Removing the intermediate +`Vec<(i64, Vec)>` lowered peak RSS by 4.5% / 5.4% / 8.6% at +10k / 20k / 50k chunks, with runtime neutral to slightly better. + +iPad 10 did not match that model. Streaming was slower by 10.4% / 1.5% / 7.4% +and peak RSS increased at all measured scales, including a 50k peak increase +from 740.9 MiB to 821.9 MiB. Treat this as platform-specific interaction among +row iteration, blob decode, per-row allocation, HNSW insertion timing, allocator +retention, SQLite/cache accounting, and iOS RSS sampling. + +Decision: keep HNSW streaming as a macOS default memory-pressure optimization +and as an opt-in experiment elsewhere via the `hnsw_streaming_rebuild` Rust +feature. Keep iOS, Android, and other unvalidated targets on the existing +collect-based rebuild path by default. Do not describe HNSW streaming as a +mobile-wide or package-wide improvement. + ## Safe Optimization Shortlist -1. Stream HNSW rebuild rows instead of collecting `Vec<(i64, Vec)>`. - Count rows first to size the HNSW index, then insert while iterating SQLite - rows. This targets peak RSS directly. +1. Keep HNSW rebuild streaming platform-gated. + macOS can stream rows by default because the realistic system-allocator A/B + showed lower peak RSS. iOS, Android, and unvalidated targets should keep the + collect-based path unless `hnsw_streaming_rebuild` is explicitly enabled for + an experiment. 2. Stream BM25 rebuild rows instead of collecting `Vec<(i64, String)>`. Add each document to the in-memory BM25 index as rows are read from SQLite. diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/profiles.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/profiles.jsonl new file mode 100644 index 0000000..93e81fa --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/profiles.jsonl @@ -0,0 +1,15 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":311.224,"rebuild_total_ms":4808.251,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4644959834,"hnsw_rebuild_count":1,"hnsw_save_nanos":40149666,"hnsw_save_count":1,"bm25_rebuild_nanos":122507041,"bm25_rebuild_count":1,"rss_start_bytes":224346112,"rss_end_bytes":291094528,"rss_peak_bytes":291094528,"rss_delta_bytes":66748416,"rss_samples_bytes":[224346112,290521088,291094528]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":580.337,"rebuild_total_ms":14860.939,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":14576326542,"hnsw_rebuild_count":1,"hnsw_save_nanos":42108167,"hnsw_save_count":1,"bm25_rebuild_nanos":241786916,"bm25_rebuild_count":1,"rss_start_bytes":340393984,"rss_end_bytes":470433792,"rss_peak_bytes":470581248,"rss_delta_bytes":130039808,"rss_samples_bytes":[340393984,470581248,470433792]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":2196.543,"rebuild_total_ms":46149.308,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":45396711083,"hnsw_rebuild_count":1,"hnsw_save_nanos":120672791,"hnsw_save_count":1,"bm25_rebuild_nanos":631237542,"bm25_rebuild_count":1,"rss_start_bytes":490668032,"rss_end_bytes":692666368,"rss_peak_bytes":725139456,"rss_delta_bytes":201998336,"rss_samples_bytes":[490668032,725139456,692666368]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":257.208,"rebuild_total_ms":5372.162,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5227666792,"hnsw_rebuild_count":1,"hnsw_save_nanos":19798625,"hnsw_save_count":1,"bm25_rebuild_nanos":124074834,"bm25_rebuild_count":1,"rss_start_bytes":643465216,"rss_end_bytes":685195264,"rss_peak_bytes":685195264,"rss_delta_bytes":41730048,"rss_samples_bytes":[643465216,685162496,685195264]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":551.792,"rebuild_total_ms":17482.315,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":17182448458,"hnsw_rebuild_count":1,"hnsw_save_nanos":26333875,"hnsw_save_count":1,"bm25_rebuild_nanos":272963417,"bm25_rebuild_count":1,"rss_start_bytes":558563328,"rss_end_bytes":641941504,"rss_peak_bytes":641941504,"rss_delta_bytes":83378176,"rss_samples_bytes":[558563328,641941504,641941504]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1623.611,"rebuild_total_ms":50368.615,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":49575602667,"hnsw_rebuild_count":1,"hnsw_save_nanos":103457666,"hnsw_save_count":1,"bm25_rebuild_nanos":688709208,"bm25_rebuild_count":1,"rss_start_bytes":658882560,"rss_end_bytes":539246592,"rss_peak_bytes":658882560,"rss_delta_bytes":-119635968,"rss_samples_bytes":[658882560,539082752,539246592]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":298.132,"rebuild_total_ms":5454.561,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5300125917,"hnsw_rebuild_count":1,"hnsw_save_nanos":19092375,"hnsw_save_count":1,"bm25_rebuild_nanos":134840000,"bm25_rebuild_count":1,"rss_start_bytes":500252672,"rss_end_bytes":541933568,"rss_peak_bytes":541933568,"rss_delta_bytes":41680896,"rss_samples_bytes":[500252672,541917184,541933568]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":862.166,"rebuild_total_ms":16422.058,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":16112395333,"hnsw_rebuild_count":1,"hnsw_save_nanos":35386375,"hnsw_save_count":1,"bm25_rebuild_nanos":273695917,"bm25_rebuild_count":1,"rss_start_bytes":547766272,"rss_end_bytes":631062528,"rss_peak_bytes":631062528,"rss_delta_bytes":83296256,"rss_samples_bytes":[547766272,631046144,631062528]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":2036.865,"rebuild_total_ms":45621.054,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":44799380458,"hnsw_rebuild_count":1,"hnsw_save_nanos":127277250,"hnsw_save_count":1,"bm25_rebuild_nanos":693797000,"bm25_rebuild_count":1,"rss_start_bytes":649068544,"rss_end_bytes":770605056,"rss_peak_bytes":793526272,"rss_delta_bytes":121536512,"rss_samples_bytes":[649068544,793526272,770605056]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":243.229,"rebuild_total_ms":6214.994,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":6062405333,"hnsw_rebuild_count":1,"hnsw_save_nanos":14418000,"hnsw_save_count":1,"bm25_rebuild_nanos":137688291,"bm25_rebuild_count":1,"rss_start_bytes":652443648,"rss_end_bytes":694157312,"rss_peak_bytes":694157312,"rss_delta_bytes":41713664,"rss_samples_bytes":[652443648,694124544,694157312]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":837.415,"rebuild_total_ms":19032.062,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":18729825708,"hnsw_rebuild_count":1,"hnsw_save_nanos":27205000,"hnsw_save_count":1,"bm25_rebuild_nanos":274449875,"bm25_rebuild_count":1,"rss_start_bytes":621363200,"rss_end_bytes":704774144,"rss_peak_bytes":704774144,"rss_delta_bytes":83410944,"rss_samples_bytes":[621363200,704774144,704774144]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1600.909,"rebuild_total_ms":44136.697,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":43322145458,"hnsw_rebuild_count":1,"hnsw_save_nanos":116983041,"hnsw_save_count":1,"bm25_rebuild_nanos":696996042,"bm25_rebuild_count":1,"rss_start_bytes":647970816,"rss_end_bytes":768819200,"rss_peak_bytes":776929280,"rss_delta_bytes":120848384,"rss_samples_bytes":[647970816,776929280,768819200]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":474.607,"rebuild_total_ms":5681.38,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5528013125,"hnsw_rebuild_count":1,"hnsw_save_nanos":14940584,"hnsw_save_count":1,"bm25_rebuild_nanos":137750958,"bm25_rebuild_count":1,"rss_start_bytes":650936320,"rss_end_bytes":693764096,"rss_peak_bytes":693764096,"rss_delta_bytes":42827776,"rss_samples_bytes":[650936320,693731328,693764096]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":537.529,"rebuild_total_ms":18545.012,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":18239056917,"hnsw_rebuild_count":1,"hnsw_save_nanos":27112333,"hnsw_save_count":1,"bm25_rebuild_nanos":278346125,"bm25_rebuild_count":1,"rss_start_bytes":621166592,"rss_end_bytes":707428352,"rss_peak_bytes":707428352,"rss_delta_bytes":86261760,"rss_samples_bytes":[621166592,707428352,707428352]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1633.819,"rebuild_total_ms":44556.297,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":43766551625,"hnsw_rebuild_count":1,"hnsw_save_nanos":91294166,"hnsw_save_count":1,"bm25_rebuild_nanos":697815792,"bm25_rebuild_count":1,"rss_start_bytes":648691712,"rss_end_bytes":792887296,"rss_peak_bytes":792887296,"rss_delta_bytes":144195584,"rss_samples_bytes":[648691712,792887296,792887296]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/summary_medians.json new file mode 100644 index 0000000..46e41cb --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-a2ec52a-inapp-repeat-nobuild-20260629-155651/summary_medians.json @@ -0,0 +1,104 @@ +[ + { + "profile_label": "5MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 5, + "actual_text_mb": 5, + "chunk_count": 10000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 14.648, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 5455, + "rebuild_total_ms_avg": 5506, + "rebuild_total_ms_min": 4808, + "rebuild_total_ms_max": 6215, + "hnsw_rebuild_ms_median": 5300, + "hnsw_rebuild_ms_min": 4645, + "hnsw_rebuild_ms_max": 6062, + "hnsw_save_ms_median": 19, + "bm25_rebuild_ms_median": 135, + "rss_peak_mib_median": 653.5, + "rss_peak_mib_min": 277.6, + "rss_peak_mib_max": 662, + "rss_delta_mib_median": 39.8, + "rss_delta_mib_min": 39.8, + "rss_delta_mib_max": 63.7 + }, + { + "profile_label": "10MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 10, + "actual_text_mb": 10, + "chunk_count": 20000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 29.297, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 17482, + "rebuild_total_ms_avg": 17268, + "rebuild_total_ms_min": 14861, + "rebuild_total_ms_max": 19032, + "hnsw_rebuild_ms_median": 17182, + "hnsw_rebuild_ms_min": 14576, + "hnsw_rebuild_ms_max": 18730, + "hnsw_save_ms_median": 27, + "bm25_rebuild_ms_median": 274, + "rss_peak_mib_median": 612.2, + "rss_peak_mib_min": 448.8, + "rss_peak_mib_max": 674.7, + "rss_delta_mib_median": 79.5, + "rss_delta_mib_min": 79.4, + "rss_delta_mib_max": 124 + }, + { + "profile_label": "25MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 25, + "actual_text_mb": 25, + "chunk_count": 50000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 73.242, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 45621, + "rebuild_total_ms_avg": 46166, + "rebuild_total_ms_min": 44137, + "rebuild_total_ms_max": 50369, + "hnsw_rebuild_ms_median": 44799, + "hnsw_rebuild_ms_min": 43322, + "hnsw_rebuild_ms_max": 49576, + "hnsw_save_ms_median": 117, + "bm25_rebuild_ms_median": 694, + "rss_peak_mib_median": 740.9, + "rss_peak_mib_min": 628.4, + "rss_peak_mib_max": 756.8, + "rss_delta_mib_median": 115.9, + "rss_delta_mib_min": -114.1, + "rss_delta_mib_max": 192.6 + } +] \ No newline at end of file diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-20260629-150105/profile_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-20260629-150105/profile_rep1.jsonl new file mode 100644 index 0000000..dfcc07d --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-20260629-150105/profile_rep1.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":310.865,"rebuild_total_ms":5431.001,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5266431500,"hnsw_rebuild_count":1,"hnsw_save_nanos":39271500,"hnsw_save_count":1,"bm25_rebuild_nanos":124544417,"bm25_rebuild_count":1,"rss_start_bytes":225935360,"rss_end_bytes":292290560,"rss_peak_bytes":292290560,"rss_delta_bytes":66355200,"rss_samples_bytes":[225935360,291766272,292290560]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":585.467,"rebuild_total_ms":13612.833,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":13314297000,"hnsw_rebuild_count":1,"hnsw_save_nanos":53804917,"hnsw_save_count":1,"bm25_rebuild_nanos":244103167,"bm25_rebuild_count":1,"rss_start_bytes":343769088,"rss_end_bytes":454017024,"rss_peak_bytes":472842240,"rss_delta_bytes":110247936,"rss_samples_bytes":[343769088,472842240,454017024]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":2154.481,"rebuild_total_ms":45894.135,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":45126985084,"hnsw_rebuild_count":1,"hnsw_save_nanos":127055834,"hnsw_save_count":1,"bm25_rebuild_nanos":639450125,"bm25_rebuild_count":1,"rss_start_bytes":488226816,"rss_end_bytes":692502528,"rss_peak_bytes":759906304,"rss_delta_bytes":204275712,"rss_samples_bytes":[488226816,759906304,692502528]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151357/profiles.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151357/profiles.jsonl new file mode 100644 index 0000000..0a4e661 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151357/profiles.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":316.365,"rebuild_total_ms":5347.195,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5175748250,"hnsw_rebuild_count":1,"hnsw_save_nanos":45074000,"hnsw_save_count":1,"bm25_rebuild_nanos":125801084,"bm25_rebuild_count":1,"rss_start_bytes":226279424,"rss_end_bytes":292618240,"rss_peak_bytes":292618240,"rss_delta_bytes":66338816,"rss_samples_bytes":[226279424,292405248,292618240]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":592.735,"rebuild_total_ms":17719.104,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":17415773250,"hnsw_rebuild_count":1,"hnsw_save_nanos":58719709,"hnsw_save_count":1,"bm25_rebuild_nanos":244046083,"bm25_rebuild_count":1,"rss_start_bytes":340869120,"rss_end_bytes":470401024,"rss_peak_bytes":472973312,"rss_delta_bytes":129531904,"rss_samples_bytes":[340869120,472973312,470401024]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":2021.406,"rebuild_total_ms":42973.945,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":42155384917,"hnsw_rebuild_count":1,"hnsw_save_nanos":153036750,"hnsw_save_count":1,"bm25_rebuild_nanos":664857584,"bm25_rebuild_count":1,"rss_start_bytes":505528320,"rss_end_bytes":696713216,"rss_peak_bytes":753991680,"rss_delta_bytes":191184896,"rss_samples_bytes":[505528320,753991680,696713216]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/profiles.jsonl b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/profiles.jsonl new file mode 100644 index 0000000..8627d5a --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/profiles.jsonl @@ -0,0 +1,15 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":322.838,"rebuild_total_ms":6023.646,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5853941375,"hnsw_rebuild_count":1,"hnsw_save_nanos":43200959,"hnsw_save_count":1,"bm25_rebuild_nanos":125809166,"bm25_rebuild_count":1,"rss_start_bytes":227295232,"rss_end_bytes":294518784,"rss_peak_bytes":294518784,"rss_delta_bytes":67223552,"rss_samples_bytes":[227295232,293994496,294518784]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":587.042,"rebuild_total_ms":16118.926,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":15829329375,"hnsw_rebuild_count":1,"hnsw_save_nanos":46798458,"hnsw_save_count":1,"bm25_rebuild_nanos":242219916,"bm25_rebuild_count":1,"rss_start_bytes":340590592,"rss_end_bytes":445349888,"rss_peak_bytes":445415424,"rss_delta_bytes":104759296,"rss_samples_bytes":[340590592,445415424,445349888]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":1,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":2010.867,"rebuild_total_ms":49007.814,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":48225152958,"hnsw_rebuild_count":1,"hnsw_save_nanos":111487792,"hnsw_save_count":1,"bm25_rebuild_nanos":670476750,"bm25_rebuild_count":1,"rss_start_bytes":500449280,"rss_end_bytes":734986240,"rss_peak_bytes":757645312,"rss_delta_bytes":234536960,"rss_samples_bytes":[500449280,757645312,734986240]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":286.224,"rebuild_total_ms":6021.631,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5870571917,"hnsw_rebuild_count":1,"hnsw_save_nanos":21007709,"hnsw_save_count":1,"bm25_rebuild_nanos":129498834,"bm25_rebuild_count":1,"rss_start_bytes":649428992,"rss_end_bytes":691240960,"rss_peak_bytes":691240960,"rss_delta_bytes":41811968,"rss_samples_bytes":[649428992,691224576,691240960]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":1018.318,"rebuild_total_ms":18929.91,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":18632473208,"hnsw_rebuild_count":1,"hnsw_save_nanos":26233583,"hnsw_save_count":1,"bm25_rebuild_nanos":270628542,"bm25_rebuild_count":1,"rss_start_bytes":564461568,"rss_end_bytes":649576448,"rss_peak_bytes":649576448,"rss_delta_bytes":85114880,"rss_samples_bytes":[564461568,649576448,649576448]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":2,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1717.391,"rebuild_total_ms":46900.354,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":46104331125,"hnsw_rebuild_count":1,"hnsw_save_nanos":103207042,"hnsw_save_count":1,"bm25_rebuild_nanos":692137042,"bm25_rebuild_count":1,"rss_start_bytes":717406208,"rss_end_bytes":860241920,"rss_peak_bytes":861061120,"rss_delta_bytes":142835712,"rss_samples_bytes":[717406208,861061120,860241920]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":276.078,"rebuild_total_ms":5750.88,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5599566583,"hnsw_rebuild_count":1,"hnsw_save_nanos":13982791,"hnsw_save_count":1,"bm25_rebuild_nanos":136839167,"bm25_rebuild_count":1,"rss_start_bytes":658227200,"rss_end_bytes":699842560,"rss_peak_bytes":699842560,"rss_delta_bytes":41615360,"rss_samples_bytes":[658227200,699826176,699842560]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":582.6,"rebuild_total_ms":17751.508,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":17451800541,"hnsw_rebuild_count":1,"hnsw_save_nanos":25838959,"hnsw_save_count":1,"bm25_rebuild_nanos":273364958,"bm25_rebuild_count":1,"rss_start_bytes":571899904,"rss_end_bytes":655228928,"rss_peak_bytes":655228928,"rss_delta_bytes":83329024,"rss_samples_bytes":[571899904,655228928,655228928]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":3,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1653.531,"rebuild_total_ms":50999.715,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":50197744833,"hnsw_rebuild_count":1,"hnsw_save_nanos":102726125,"hnsw_save_count":1,"bm25_rebuild_nanos":698600625,"bm25_rebuild_count":1,"rss_start_bytes":722255872,"rss_end_bytes":852869120,"rss_peak_bytes":861814784,"rss_delta_bytes":130613248,"rss_samples_bytes":[722255872,861814784,852869120]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":284.862,"rebuild_total_ms":6030.732,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5873319291,"hnsw_rebuild_count":1,"hnsw_save_nanos":20233583,"hnsw_save_count":1,"bm25_rebuild_nanos":136554209,"bm25_rebuild_count":1,"rss_start_bytes":655736832,"rss_end_bytes":697384960,"rss_peak_bytes":697384960,"rss_delta_bytes":41648128,"rss_samples_bytes":[655736832,697368576,697384960]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":594.151,"rebuild_total_ms":19784.242,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":19443657125,"hnsw_rebuild_count":1,"hnsw_save_nanos":75349083,"hnsw_save_count":1,"bm25_rebuild_nanos":264632375,"bm25_rebuild_count":1,"rss_start_bytes":569524224,"rss_end_bytes":652886016,"rss_peak_bytes":652886016,"rss_delta_bytes":83361792,"rss_samples_bytes":[569524224,652886016,652886016]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":4,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1678.587,"rebuild_total_ms":49944.365,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":49169178958,"hnsw_rebuild_count":1,"hnsw_save_nanos":79564834,"hnsw_save_count":1,"bm25_rebuild_nanos":695029667,"bm25_rebuild_count":1,"rss_start_bytes":719618048,"rss_end_bytes":863141888,"rss_peak_bytes":863141888,"rss_delta_bytes":143523840,"rss_samples_bytes":[719618048,863141888,863141888]} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":262.511,"rebuild_total_ms":6157.504,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":6006681083,"hnsw_rebuild_count":1,"hnsw_save_nanos":15698208,"hnsw_save_count":1,"bm25_rebuild_nanos":134514833,"bm25_rebuild_count":1,"rss_start_bytes":658276352,"rss_end_bytes":699940864,"rss_peak_bytes":699940864,"rss_delta_bytes":41664512,"rss_samples_bytes":[658276352,699908096,699940864]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":670.007,"rebuild_total_ms":16870.818,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":16564479917,"hnsw_rebuild_count":1,"hnsw_save_nanos":26943875,"hnsw_save_count":1,"bm25_rebuild_nanos":278860250,"bm25_rebuild_count":1,"rss_start_bytes":572112896,"rss_end_bytes":655458304,"rss_peak_bytes":655458304,"rss_delta_bytes":83345408,"rss_samples_bytes":[572112896,655458304,655458304]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","repeat":5,"repeat_count":5,"text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":1713.84,"rebuild_total_ms":34088.169,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":33297510125,"hnsw_rebuild_count":1,"hnsw_save_nanos":79516334,"hnsw_save_count":1,"bm25_rebuild_nanos":710500708,"bm25_rebuild_count":1,"rss_start_bytes":721158144,"rss_end_bytes":848805888,"rss_peak_bytes":865026048,"rss_delta_bytes":127647744,"rss_samples_bytes":[721158144,865026048,848805888]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/summary_medians.json new file mode 100644 index 0000000..35d74d8 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-streaming-system-inapp-repeat-20260629-151854/summary_medians.json @@ -0,0 +1,104 @@ +[ + { + "profile_label": "5MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 5, + "actual_text_mb": 5, + "chunk_count": 10000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 14.648, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 6024, + "rebuild_total_ms_avg": 5997, + "rebuild_total_ms_min": 5751, + "rebuild_total_ms_max": 6158, + "hnsw_rebuild_ms_median": 5871, + "hnsw_rebuild_ms_min": 5600, + "hnsw_rebuild_ms_max": 6007, + "hnsw_save_ms_median": 20, + "bm25_rebuild_ms_median": 135, + "rss_peak_mib_median": 665.1, + "rss_peak_mib_min": 280.9, + "rss_peak_mib_max": 667.5, + "rss_delta_mib_median": 39.7, + "rss_delta_mib_min": 39.7, + "rss_delta_mib_max": 64.1 + }, + { + "profile_label": "10MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 10, + "actual_text_mb": 10, + "chunk_count": 20000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 29.297, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 17752, + "rebuild_total_ms_avg": 17891, + "rebuild_total_ms_min": 16119, + "rebuild_total_ms_max": 19784, + "hnsw_rebuild_ms_median": 17452, + "hnsw_rebuild_ms_min": 15829, + "hnsw_rebuild_ms_max": 19444, + "hnsw_save_ms_median": 27, + "bm25_rebuild_ms_median": 271, + "rss_peak_mib_median": 622.6, + "rss_peak_mib_min": 424.8, + "rss_peak_mib_max": 625.1, + "rss_delta_mib_median": 79.5, + "rss_delta_mib_min": 79.5, + "rss_delta_mib_max": 99.9 + }, + { + "profile_label": "25MB_text_500char_384d", + "runs": 5, + "repeats": [ + 1, + 2, + 3, + 4, + 5 + ], + "target_text_mb": 25, + "actual_text_mb": 25, + "chunk_count": 50000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 73.242, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 49008, + "rebuild_total_ms_avg": 46188, + "rebuild_total_ms_min": 34088, + "rebuild_total_ms_max": 51000, + "hnsw_rebuild_ms_median": 48225, + "hnsw_rebuild_ms_min": 33298, + "hnsw_rebuild_ms_max": 50198, + "hnsw_save_ms_median": 103, + "bm25_rebuild_ms_median": 695, + "rss_peak_mib_median": 821.9, + "rss_peak_mib_min": 722.5, + "rss_peak_mib_max": 825, + "rss_delta_mib_median": 136.2, + "rss_delta_mib_min": 121.7, + "rss_delta_mib_max": 223.7 + } +] \ No newline at end of file diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/all_profiles.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/all_profiles.jsonl new file mode 100644 index 0000000..d179668 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/all_profiles.jsonl @@ -0,0 +1,15 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":165.62,"rebuild_total_ms":4014.681,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3908587000,"hnsw_rebuild_count":1,"hnsw_save_nanos":9579916,"hnsw_save_count":1,"bm25_rebuild_nanos":96118625,"bm25_rebuild_count":1,"rss_start_bytes":237453312,"rss_end_bytes":321011712,"rss_peak_bytes":321011712,"rss_delta_bytes":83558400,"rss_samples_bytes":[237453312,320552960,321011712],"rep":1} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":306.941,"rebuild_total_ms":10859.307,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":10649947042,"hnsw_rebuild_count":1,"hnsw_save_nanos":16697167,"hnsw_save_count":1,"bm25_rebuild_nanos":192222500,"bm25_rebuild_count":1,"rss_start_bytes":365920256,"rss_end_bytes":512720896,"rss_peak_bytes":512720896,"rss_delta_bytes":146800640,"rss_samples_bytes":[365920256,512720896,512720896],"rep":1} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":809.303,"rebuild_total_ms":36243.08,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":35654636542,"hnsw_rebuild_count":1,"hnsw_save_nanos":51461833,"hnsw_save_count":1,"bm25_rebuild_nanos":536531042,"bm25_rebuild_count":1,"rss_start_bytes":586366976,"rss_end_bytes":878755840,"rss_peak_bytes":878755840,"rss_delta_bytes":292388864,"rss_samples_bytes":[586366976,878739456,878755840],"rep":1} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":167.71,"rebuild_total_ms":4223.511,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4116658584,"hnsw_rebuild_count":1,"hnsw_save_nanos":9871333,"hnsw_save_count":1,"bm25_rebuild_nanos":96510500,"bm25_rebuild_count":1,"rss_start_bytes":244760576,"rss_end_bytes":337395712,"rss_peak_bytes":337395712,"rss_delta_bytes":92635136,"rss_samples_bytes":[244760576,336936960,337395712],"rep":2} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":309.499,"rebuild_total_ms":13562.464,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":13349226875,"hnsw_rebuild_count":1,"hnsw_save_nanos":17415458,"hnsw_save_count":1,"bm25_rebuild_nanos":195383667,"bm25_rebuild_count":1,"rss_start_bytes":374259712,"rss_end_bytes":519536640,"rss_peak_bytes":519536640,"rss_delta_bytes":145276928,"rss_samples_bytes":[374259712,519536640,519536640],"rep":2} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":821.333,"rebuild_total_ms":35782.409,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":35224294625,"hnsw_rebuild_count":1,"hnsw_save_nanos":47045875,"hnsw_save_count":1,"bm25_rebuild_nanos":510616667,"bm25_rebuild_count":1,"rss_start_bytes":592297984,"rss_end_bytes":885129216,"rss_peak_bytes":885293056,"rss_delta_bytes":292831232,"rss_samples_bytes":[592297984,885293056,885129216],"rep":2} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":168.248,"rebuild_total_ms":4403.6,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4295470667,"hnsw_rebuild_count":1,"hnsw_save_nanos":10211209,"hnsw_save_count":1,"bm25_rebuild_nanos":97452458,"bm25_rebuild_count":1,"rss_start_bytes":237436928,"rss_end_bytes":320880640,"rss_peak_bytes":320880640,"rss_delta_bytes":83443712,"rss_samples_bytes":[237436928,320405504,320880640],"rep":3} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":312.894,"rebuild_total_ms":12975.014,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12765237667,"hnsw_rebuild_count":1,"hnsw_save_nanos":16751750,"hnsw_save_count":1,"bm25_rebuild_nanos":192589208,"bm25_rebuild_count":1,"rss_start_bytes":366510080,"rss_end_bytes":513556480,"rss_peak_bytes":513556480,"rss_delta_bytes":147046400,"rss_samples_bytes":[366510080,513556480,513556480],"rep":3} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":784.477,"rebuild_total_ms":34240.224,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":33693852000,"hnsw_rebuild_count":1,"hnsw_save_nanos":48089125,"hnsw_save_count":1,"bm25_rebuild_nanos":497891584,"bm25_rebuild_count":1,"rss_start_bytes":585940992,"rss_end_bytes":878673920,"rss_peak_bytes":878673920,"rss_delta_bytes":292732928,"rss_samples_bytes":[585940992,878657536,878673920],"rep":3} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":185.212,"rebuild_total_ms":4373.937,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4260366250,"hnsw_rebuild_count":1,"hnsw_save_nanos":14141333,"hnsw_save_count":1,"bm25_rebuild_nanos":98995584,"bm25_rebuild_count":1,"rss_start_bytes":237535232,"rss_end_bytes":320536576,"rss_peak_bytes":320536576,"rss_delta_bytes":83001344,"rss_samples_bytes":[237535232,320077824,320536576],"rep":4} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":328.323,"rebuild_total_ms":12929.746,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12703105583,"hnsw_rebuild_count":1,"hnsw_save_nanos":19376625,"hnsw_save_count":1,"bm25_rebuild_nanos":206821916,"bm25_rebuild_count":1,"rss_start_bytes":365756416,"rss_end_bytes":513261568,"rss_peak_bytes":513261568,"rss_delta_bytes":147505152,"rss_samples_bytes":[365756416,513261568,513261568],"rep":4} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":833.157,"rebuild_total_ms":30688.87,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":30129979667,"hnsw_rebuild_count":1,"hnsw_save_nanos":51318208,"hnsw_save_count":1,"bm25_rebuild_nanos":507121125,"bm25_rebuild_count":1,"rss_start_bytes":586563584,"rss_end_bytes":877772800,"rss_peak_bytes":877772800,"rss_delta_bytes":291209216,"rss_samples_bytes":[586563584,877740032,877772800],"rep":4} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":161.449,"rebuild_total_ms":3904.874,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3797248000,"hnsw_rebuild_count":1,"hnsw_save_nanos":8973875,"hnsw_save_count":1,"bm25_rebuild_nanos":98217583,"bm25_rebuild_count":1,"rss_start_bytes":237764608,"rss_end_bytes":320700416,"rss_peak_bytes":320700416,"rss_delta_bytes":82935808,"rss_samples_bytes":[237764608,320225280,320700416],"rep":5} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":313.676,"rebuild_total_ms":12316.799,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12104144792,"hnsw_rebuild_count":1,"hnsw_save_nanos":18441667,"hnsw_save_count":1,"bm25_rebuild_nanos":193783625,"bm25_rebuild_count":1,"rss_start_bytes":365723648,"rss_end_bytes":512950272,"rss_peak_bytes":512950272,"rss_delta_bytes":147226624,"rss_samples_bytes":[365723648,512933888,512950272],"rep":5} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":788.283,"rebuild_total_ms":35174.443,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34626072625,"hnsw_rebuild_count":1,"hnsw_save_nanos":46606584,"hnsw_save_count":1,"bm25_rebuild_nanos":501349292,"bm25_rebuild_count":1,"rss_start_bytes":586153984,"rss_end_bytes":886816768,"rss_peak_bytes":886816768,"rss_delta_bytes":300662784,"rss_samples_bytes":[586153984,886800384,886816768],"rep":5} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep1.jsonl new file mode 100644 index 0000000..4a7d1cc --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep1.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":165.62,"rebuild_total_ms":4014.681,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3908587000,"hnsw_rebuild_count":1,"hnsw_save_nanos":9579916,"hnsw_save_count":1,"bm25_rebuild_nanos":96118625,"bm25_rebuild_count":1,"rss_start_bytes":237453312,"rss_end_bytes":321011712,"rss_peak_bytes":321011712,"rss_delta_bytes":83558400,"rss_samples_bytes":[237453312,320552960,321011712]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":306.941,"rebuild_total_ms":10859.307,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":10649947042,"hnsw_rebuild_count":1,"hnsw_save_nanos":16697167,"hnsw_save_count":1,"bm25_rebuild_nanos":192222500,"bm25_rebuild_count":1,"rss_start_bytes":365920256,"rss_end_bytes":512720896,"rss_peak_bytes":512720896,"rss_delta_bytes":146800640,"rss_samples_bytes":[365920256,512720896,512720896]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":809.303,"rebuild_total_ms":36243.08,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":35654636542,"hnsw_rebuild_count":1,"hnsw_save_nanos":51461833,"hnsw_save_count":1,"bm25_rebuild_nanos":536531042,"bm25_rebuild_count":1,"rss_start_bytes":586366976,"rss_end_bytes":878755840,"rss_peak_bytes":878755840,"rss_delta_bytes":292388864,"rss_samples_bytes":[586366976,878739456,878755840]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep2.jsonl new file mode 100644 index 0000000..1e070ec --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep2.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":167.71,"rebuild_total_ms":4223.511,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4116658584,"hnsw_rebuild_count":1,"hnsw_save_nanos":9871333,"hnsw_save_count":1,"bm25_rebuild_nanos":96510500,"bm25_rebuild_count":1,"rss_start_bytes":244760576,"rss_end_bytes":337395712,"rss_peak_bytes":337395712,"rss_delta_bytes":92635136,"rss_samples_bytes":[244760576,336936960,337395712]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":309.499,"rebuild_total_ms":13562.464,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":13349226875,"hnsw_rebuild_count":1,"hnsw_save_nanos":17415458,"hnsw_save_count":1,"bm25_rebuild_nanos":195383667,"bm25_rebuild_count":1,"rss_start_bytes":374259712,"rss_end_bytes":519536640,"rss_peak_bytes":519536640,"rss_delta_bytes":145276928,"rss_samples_bytes":[374259712,519536640,519536640]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":821.333,"rebuild_total_ms":35782.409,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":35224294625,"hnsw_rebuild_count":1,"hnsw_save_nanos":47045875,"hnsw_save_count":1,"bm25_rebuild_nanos":510616667,"bm25_rebuild_count":1,"rss_start_bytes":592297984,"rss_end_bytes":885129216,"rss_peak_bytes":885293056,"rss_delta_bytes":292831232,"rss_samples_bytes":[592297984,885293056,885129216]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep3.jsonl new file mode 100644 index 0000000..e1c7e5b --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep3.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":168.248,"rebuild_total_ms":4403.6,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4295470667,"hnsw_rebuild_count":1,"hnsw_save_nanos":10211209,"hnsw_save_count":1,"bm25_rebuild_nanos":97452458,"bm25_rebuild_count":1,"rss_start_bytes":237436928,"rss_end_bytes":320880640,"rss_peak_bytes":320880640,"rss_delta_bytes":83443712,"rss_samples_bytes":[237436928,320405504,320880640]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":312.894,"rebuild_total_ms":12975.014,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12765237667,"hnsw_rebuild_count":1,"hnsw_save_nanos":16751750,"hnsw_save_count":1,"bm25_rebuild_nanos":192589208,"bm25_rebuild_count":1,"rss_start_bytes":366510080,"rss_end_bytes":513556480,"rss_peak_bytes":513556480,"rss_delta_bytes":147046400,"rss_samples_bytes":[366510080,513556480,513556480]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":784.477,"rebuild_total_ms":34240.224,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":33693852000,"hnsw_rebuild_count":1,"hnsw_save_nanos":48089125,"hnsw_save_count":1,"bm25_rebuild_nanos":497891584,"bm25_rebuild_count":1,"rss_start_bytes":585940992,"rss_end_bytes":878673920,"rss_peak_bytes":878673920,"rss_delta_bytes":292732928,"rss_samples_bytes":[585940992,878657536,878673920]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep4.jsonl new file mode 100644 index 0000000..4dd5cb0 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep4.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":185.212,"rebuild_total_ms":4373.937,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4260366250,"hnsw_rebuild_count":1,"hnsw_save_nanos":14141333,"hnsw_save_count":1,"bm25_rebuild_nanos":98995584,"bm25_rebuild_count":1,"rss_start_bytes":237535232,"rss_end_bytes":320536576,"rss_peak_bytes":320536576,"rss_delta_bytes":83001344,"rss_samples_bytes":[237535232,320077824,320536576]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":328.323,"rebuild_total_ms":12929.746,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12703105583,"hnsw_rebuild_count":1,"hnsw_save_nanos":19376625,"hnsw_save_count":1,"bm25_rebuild_nanos":206821916,"bm25_rebuild_count":1,"rss_start_bytes":365756416,"rss_end_bytes":513261568,"rss_peak_bytes":513261568,"rss_delta_bytes":147505152,"rss_samples_bytes":[365756416,513261568,513261568]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":833.157,"rebuild_total_ms":30688.87,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":30129979667,"hnsw_rebuild_count":1,"hnsw_save_nanos":51318208,"hnsw_save_count":1,"bm25_rebuild_nanos":507121125,"bm25_rebuild_count":1,"rss_start_bytes":586563584,"rss_end_bytes":877772800,"rss_peak_bytes":877772800,"rss_delta_bytes":291209216,"rss_samples_bytes":[586563584,877740032,877772800]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep5.jsonl new file mode 100644 index 0000000..3506eac --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/profile_rep5.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":161.449,"rebuild_total_ms":3904.874,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3797248000,"hnsw_rebuild_count":1,"hnsw_save_nanos":8973875,"hnsw_save_count":1,"bm25_rebuild_nanos":98217583,"bm25_rebuild_count":1,"rss_start_bytes":237764608,"rss_end_bytes":320700416,"rss_peak_bytes":320700416,"rss_delta_bytes":82935808,"rss_samples_bytes":[237764608,320225280,320700416]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":313.676,"rebuild_total_ms":12316.799,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12104144792,"hnsw_rebuild_count":1,"hnsw_save_nanos":18441667,"hnsw_save_count":1,"bm25_rebuild_nanos":193783625,"bm25_rebuild_count":1,"rss_start_bytes":365723648,"rss_end_bytes":512950272,"rss_peak_bytes":512950272,"rss_delta_bytes":147226624,"rss_samples_bytes":[365723648,512933888,512950272]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":788.283,"rebuild_total_ms":35174.443,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34626072625,"hnsw_rebuild_count":1,"hnsw_save_nanos":46606584,"hnsw_save_count":1,"bm25_rebuild_nanos":501349292,"bm25_rebuild_count":1,"rss_start_bytes":586153984,"rss_end_bytes":886816768,"rss_peak_bytes":886816768,"rss_delta_bytes":300662784,"rss_samples_bytes":[586153984,886800384,886816768]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/summary_medians.json new file mode 100644 index 0000000..1134689 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-nonstreaming-system-a2ec52a-20260629-132217/summary_medians.json @@ -0,0 +1,59 @@ +[ + { + "profile_label": "5MB_text_500char_384d", + "runs": 5, + "target_text_mb": 5, + "actual_text_mb": 5, + "chunk_count": 10000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 14.648, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 4224, + "rebuild_total_ms_avg": 4184, + "hnsw_rebuild_ms_median": 4117, + "hnsw_save_ms_median": 10, + "bm25_rebuild_ms_median": 97, + "rss_peak_mib_median": 306, + "rss_delta_mib_median": 79.6 + }, + { + "profile_label": "10MB_text_500char_384d", + "runs": 5, + "target_text_mb": 10, + "actual_text_mb": 10, + "chunk_count": 20000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 29.297, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 12930, + "rebuild_total_ms_avg": 12529, + "hnsw_rebuild_ms_median": 12703, + "hnsw_save_ms_median": 17, + "bm25_rebuild_ms_median": 194, + "rss_peak_mib_median": 489.5, + "rss_delta_mib_median": 140.2 + }, + { + "profile_label": "25MB_text_500char_384d", + "runs": 5, + "target_text_mb": 25, + "actual_text_mb": 25, + "chunk_count": 50000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 73.242, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 35174, + "rebuild_total_ms_avg": 34426, + "hnsw_rebuild_ms_median": 34626, + "hnsw_save_ms_median": 48, + "bm25_rebuild_ms_median": 507, + "rss_peak_mib_median": 838, + "rss_delta_mib_median": 279.2 + } +] \ No newline at end of file diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/all_profiles.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/all_profiles.jsonl new file mode 100644 index 0000000..2684f06 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/all_profiles.jsonl @@ -0,0 +1,15 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":177.129,"rebuild_total_ms":5309.134,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5192296916,"hnsw_rebuild_count":1,"hnsw_save_nanos":13399000,"hnsw_save_count":1,"bm25_rebuild_nanos":102883375,"bm25_rebuild_count":1,"rss_start_bytes":240566272,"rss_end_bytes":316309504,"rss_peak_bytes":316309504,"rss_delta_bytes":75743232,"rss_samples_bytes":[240566272,315817984,316309504],"rep":1} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":333.402,"rebuild_total_ms":12302.096,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12087793250,"hnsw_rebuild_count":1,"hnsw_save_nanos":17244166,"hnsw_save_count":1,"bm25_rebuild_nanos":196629583,"bm25_rebuild_count":1,"rss_start_bytes":353337344,"rss_end_bytes":481394688,"rss_peak_bytes":481394688,"rss_delta_bytes":128057344,"rss_samples_bytes":[353337344,481394688,481394688],"rep":1} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":801.934,"rebuild_total_ms":33882.854,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":33329495084,"hnsw_rebuild_count":1,"hnsw_save_nanos":45047500,"hnsw_save_count":1,"bm25_rebuild_nanos":507873167,"bm25_rebuild_count":1,"rss_start_bytes":553107456,"rss_end_bytes":794787840,"rss_peak_bytes":794787840,"rss_delta_bytes":241680384,"rss_samples_bytes":[553107456,794771456,794787840],"rep":1} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":177.211,"rebuild_total_ms":4551.919,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4439883625,"hnsw_rebuild_count":1,"hnsw_save_nanos":9000500,"hnsw_save_count":1,"bm25_rebuild_nanos":102610333,"bm25_rebuild_count":1,"rss_start_bytes":239484928,"rss_end_bytes":305856512,"rss_peak_bytes":305856512,"rss_delta_bytes":66371584,"rss_samples_bytes":[239484928,305364992,305856512],"rep":2} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":319.634,"rebuild_total_ms":12335.599,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12125222417,"hnsw_rebuild_count":1,"hnsw_save_nanos":17896625,"hnsw_save_count":1,"bm25_rebuild_nanos":192004750,"bm25_rebuild_count":1,"rss_start_bytes":357154816,"rss_end_bytes":492552192,"rss_peak_bytes":492552192,"rss_delta_bytes":135397376,"rss_samples_bytes":[357154816,492519424,492552192],"rep":2} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":789.245,"rebuild_total_ms":29329.909,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":28775870000,"hnsw_rebuild_count":1,"hnsw_save_nanos":42884083,"hnsw_save_count":1,"bm25_rebuild_nanos":510684333,"bm25_rebuild_count":1,"rss_start_bytes":562216960,"rss_end_bytes":802799616,"rss_peak_bytes":802799616,"rss_delta_bytes":240582656,"rss_samples_bytes":[562216960,802783232,802799616],"rep":2} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":194.309,"rebuild_total_ms":4242.662,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4130705334,"hnsw_rebuild_count":1,"hnsw_save_nanos":10368250,"hnsw_save_count":1,"bm25_rebuild_nanos":101089417,"bm25_rebuild_count":1,"rss_start_bytes":240730112,"rss_end_bytes":315916288,"rss_peak_bytes":315916288,"rss_delta_bytes":75186176,"rss_samples_bytes":[240730112,315375616,315916288],"rep":3} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":337.937,"rebuild_total_ms":9636.011,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":9422767750,"hnsw_rebuild_count":1,"hnsw_save_nanos":18512250,"hnsw_save_count":1,"bm25_rebuild_nanos":194276250,"bm25_rebuild_count":1,"rss_start_bytes":358694912,"rss_end_bytes":485474304,"rss_peak_bytes":485474304,"rss_delta_bytes":126779392,"rss_samples_bytes":[358694912,485474304,485474304],"rep":3} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":777.795,"rebuild_total_ms":29734.774,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":29196927208,"hnsw_rebuild_count":1,"hnsw_save_nanos":44261125,"hnsw_save_count":1,"bm25_rebuild_nanos":493109541,"bm25_rebuild_count":1,"rss_start_bytes":562757632,"rss_end_bytes":805289984,"rss_peak_bytes":805289984,"rss_delta_bytes":242532352,"rss_samples_bytes":[562757632,805273600,805289984],"rep":3} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":171.142,"rebuild_total_ms":3880.898,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3768385959,"hnsw_rebuild_count":1,"hnsw_save_nanos":9928625,"hnsw_save_count":1,"bm25_rebuild_nanos":102009000,"bm25_rebuild_count":1,"rss_start_bytes":239927296,"rss_end_bytes":306544640,"rss_peak_bytes":306544640,"rss_delta_bytes":66617344,"rss_samples_bytes":[239927296,306036736,306544640],"rep":4} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":329.372,"rebuild_total_ms":12763.226,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12551305208,"hnsw_rebuild_count":1,"hnsw_save_nanos":17594334,"hnsw_save_count":1,"bm25_rebuild_nanos":193876833,"bm25_rebuild_count":1,"rss_start_bytes":351748096,"rss_end_bytes":486752256,"rss_peak_bytes":486752256,"rss_delta_bytes":135004160,"rss_samples_bytes":[351748096,486752256,486752256],"rep":4} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":786.647,"rebuild_total_ms":34616.429,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34054323417,"hnsw_rebuild_count":1,"hnsw_save_nanos":55382542,"hnsw_save_count":1,"bm25_rebuild_nanos":506284250,"bm25_rebuild_count":1,"rss_start_bytes":551321600,"rss_end_bytes":793313280,"rss_peak_bytes":793313280,"rss_delta_bytes":241991680,"rss_samples_bytes":[551321600,793280512,793313280],"rep":4} +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5,"target_text_bytes":5000000,"actual_text_mb":5,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":172.859,"rebuild_total_ms":4346.76,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4233222834,"hnsw_rebuild_count":1,"hnsw_save_nanos":9779166,"hnsw_save_count":1,"bm25_rebuild_nanos":103287292,"bm25_rebuild_count":1,"rss_start_bytes":240025600,"rss_end_bytes":306544640,"rss_peak_bytes":306544640,"rss_delta_bytes":66519040,"rss_samples_bytes":[240025600,306020352,306544640],"rep":5} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10,"target_text_bytes":10000000,"actual_text_mb":10,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":331.006,"rebuild_total_ms":11967.263,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":11752323041,"hnsw_rebuild_count":1,"hnsw_save_nanos":18498250,"hnsw_save_count":1,"bm25_rebuild_nanos":195974416,"bm25_rebuild_count":1,"rss_start_bytes":352305152,"rss_end_bytes":480231424,"rss_peak_bytes":480231424,"rss_delta_bytes":127926272,"rss_samples_bytes":[352305152,480231424,480231424],"rep":5} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25,"target_text_bytes":25000000,"actual_text_mb":25,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":790.933,"rebuild_total_ms":35169.462,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34591959542,"hnsw_rebuild_count":1,"hnsw_save_nanos":47963417,"hnsw_save_count":1,"bm25_rebuild_nanos":529092208,"bm25_rebuild_count":1,"rss_start_bytes":553844736,"rss_end_bytes":804110336,"rss_peak_bytes":804110336,"rss_delta_bytes":250265600,"rss_samples_bytes":[553844736,804093952,804110336],"rep":5} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep1.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep1.jsonl new file mode 100644 index 0000000..c60d481 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep1.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":177.129,"rebuild_total_ms":5309.134,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":5192296916,"hnsw_rebuild_count":1,"hnsw_save_nanos":13399000,"hnsw_save_count":1,"bm25_rebuild_nanos":102883375,"bm25_rebuild_count":1,"rss_start_bytes":240566272,"rss_end_bytes":316309504,"rss_peak_bytes":316309504,"rss_delta_bytes":75743232,"rss_samples_bytes":[240566272,315817984,316309504]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":333.402,"rebuild_total_ms":12302.096,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12087793250,"hnsw_rebuild_count":1,"hnsw_save_nanos":17244166,"hnsw_save_count":1,"bm25_rebuild_nanos":196629583,"bm25_rebuild_count":1,"rss_start_bytes":353337344,"rss_end_bytes":481394688,"rss_peak_bytes":481394688,"rss_delta_bytes":128057344,"rss_samples_bytes":[353337344,481394688,481394688]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":801.934,"rebuild_total_ms":33882.854,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":33329495084,"hnsw_rebuild_count":1,"hnsw_save_nanos":45047500,"hnsw_save_count":1,"bm25_rebuild_nanos":507873167,"bm25_rebuild_count":1,"rss_start_bytes":553107456,"rss_end_bytes":794787840,"rss_peak_bytes":794787840,"rss_delta_bytes":241680384,"rss_samples_bytes":[553107456,794771456,794787840]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep2.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep2.jsonl new file mode 100644 index 0000000..d513e80 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep2.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":177.211,"rebuild_total_ms":4551.919,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4439883625,"hnsw_rebuild_count":1,"hnsw_save_nanos":9000500,"hnsw_save_count":1,"bm25_rebuild_nanos":102610333,"bm25_rebuild_count":1,"rss_start_bytes":239484928,"rss_end_bytes":305856512,"rss_peak_bytes":305856512,"rss_delta_bytes":66371584,"rss_samples_bytes":[239484928,305364992,305856512]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":319.634,"rebuild_total_ms":12335.599,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12125222417,"hnsw_rebuild_count":1,"hnsw_save_nanos":17896625,"hnsw_save_count":1,"bm25_rebuild_nanos":192004750,"bm25_rebuild_count":1,"rss_start_bytes":357154816,"rss_end_bytes":492552192,"rss_peak_bytes":492552192,"rss_delta_bytes":135397376,"rss_samples_bytes":[357154816,492519424,492552192]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":789.245,"rebuild_total_ms":29329.909,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":28775870000,"hnsw_rebuild_count":1,"hnsw_save_nanos":42884083,"hnsw_save_count":1,"bm25_rebuild_nanos":510684333,"bm25_rebuild_count":1,"rss_start_bytes":562216960,"rss_end_bytes":802799616,"rss_peak_bytes":802799616,"rss_delta_bytes":240582656,"rss_samples_bytes":[562216960,802783232,802799616]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep3.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep3.jsonl new file mode 100644 index 0000000..4a32421 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep3.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":194.309,"rebuild_total_ms":4242.662,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4130705334,"hnsw_rebuild_count":1,"hnsw_save_nanos":10368250,"hnsw_save_count":1,"bm25_rebuild_nanos":101089417,"bm25_rebuild_count":1,"rss_start_bytes":240730112,"rss_end_bytes":315916288,"rss_peak_bytes":315916288,"rss_delta_bytes":75186176,"rss_samples_bytes":[240730112,315375616,315916288]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":337.937,"rebuild_total_ms":9636.011,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":9422767750,"hnsw_rebuild_count":1,"hnsw_save_nanos":18512250,"hnsw_save_count":1,"bm25_rebuild_nanos":194276250,"bm25_rebuild_count":1,"rss_start_bytes":358694912,"rss_end_bytes":485474304,"rss_peak_bytes":485474304,"rss_delta_bytes":126779392,"rss_samples_bytes":[358694912,485474304,485474304]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":777.795,"rebuild_total_ms":29734.774,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":29196927208,"hnsw_rebuild_count":1,"hnsw_save_nanos":44261125,"hnsw_save_count":1,"bm25_rebuild_nanos":493109541,"bm25_rebuild_count":1,"rss_start_bytes":562757632,"rss_end_bytes":805289984,"rss_peak_bytes":805289984,"rss_delta_bytes":242532352,"rss_samples_bytes":[562757632,805273600,805289984]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep4.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep4.jsonl new file mode 100644 index 0000000..14ad4af --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep4.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":171.142,"rebuild_total_ms":3880.898,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":3768385959,"hnsw_rebuild_count":1,"hnsw_save_nanos":9928625,"hnsw_save_count":1,"bm25_rebuild_nanos":102009000,"bm25_rebuild_count":1,"rss_start_bytes":239927296,"rss_end_bytes":306544640,"rss_peak_bytes":306544640,"rss_delta_bytes":66617344,"rss_samples_bytes":[239927296,306036736,306544640]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":329.372,"rebuild_total_ms":12763.226,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":12551305208,"hnsw_rebuild_count":1,"hnsw_save_nanos":17594334,"hnsw_save_count":1,"bm25_rebuild_nanos":193876833,"bm25_rebuild_count":1,"rss_start_bytes":351748096,"rss_end_bytes":486752256,"rss_peak_bytes":486752256,"rss_delta_bytes":135004160,"rss_samples_bytes":[351748096,486752256,486752256]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":786.647,"rebuild_total_ms":34616.429,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34054323417,"hnsw_rebuild_count":1,"hnsw_save_nanos":55382542,"hnsw_save_count":1,"bm25_rebuild_nanos":506284250,"bm25_rebuild_count":1,"rss_start_bytes":551321600,"rss_end_bytes":793313280,"rss_peak_bytes":793313280,"rss_delta_bytes":241991680,"rss_samples_bytes":[551321600,793280512,793313280]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep5.jsonl b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep5.jsonl new file mode 100644 index 0000000..8968c96 --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/profile_rep5.jsonl @@ -0,0 +1,3 @@ +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":5.0,"target_text_bytes":5000000,"actual_text_mb":5.0,"actual_text_bytes":5000000,"chunk_count":10000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":15360000,"embedding_mib":14.6484375,"seed_ms":172.859,"rebuild_total_ms":4346.76,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":4233222834,"hnsw_rebuild_count":1,"hnsw_save_nanos":9779166,"hnsw_save_count":1,"bm25_rebuild_nanos":103287292,"bm25_rebuild_count":1,"rss_start_bytes":240025600,"rss_end_bytes":306544640,"rss_peak_bytes":306544640,"rss_delta_bytes":66519040,"rss_samples_bytes":[240025600,306020352,306544640]} +{"cell":"indexing_rebuild","profile_label":"10MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":10.0,"target_text_bytes":10000000,"actual_text_mb":10.0,"actual_text_bytes":10000000,"chunk_count":20000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":30720000,"embedding_mib":29.296875,"seed_ms":331.006,"rebuild_total_ms":11967.263,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":11752323041,"hnsw_rebuild_count":1,"hnsw_save_nanos":18498250,"hnsw_save_count":1,"bm25_rebuild_nanos":195974416,"bm25_rebuild_count":1,"rss_start_bytes":352305152,"rss_end_bytes":480231424,"rss_peak_bytes":480231424,"rss_delta_bytes":127926272,"rss_samples_bytes":[352305152,480231424,480231424]} +{"cell":"indexing_rebuild","profile_label":"25MB_text_500char_384d","text_unit":"MB_decimal","target_text_mb":25.0,"target_text_bytes":25000000,"actual_text_mb":25.0,"actual_text_bytes":25000000,"chunk_count":50000,"chunk_text_chars":500,"chunk_overlap_chars":30,"embedding_dim":384,"embedding_bytes":76800000,"embedding_mib":73.2421875,"seed_ms":790.933,"rebuild_total_ms":35169.462,"native_allocator":"system","rust_features":"vector_faer,vector_quant_i8","build_mode":"profile","hnsw_rebuild_nanos":34591959542,"hnsw_rebuild_count":1,"hnsw_save_nanos":47963417,"hnsw_save_count":1,"bm25_rebuild_nanos":529092208,"bm25_rebuild_count":1,"rss_start_bytes":553844736,"rss_end_bytes":804110336,"rss_peak_bytes":804110336,"rss_delta_bytes":250265600,"rss_samples_bytes":[553844736,804093952,804110336]} diff --git a/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/summary_medians.json b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/summary_medians.json new file mode 100644 index 0000000..3cfbcae --- /dev/null +++ b/docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-131507/summary_medians.json @@ -0,0 +1,62 @@ +[ + { + "profile_label": "5MB_text_500char_384d", + "runs": 5, + "target_text_mb": 5, + "actual_text_mb": 5, + "chunk_count": 10000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 14.648, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 4347, + "rebuild_total_ms_avg": 4466, + "hnsw_rebuild_ms_median": 4233, + "hnsw_save_ms_median": 10, + "bm25_rebuild_ms_median": 103, + "rss_peak_mib_median": 292.3, + "rss_delta_mib_median": 63.5, + "activation_ms_median": null + }, + { + "profile_label": "10MB_text_500char_384d", + "runs": 5, + "target_text_mb": 10, + "actual_text_mb": 10, + "chunk_count": 20000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 29.297, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 12302, + "rebuild_total_ms_avg": 11801, + "hnsw_rebuild_ms_median": 12088, + "hnsw_save_ms_median": 18, + "bm25_rebuild_ms_median": 194, + "rss_peak_mib_median": 463, + "rss_delta_mib_median": 122.1, + "activation_ms_median": null + }, + { + "profile_label": "25MB_text_500char_384d", + "runs": 5, + "target_text_mb": 25, + "actual_text_mb": 25, + "chunk_count": 50000, + "chunk_text_chars": 500, + "embedding_dim": 384, + "embedding_mib": 73.242, + "native_allocator": "system", + "rust_features": "vector_faer,vector_quant_i8", + "rebuild_total_ms_median": 33883, + "rebuild_total_ms_avg": 32547, + "hnsw_rebuild_ms_median": 33329, + "hnsw_save_ms_median": 45, + "bm25_rebuild_ms_median": 508, + "rss_peak_mib_median": 765.6, + "rss_delta_mib_median": 230.8, + "activation_ms_median": null + } +] \ No newline at end of file diff --git a/docs/superpowers/plans/2026-06-29-rebuild-streaming-memory-optimization.md b/docs/superpowers/plans/2026-06-29-rebuild-streaming-memory-optimization.md new file mode 100644 index 0000000..9620da4 --- /dev/null +++ b/docs/superpowers/plans/2026-06-29-rebuild-streaming-memory-optimization.md @@ -0,0 +1,666 @@ +# Rebuild Streaming Memory Optimization Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Reduce rebuild peak RSS under the system allocator by removing avoidable full-corpus collections where the target platform proves a win, before doing any further mimalloc default-enable evaluation. + +**Architecture:** Keep `allocator_mimalloc` feature-gated and treat allocator selection as an experiment. HNSW row streaming is platform-gated because realistic system-allocator A/B showed a macOS peak-RSS win but an iPad 10 peak-RSS and runtime regression. BM25 can still proceed as an allocator-independent structural optimization, but each streaming change must be measured against a realistic system-allocator baseline before any mimalloc A/B. Measurement gates compare `system baseline` to the platform-appropriate `system + structural change` first, then optionally compare that result to mimalloc. + +**Tech Stack:** Rust 2021, rusqlite, hnsw_rs 0.3, flutter_rust_bridge 2.11.1, Dart/Flutter integration tests, existing allocator indexing macro. + +--- + +## Scope And File Map + +### Detailed in this plan + +- Modify: `rust_builder/rust/src/api/hnsw_index.rs` + - Add an internal streaming builder that accepts a point-count hint and an iterator of `(i64, Vec)`. + - Keep the existing FRB-compatible `build_hnsw_index(Vec<(i64, Vec)>)` public API by delegating to the streaming builder. + - Add unit tests for empty streaming input and successful streaming build/search. + +- Modify: `rust_builder/rust/src/api/source_rag.rs` + - Keep the source RAG HNSW rebuild collect path as the non-macOS default. + - Use count-then-stream insertion only on macOS by default, or when the `hnsw_streaming_rebuild` Rust feature is explicitly enabled for an experiment. + - Preserve completed-source filtering, i8 dequant fallback behavior, activation metrics, and active collection marking. + +### Kept as connected follow-up work in the same document + +- Modify later: `rust_builder/rust/src/api/bm25_search.rs` + - Add an iterator-based batch helper that holds the write lock once. + - Later reduce tokenizer allocations by building term frequencies directly. + +- Modify later: `rust_builder/rust/src/api/source_rag.rs` + - Replace BM25 rebuild `Vec<(i64, String)>` collection with a row-streaming iterator. + +- Measure later: `example/integration_test/allocator_indexing_measure_test.dart` + - Use the existing realistic macro after the HNSW platform policy lands. + +## Current Baseline Anchors + +- HNSW source rebuild currently materializes all rows at `rust_builder/rust/src/api/source_rag.rs:890`. +- HNSW builder currently requires `Vec<(i64, Vec)>` at `rust_builder/rust/src/api/hnsw_index.rs:56`. +- BM25 source rebuild currently materializes all rows at `rust_builder/rust/src/api/source_rag.rs:970`. +- BM25 tokenization currently allocates `Vec` at `rust_builder/rust/src/api/bm25_search.rs:60` and then clones tokens into a second `HashMap` at `rust_builder/rust/src/api/bm25_search.rs:66`. +- The realistic allocator macro uses 500-char chunks, 30-char overlap metadata, and 384-dim stub embeddings in `example/integration_test/allocator_indexing_measure_test.dart:185`. +- Existing result JSONL files are legacy synthetic allocator-pressure evidence when they report `embedding_dim:32`; they are not enough for a mimalloc default-enable decision. + +## Non-Goals + +- Do not default-enable `allocator_mimalloc`. +- Do not market this as a mimalloc stabilization phase. +- Do not wire SQLite custom allocation to mimalloc. +- Do not tune SQLite `mmap_size`, `cache_size`, `temp_store`, WAL, or checkpoint behavior in this branch. +- Do not change public Dart/FRB API shape for HNSW rebuild. +- Do not remove the legacy `build_hnsw_index(Vec<...>)` entrypoint; tests and simple RAG paths still use it. +- Do not default HNSW streaming on iOS, Android, or unvalidated targets. + +--- + +## Task 1: HNSW Streaming Builder In `hnsw_index.rs` + +**Files:** +- Modify: `rust_builder/rust/src/api/hnsw_index.rs:50-119` +- Test: `rust_builder/rust/src/api/hnsw_index.rs:299-360` + +- [ ] **Step 1: Add failing unit tests for the streaming builder** + +Insert these tests inside `#[cfg(test)] mod tests` in `rust_builder/rust/src/api/hnsw_index.rs`, after `test_build_empty_index`: + +```rust + #[test] + fn test_streaming_build_empty_index() { + clear_hnsw_index(); + + let inserted = build_hnsw_index_streaming(0, std::iter::empty()).unwrap(); + + assert_eq!(inserted, 0); + assert!(!is_hnsw_index_loaded()); + } + + #[test] + fn test_streaming_build_and_search() { + clear_hnsw_index(); + let points: Vec<(i64, Vec)> = (0..100) + .map(|i| (i, make_random_embedding(i as u64, 384))) + .collect(); + + let inserted = build_hnsw_index_streaming(points.len(), points.into_iter()).unwrap(); + + assert_eq!(inserted, 100); + assert!(is_hnsw_index_loaded()); + + let query = make_random_embedding(42, 384); + let results = search_hnsw(query, 5).unwrap(); + assert!(!results.is_empty()); + } +``` + +- [ ] **Step 2: Run the targeted HNSW tests and verify the expected failure** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib hnsw_index::tests::test_streaming_build -- --test-threads=1 +``` + +Expected before implementation: + +```text +error[E0425]: cannot find function `build_hnsw_index_streaming` in this scope +``` + +- [ ] **Step 3: Replace the HNSW build body with a streaming-compatible implementation** + +In `rust_builder/rust/src/api/hnsw_index.rs`, replace the current `pub fn build_hnsw_index(...)` implementation at lines 56-119 with this block: + +```rust +fn hnsw_build_params(count: usize) -> (usize, usize, usize, &'static str) { + if count > 10_000 { + (24, 48, 200, "large (>10K)") + } else if count > 1_000 { + (20, 40, 150, "medium (1K-10K)") + } else { + (16, 32, 100, "small (<1K)") + } +} + +pub(crate) fn build_hnsw_index_streaming( + point_count_hint: usize, + points: I, +) -> anyhow::Result +where + I: IntoIterator)>, +{ + info!( + "[hnsw] Building index with {} point capacity hint", + point_count_hint + ); + + let capacity = point_count_hint.max(1); + let (m, m0, ef_construction, size_category) = hnsw_build_params(capacity); + + #[cfg(debug_assertions)] + { + println!( + "[HNSW] Dataset size hint: {} points ({})", + point_count_hint, size_category + ); + println!( + "[HNSW] Parameters: M={}, M0={}, efConstruction={}", + m, m0, ef_construction + ); + println!( + "[HNSW] Expected recall: ~{}%", + if capacity > 10_000 { + "97" + } else if capacity > 1_000 { + "95" + } else { + "92" + } + ); + } + + debug!( + "[hnsw] Using M={}, M0={}, efConstruction={}", + m, m0, ef_construction + ); + + let hnsw = Hnsw::new(m, capacity, m0, ef_construction, DistCosine); + let mut inserted = 0usize; + + for (id, embedding) in points { + if embedding.is_empty() { + continue; + } + hnsw.insert((&embedding, id as usize)); + inserted += 1; + } + + if inserted == 0 { + warn!("[hnsw] No points provided"); + return Ok(0); + } + + let mut index_guard = HNSW_INDEX.write().unwrap(); + *index_guard = Some(hnsw); + + #[cfg(debug_assertions)] + println!("[HNSW] Index build complete"); + + info!( + "[hnsw] Index build complete (inserted={}, M={}, M0={}, efC={})", + inserted, m, m0, ef_construction + ); + Ok(inserted) +} + +pub fn build_hnsw_index(points: Vec<(i64, Vec)>) -> anyhow::Result<()> { + let point_count = points.len(); + let _ = build_hnsw_index_streaming(point_count, points)?; + Ok(()) +} +``` + +- [ ] **Step 4: Run the targeted HNSW tests and verify they pass** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib hnsw_index::tests::test_streaming_build -- --test-threads=1 +``` + +Expected: + +```text +test api::hnsw_index::tests::test_streaming_build_empty_index ... ok +test api::hnsw_index::tests::test_streaming_build_and_search ... ok +``` + +- [ ] **Step 5: Run existing HNSW regression tests** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib hnsw_index::tests -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +--- + +## Task 2: HNSW Source Rebuild Platform Gate In `source_rag.rs` + +**Files:** +- Modify: `rust_builder/rust/Cargo.toml` +- Modify: `rust_builder/rust/src/api/runtime_info.rs` +- Modify: `rust_builder/rust/src/api/source_rag.rs:23-26` +- Modify: `rust_builder/rust/src/api/source_rag.rs:856-950` +- Test: `rust_builder/rust/src/api/source_rag.rs:2774-2850` +- Test: `rust_builder/rust/src/api/source_rag.rs:3112-3196` + +- [ ] **Step 1: Add a non-default experiment feature** + +Add a Rust feature named `hnsw_streaming_rebuild`. Do not include it in default +features. Add it to native runtime feature reporting so benchmark rows can +distinguish default builds from explicit HNSW streaming experiments. + +- [ ] **Step 2: Add a platform policy helper** + +Default policy: + +```text +macOS: stream HNSW rebuild rows by default. +iOS / Android / other unvalidated targets: keep collect-based rebuild by default. +Explicit experiment: enable Rust feature `hnsw_streaming_rebuild`. +``` + +Add a pure testable helper: + +```rust +fn hnsw_streaming_rebuild_enabled_for_target_os(target_os: &str, force_enabled: bool) -> bool { + force_enabled || target_os == "macos" +} +``` + +- [ ] **Step 3: Route the source rebuild through the platform policy** + +Keep one SQL row iterator and shared embedding decode logic. Route the decoded +rows into `build_hnsw_index_streaming(point_count_hint, points)` only when +`hnsw_streaming_rebuild_enabled()` is true. Otherwise collect filtered points +into `Vec<(i64, Vec)>` and call the legacy `build_hnsw_index(points)` path. + +- [ ] **Step 4: Verify the platform policy test** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib source_rag::tests::test_hnsw_streaming_rebuild_policy -- --test-threads=1 +``` + +Expected: + +```text +test api::source_rag::tests::test_hnsw_streaming_rebuild_policy_is_macos_only_by_default ... ok +``` + +- [ ] **Step 5: Verify source rebuild behavior still filters non-completed sources** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib source_rag::tests::test_completed_filter_excludes_pending_and_failed_sources -- --test-threads=1 +``` + +Expected: + +```text +test api::source_rag::tests::test_completed_filter_excludes_pending_and_failed_sources ... ok +``` + +- [ ] **Step 6: Verify activation metrics still observe one HNSW rebuild** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib activation_metrics -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +- [ ] **Step 7: Run the Rust library test suite under the system allocator** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +- [ ] **Step 8: Run the Rust library test suite with mimalloc still gated** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib --features allocator_mimalloc -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +- [ ] **Step 9: Run the Rust library test suite with the HNSW streaming experiment feature** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib --features hnsw_streaming_rebuild -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +- [ ] **Step 10: Commit the HNSW platform gate change** + +Run: + +```bash +git add rust_builder/rust/Cargo.toml rust_builder/rust/src/api/runtime_info.rs rust_builder/rust/src/api/hnsw_index.rs rust_builder/rust/src/api/source_rag.rs +git commit -m "perf(native): gate hnsw streaming rebuild" +``` + +--- + +## Task 3: HNSW System Allocator Measurement Gate + +**Files:** +- Read: `docs/perf/mimalloc-allocator-ab/README.md` +- Read: `docs/perf/mimalloc-allocator-ab/RESULTS.md` +- Use: `example/integration_test/allocator_indexing_measure_test.dart` +- Update after runs: `docs/perf/mimalloc-allocator-ab/RESULTS.md` + +- [ ] **Step 1: Establish the post-HNSW system allocator run label** + +Use this folder naming convention for system-only validation after a +platform-specific HNSW streaming experiment: + +```text +docs/perf/mimalloc-allocator-ab/runs/-hnsw--system-YYYYMMDD-HHMMSS/ +``` + +Example: + +```text +docs/perf/mimalloc-allocator-ab/runs/macos-hnsw-streaming-system-20260629-140000/ +docs/perf/mimalloc-allocator-ab/runs/ios-ipad10-hnsw-nonstreaming-system-20260629-140000/ +``` + +- [ ] **Step 2: Run the realistic allocator indexing macro under the system allocator** + +Run on a physical device when available. Use macOS as macOS evidence only; do +not generalize it to iOS or Android: + +```bash +cd example +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/allocator_indexing_measure_test.dart \ + --profile -d \ + --dart-define=EXPECTED_NATIVE_ALLOCATOR=system \ + --dart-define=EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8 \ + --dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 +``` + +For an explicit non-macOS HNSW streaming experiment, enable the Rust feature and +include it in `EXPECTED_RUST_FEATURES`: + +```text +vector_faer,vector_quant_i8,hnsw_streaming_rebuild +``` + +Expected row shape: + +```json +{"cell":"indexing_rebuild","profile_label":"5MB_text_500char_384d","embedding_dim":384,"native_allocator":"system"} +``` + +- [ ] **Step 3: Compare against the pre-streaming realistic baseline only if it exists** + +Search for realistic baseline rows: + +```bash +rg -n '"embedding_dim":384|"target_text_mb"|"profile_label"' docs/perf/mimalloc-allocator-ab/runs +``` + +Expected interpretation: + +```text +If no rows are found, record the HNSW streaming run as the first realistic baseline and do not compare it against legacy 32-dim JSONL. +``` + +- [ ] **Step 4: Update RESULTS.md with a system-only structural optimization note** + +Add a section under `## Interpretation`: + +```markdown +### HNSW Streaming Rebuild Platform Gate + +The HNSW rebuild path streams SQLite rows into the native HNSW builder only +where the platform gate allows it. Treat macOS streaming as a platform-specific +structural memory optimization, not allocator adoption evidence and not +mobile-wide evidence. Keep iOS, Android, and unvalidated targets on the +collect-based path unless a dedicated experiment enables +`hnsw_streaming_rebuild`. Compare every claim against a realistic +system-allocator baseline only when both sides use 500-char chunks and 384-dim +embeddings. +``` + +--- + +## Task 4: BM25 Streaming Rebuild Follow-Up + +**Files:** +- Modify later: `rust_builder/rust/src/api/bm25_search.rs:272-287` +- Modify later: `rust_builder/rust/src/api/source_rag.rs:948-987` +- Test later: `rust_builder/rust/src/api/bm25_search.rs:354-443` +- Test later: `rust_builder/rust/src/api/source_rag.rs:3112-3196` + +Implement this only after Task 3 records the system-allocator HNSW streaming gate. + +- [ ] **Step 1: Add an iterator-based BM25 batch helper** + +Target helper shape in `bm25_search.rs`: + +```rust +pub(crate) fn bm25_add_documents_iter(docs: I) -> usize +where + I: IntoIterator, +{ + let mut index = INVERTED_INDEX.write().unwrap(); + let mut added = 0usize; + for (doc_id, content) in docs { + let before = index.len(); + index.add_document(doc_id, &content); + if index.len() != before { + added += 1; + } + } + info!("[bm25] Added {} documents to index", added); + added +} +``` + +Then make the existing FRB-compatible helper delegate to it: + +```rust +pub fn bm25_add_documents(docs: Vec<(i64, String)>) { + let _ = bm25_add_documents_iter(docs); +} +``` + +- [ ] **Step 2: Stream rows in `rebuild_chunk_bm25_index_for_collection_inner`** + +Replace the `docs: Vec<(i64, String)>` collection in `source_rag.rs` with a `query_map` iterator passed to `bm25_add_documents_iter`. + +- [ ] **Step 3: Verify BM25 behavior** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib bm25_search::tests -- --test-threads=1 +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib source_rag::tests::test_completed_filter_excludes_pending_and_failed_sources -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +--- + +## Task 5: BM25 Tokenizer Allocation Follow-Up + +**Files:** +- Modify later: `rust_builder/rust/src/api/bm25_search.rs:55-69` +- Preserve: `rust_builder/rust/src/api/bm25_search.rs:261-270` +- Test later: `rust_builder/rust/src/api/bm25_search.rs:370-443` + +Implement this only after BM25 streaming rebuild is measured under the system allocator. + +- [ ] **Step 1: Add a direct term-frequency helper** + +Target helper shape: + +```rust +fn bm25_term_freqs(text: &str) -> (HashMap, usize) { + use unicode_segmentation::UnicodeSegmentation; + + let mut term_freqs: HashMap = HashMap::new(); + let mut doc_length = 0usize; + for token in text.unicode_words().filter(|s| keep_bm25_token(s)) { + doc_length += 1; + *term_freqs.entry(token.to_lowercase()).or_insert(0) += 1; + } + (term_freqs, doc_length) +} +``` + +- [ ] **Step 2: Use the helper inside `InvertedIndex::add_document`** + +Replace: + +```rust +let tokens = tokenize_for_bm25(content); +let doc_length = tokens.len(); +if doc_length == 0 { + return; +} + +let mut term_freqs: HashMap = HashMap::new(); +for token in &tokens { + *term_freqs.entry(token.clone()).or_insert(0) += 1; +} +``` + +with: + +```rust +let (term_freqs, doc_length) = bm25_term_freqs(content); +if doc_length == 0 { + return; +} +``` + +- [ ] **Step 3: Keep query tokenization stable** + +Do not change `tokenize_for_bm25`; query paths and tests rely on the returned `Vec`. + +- [ ] **Step 4: Verify tokenization and ranking behavior** + +Run: + +```bash +cargo test --manifest-path rust_builder/rust/Cargo.toml --lib bm25_search::tests -- --test-threads=1 +``` + +Expected: + +```text +test result: ok. +``` + +--- + +## Task 6: Final Structural Measurement And Mimalloc A/B + +**Files:** +- Update: `docs/perf/mimalloc-allocator-ab/RESULTS.md` +- Read: `docs/perf/mimalloc-allocator-ab/README.md` +- Use: `example/integration_test/allocator_indexing_measure_test.dart` + +- [ ] **Step 1: Measure `system + HNSW streaming + BM25 streaming + tokenizer reduction`** + +Run: + +```bash +cd example +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/allocator_indexing_measure_test.dart \ + --profile -d \ + --dart-define=EXPECTED_NATIVE_ALLOCATOR=system \ + --dart-define=EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8 \ + --dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 +``` + +- [ ] **Step 2: Measure `mimalloc + streaming` only after system improvement is recorded** + +Run the same macro with the mimalloc native build and expected feature labels: + +```bash +cd example +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/allocator_indexing_measure_test.dart \ + --profile -d \ + --dart-define=EXPECTED_NATIVE_ALLOCATOR=mimalloc \ + --dart-define=EXPECTED_RUST_FEATURES=vector_faer,vector_quant_i8,allocator_mimalloc \ + --dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 +``` + +- [ ] **Step 3: Apply the decision rule** + +Record this exact interpretation in `RESULTS.md`: + +```markdown +If the platform-appropriate structural path lowers peak RSS versus the realistic +system baseline, count that as structural rebuild memory improvement. If +mimalloc on top of that path still raises peak RSS materially, keep mimalloc +opt-in and do not default-enable it. +``` + +--- + +## Linear Tracking Recommendation + +Use the existing Linear project: + +```text +mobile_rag_engine mimalloc allocator validation +``` + +Use the existing Linear document for this plan and track four issues: + +1. `HNSW platform-gated streaming rebuild` +2. `BM25 streaming rebuild without document Vec collect` +3. `Reduce BM25 tokenizer allocation` +4. `Measure platform-gated rebuild changes before mimalloc A/B` + +The first issue should be the only implementation-ready issue immediately. The other three remain sequenced follow-ups so allocator, structure, and SQLite effects do not get mixed. + +## Self-Review + +- Spec coverage: The document keeps all connected memory optimization work in one plan and details only the HNSW implementation path as requested. +- Placeholder scan: No implementation step uses banned placeholder markers or unspecified error handling. +- Platform consistency: HNSW streaming is macOS-default only; non-macOS default rebuilds keep the collect-based path unless the explicit `hnsw_streaming_rebuild` feature is enabled. +- Type consistency: `build_hnsw_index_streaming` returns `anyhow::Result` in streaming tests and source rebuild call sites; the existing `build_hnsw_index(Vec<...>) -> anyhow::Result<()>` API remains intact. diff --git a/example/integration_test/allocator_indexing_measure_test.dart b/example/integration_test/allocator_indexing_measure_test.dart index d946fb0..ebe9a8e 100644 --- a/example/integration_test/allocator_indexing_measure_test.dart +++ b/example/integration_test/allocator_indexing_measure_test.dart @@ -12,6 +12,8 @@ import 'package:mobile_rag_engine/src/rust/api/activation_metrics.dart' as am; // ignore: implementation_imports import 'package:mobile_rag_engine/src/rust/api/db_pool.dart'; // ignore: implementation_imports +import 'package:mobile_rag_engine/src/rust/api/hnsw_index.dart' as hnsw; +// ignore: implementation_imports import 'package:mobile_rag_engine/src/rust/api/runtime_info.dart' as runtime_info; // ignore: implementation_imports @@ -37,7 +39,18 @@ void main() { 'ALLOCATOR_INDEXING_TEXT_MB', defaultValue: '5,10,25', ); + const repeatCount = int.fromEnvironment( + 'ALLOCATOR_INDEXING_REPEATS', + defaultValue: 1, + ); final textCases = _parseTextMbCases(textMbCsv); + if (repeatCount < 1) { + throw ArgumentError.value( + repeatCount, + 'ALLOCATOR_INDEXING_REPEATS', + 'must be positive', + ); + } tearDown(() async { try { @@ -66,108 +79,110 @@ void main() { '${docsDir.path}/allocator_indexing_profile_latest.jsonl', ); if (await exportFile.exists()) await exportFile.delete(); - for (final p in [ - dbStem, - '$dbStem-wal', - '$dbStem-shm', - '$dbStem-journal', - ]) { - final f = File(p); - if (await f.exists()) await f.delete(); - } - await initDbPool(dbPath: dbStem, maxSize: 4); - await rust_rag.initSourceDb(); + for (var repeat = 1; repeat <= repeatCount; repeat++) { + final hnswBasePaths = textCases.map((textCase) { + final collectionId = _collectionId(repeat, textCase); + return '${dbStem}_hnsw_$collectionId'; + }); + await _resetAllocatorMacroDb(dbStem, hnswBasePaths); + await initDbPool(dbPath: dbStem, maxSize: 4); + await rust_rag.initSourceDb(); + + for (final textCase in textCases) { + final collectionId = _collectionId(repeat, textCase); + final basePath = '${dbStem}_hnsw_$collectionId'; + + final seedSw = Stopwatch()..start(); + final source = await rust_rag.addSourceInCollection( + collectionId: collectionId, + content: 'allocator indexing macro ${textCase.label}', + metadata: jsonEncode({ + 'kind': 'allocator_indexing_macro', + 'repeat': repeat, + 'target_text_mb': textCase.targetTextMb, + 'target_text_bytes': textCase.targetTextBytes, + 'actual_text_bytes': textCase.actualTextBytes, + 'chunk_count': textCase.chunkCount, + 'chunk_text_chars': _chunkTextChars, + 'chunk_overlap_chars': _chunkOverlapChars, + 'embedding_dim': _embeddingDim, + }), + name: 'allocator_indexing_r${repeat}_${textCase.id}', + ); + await rust_rag.updateSourceStatus( + sourceId: source.sourceId, + status: 'completed', + ); + await rust_rag.addChunks( + sourceId: source.sourceId, + chunks: _chunks(textCase.chunkCount), + ); + seedSw.stop(); - for (final textCase in textCases) { - final collectionId = 'allocator_indexing_${textCase.id}'; - final basePath = '${dbStem}_hnsw_$collectionId'; + am.resetActivationTimingStats(); + final rss = RssSampler().start(); + final rebuildSw = Stopwatch()..start(); + await rust_rag.rebuildChunkHnswIndexForCollection( + collectionId: collectionId, + ); + rss.sample(); + await rust_rag.saveCollectionHnswIndex( + collectionId: collectionId, + basePath: basePath, + ); + rss.sample(); + await rust_rag.rebuildChunkBm25IndexForCollection( + collectionId: collectionId, + ); + rebuildSw.stop(); + final stats = am.takeActivationTimingStats(); + final rssSummary = rss.finish(); - final seedSw = Stopwatch()..start(); - final source = await rust_rag.addSourceInCollection( - collectionId: collectionId, - content: 'allocator indexing macro ${textCase.label}', - metadata: jsonEncode({ - 'kind': 'allocator_indexing_macro', + final row = { + 'cell': 'indexing_rebuild', + 'profile_label': textCase.label, + 'repeat': repeat, + 'repeat_count': repeatCount, + 'text_unit': 'MB_decimal', 'target_text_mb': textCase.targetTextMb, 'target_text_bytes': textCase.targetTextBytes, + 'actual_text_mb': textCase.actualTextMb, 'actual_text_bytes': textCase.actualTextBytes, 'chunk_count': textCase.chunkCount, 'chunk_text_chars': _chunkTextChars, 'chunk_overlap_chars': _chunkOverlapChars, 'embedding_dim': _embeddingDim, - }), - name: 'allocator_indexing_${textCase.id}', - ); - await rust_rag.updateSourceStatus( - sourceId: source.sourceId, - status: 'completed', - ); - await rust_rag.addChunks( - sourceId: source.sourceId, - chunks: _chunks(textCase.chunkCount), - ); - seedSw.stop(); - - am.resetActivationTimingStats(); - final rss = RssSampler().start(); - final rebuildSw = Stopwatch()..start(); - await rust_rag.rebuildChunkHnswIndexForCollection( - collectionId: collectionId, - ); - rss.sample(); - await rust_rag.saveCollectionHnswIndex( - collectionId: collectionId, - basePath: basePath, - ); - rss.sample(); - await rust_rag.rebuildChunkBm25IndexForCollection( - collectionId: collectionId, - ); - rebuildSw.stop(); - final stats = am.takeActivationTimingStats(); - final rssSummary = rss.finish(); - - final row = { - 'cell': 'indexing_rebuild', - 'profile_label': textCase.label, - 'text_unit': 'MB_decimal', - 'target_text_mb': textCase.targetTextMb, - 'target_text_bytes': textCase.targetTextBytes, - 'actual_text_mb': textCase.actualTextMb, - 'actual_text_bytes': textCase.actualTextBytes, - 'chunk_count': textCase.chunkCount, - 'chunk_text_chars': _chunkTextChars, - 'chunk_overlap_chars': _chunkOverlapChars, - 'embedding_dim': _embeddingDim, - 'embedding_bytes': textCase.embeddingBytes, - 'embedding_mib': textCase.embeddingMiB, - 'seed_ms': seedSw.elapsedMicroseconds / 1000.0, - 'rebuild_total_ms': rebuildSw.elapsedMicroseconds / 1000.0, - 'native_allocator': nativeInfo.nativeAllocator, - 'rust_features': nativeInfo.rustFeatures, - 'build_mode': kReleaseMode - ? 'release' - : (kProfileMode ? 'profile' : 'debug'), - 'hnsw_rebuild_nanos': stats.hnswRebuildNanos.toInt(), - 'hnsw_rebuild_count': stats.hnswRebuildCount.toInt(), - 'hnsw_save_nanos': stats.hnswSaveNanos.toInt(), - 'hnsw_save_count': stats.hnswSaveCount.toInt(), - 'bm25_rebuild_nanos': stats.bm25RebuildNanos.toInt(), - 'bm25_rebuild_count': stats.bm25RebuildCount.toInt(), - ...rssSummary.toJson(prefix: 'rss'), - }; - await exportFile.writeAsString( - '${jsonEncode(row)}\n', - mode: FileMode.append, - flush: true, - ); - // ignore: avoid_print - print('INDEXING_PROFILE ${jsonEncode(row)}'); + 'embedding_bytes': textCase.embeddingBytes, + 'embedding_mib': textCase.embeddingMiB, + 'seed_ms': seedSw.elapsedMicroseconds / 1000.0, + 'rebuild_total_ms': rebuildSw.elapsedMicroseconds / 1000.0, + 'native_allocator': nativeInfo.nativeAllocator, + 'rust_features': nativeInfo.rustFeatures, + 'build_mode': kReleaseMode + ? 'release' + : (kProfileMode ? 'profile' : 'debug'), + 'hnsw_rebuild_nanos': stats.hnswRebuildNanos.toInt(), + 'hnsw_rebuild_count': stats.hnswRebuildCount.toInt(), + 'hnsw_save_nanos': stats.hnswSaveNanos.toInt(), + 'hnsw_save_count': stats.hnswSaveCount.toInt(), + 'bm25_rebuild_nanos': stats.bm25RebuildNanos.toInt(), + 'bm25_rebuild_count': stats.bm25RebuildCount.toInt(), + ...rssSummary.toJson(prefix: 'rss'), + }; + await exportFile.writeAsString( + '${jsonEncode(row)}\n', + mode: FileMode.append, + flush: true, + ); + // ignore: avoid_print + print('INDEXING_PROFILE ${jsonEncode(row)}'); - expect(stats.hnswRebuildCount.toInt(), 1); - expect(stats.hnswSaveCount.toInt(), 1); - expect(stats.bm25RebuildCount.toInt(), 1); + expect(stats.hnswRebuildCount.toInt(), 1); + expect(stats.hnswSaveCount.toInt(), 1); + expect(stats.bm25RebuildCount.toInt(), 1); + } + await closeDbPool(); } // ignore: avoid_print print('INDEXING_PROFILE_EXPORT ${exportFile.path}'); @@ -243,6 +258,7 @@ void _assertProfileMode() { '--driver=test_driver/integration_test.dart ' '--target=integration_test/allocator_indexing_measure_test.dart ' '--dart-define=ALLOCATOR_INDEXING_TEXT_MB=5,10,25 ' + '--dart-define=ALLOCATOR_INDEXING_REPEATS=5 ' '--profile -d \n' 'Detected: kDebugMode=$kDebugMode, kProfileMode=$kProfileMode, ' 'kReleaseMode=$kReleaseMode', @@ -250,6 +266,43 @@ void _assertProfileMode() { } } +String _collectionId(int repeat, _IndexingTextCase textCase) => + 'allocator_indexing_r${repeat}_${textCase.id}'; + +Future _resetAllocatorMacroDb( + String dbStem, + Iterable hnswBasePaths, +) async { + try { + await closeDbPool(); + } catch (_) {} + try { + await hnsw.clearHnswIndex(); + } catch (_) {} + + for (final p in [ + dbStem, + '$dbStem-wal', + '$dbStem-shm', + '$dbStem-journal', + ...hnswBasePaths, + ]) { + await _deletePathIfExists(p); + } +} + +Future _deletePathIfExists(String path) async { + final dir = Directory(path); + if (await dir.exists()) { + await dir.delete(recursive: true); + return; + } + final file = File(path); + if (await file.exists()) { + await file.delete(); + } +} + class _IndexingTextCase { _IndexingTextCase.fromTextMb(this.targetTextMb) : targetTextBytes = (targetTextMb * _bytesPerMb).round(), diff --git a/example/pubspec.lock b/example/pubspec.lock index 81f63bf..1018398 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -237,7 +237,7 @@ packages: path: ".." relative: true source: path - version: "0.19.1" + version: "0.20.0" path: dependency: transitive description: @@ -324,7 +324,7 @@ packages: path: "../rust_builder" relative: true source: path - version: "0.18.4" + version: "0.19.2" sky_engine: dependency: transitive description: flutter diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c1df7e7..564c8f7 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -35,3 +35,12 @@ flutter: uses-material-design: true assets: - assets/ + - assets/corpus/ko/tech/ + - assets/corpus/ko/finance/ + - assets/corpus/ko/support/ + - assets/corpus/ko/policy/ + - assets/corpus/en/tech/ + - assets/corpus/en/finance/ + - assets/corpus/en/support/ + - assets/corpus/en/policy/ + - assets/evalsets/ diff --git a/pubspec.lock b/pubspec.lock index 1ca873e..1d503b5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -484,10 +484,10 @@ packages: dependency: "direct main" description: name: rag_engine_flutter - sha256: ab4d9bcf9e63d5b6a83ffb25a6db9a240caa9b19b18d667d08913d8d293cc645 + sha256: f4f3622f68fc741278365b1fd48eaa017362292d4abb23f05de17a2c40365d77 url: "https://pub.dev" source: hosted - version: "0.18.4" + version: "0.19.2" shelf: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7c30a15..20a97b5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mobile_rag_engine description: Build local/on-device RAG in Flutter with Dart APIs, offline semantic search, HNSW+BM25 hybrid retrieval, and text-layer PDF indexing. -version: 0.19.1 +version: 0.20.0 homepage: https://github.com/dev07060/mobile_rag_engine repository: https://github.com/dev07060/mobile_rag_engine issue_tracker: https://github.com/dev07060/mobile_rag_engine/issues @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter flutter_rust_bridge: ^2.11.1 - rag_engine_flutter: ^0.18.4 + rag_engine_flutter: ^0.19.2 path_provider: ^2.1.5 flutter_onnxruntime: ^1.8.0 freezed_annotation: ^3.1.0 diff --git a/rust_builder/CHANGELOG.md b/rust_builder/CHANGELOG.md index aa73ae6..a34803f 100644 --- a/rust_builder/CHANGELOG.md +++ b/rust_builder/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.19.2 +* **Block-wise Quantization**: + - Implemented block-wise scalar quantization (Q8_0 style) with 32-dimension block sizes. + - Implemented backwards-compatible exact-scan similarity kernel supporting dynamic fallback for legacy 768-byte uniform blobs and new 864-byte packed blobs. +* **HNSW Reconstruction**: + - Re-routed HNSW rebuilding to load original high-precision f32 embeddings directly, resolving the compound distortion loop and restoring semantic recall. + ## 0.18.4 * **PDF extraction UX**: - Preserves the `scanned/image-only` marker for mixed scanned PDFs that also contain page-level extraction failures so host apps can route them to OCR. diff --git a/rust_builder/pubspec.yaml b/rust_builder/pubspec.yaml index 93d1844..6c7a4c5 100644 --- a/rust_builder/pubspec.yaml +++ b/rust_builder/pubspec.yaml @@ -2,7 +2,7 @@ name: rag_engine_flutter description: > Native Rust FFI plugin for mobile_rag_engine. Provides high-performance tokenization and HNSW vector indexing for on-device RAG. -version: 0.18.4 +version: 0.19.2 homepage: https://github.com/dev07060/mobile_rag_engine repository: https://github.com/dev07060/mobile_rag_engine issue_tracker: https://github.com/dev07060/mobile_rag_engine/issues diff --git a/rust_builder/rust/Cargo.toml b/rust_builder/rust/Cargo.toml index eb2796d..755710e 100644 --- a/rust_builder/rust/Cargo.toml +++ b/rust_builder/rust/Cargo.toml @@ -13,6 +13,7 @@ default = [] vector_faer = ["dep:faer"] vector_quant_i8 = [] allocator_mimalloc = ["dep:mimalloc"] +hnsw_streaming_rebuild = [] # Bench-only: exposes a thin `bench_api` re-export of the (otherwise pub(crate)) # vector_math kernels so `benches/` can reach them. Never set in production builds. bench = [] diff --git a/rust_builder/rust/src/api/hybrid_search.rs b/rust_builder/rust/src/api/hybrid_search.rs index feeedaf..81b5034 100644 --- a/rust_builder/rust/src/api/hybrid_search.rs +++ b/rust_builder/rust/src/api/hybrid_search.rs @@ -26,7 +26,7 @@ use crate::api::hnsw_index::{is_hnsw_index_loaded, search_hnsw_slice, HnswSearch use crate::api::query_metrics::record_hybrid_result_content_read; use crate::api::vector_math::{cosine_with_query_norm_f32, decode_f32_embedding, l2_norm_f32}; #[cfg(feature = "vector_quant_i8")] -use crate::api::vector_quant::{cosine_with_query_norm_i8_blob, l2_norm_i8, quantize_f32_to_i8}; +use crate::api::vector_quant::{cosine_with_query_norm_i8_blob, l2_norm_i8, quantize_f32_to_i8, QueryQ8, cosine_similarity_q8}; #[derive(Debug, Clone)] pub struct SearchFilter { @@ -264,6 +264,8 @@ fn compute_hybrid_rrf_scores( let (query_i8, _query_i8_scale) = quantize_f32_to_i8(query_embedding); #[cfg(feature = "vector_quant_i8")] let query_i8_norm = l2_norm_i8(&query_i8); + #[cfg(feature = "vector_quant_i8")] + let query_q8 = QueryQ8::new(query_embedding); let mut scoped_doc_ids = Vec::new(); @@ -277,8 +279,8 @@ fn compute_hybrid_rrf_scores( let _ = &embedding_i8_blob; #[cfg(feature = "vector_quant_i8")] let sim = if let Some(qblob) = embedding_i8_blob.as_deref() { - if qblob.len() == query_i8.len() && query_i8_norm > 0.0 { - cosine_with_query_norm_i8_blob(&query_i8, query_i8_norm, qblob) + if (qblob.len() == query_i8.len() || qblob.len() % 36 == 0) && query_i8_norm > 0.0 { + cosine_similarity_q8(&query_q8, qblob, &query_i8, query_i8_norm) } else if let Some(embedding) = decode_f32_embedding(&embedding_blob) { if embedding.len() != query_embedding.len() { continue; diff --git a/rust_builder/rust/src/api/runtime_info.rs b/rust_builder/rust/src/api/runtime_info.rs index 202492d..3358c78 100644 --- a/rust_builder/rust/src/api/runtime_info.rs +++ b/rust_builder/rust/src/api/runtime_info.rs @@ -10,7 +10,7 @@ pub struct NativeRuntimeInfo { pub fn native_runtime_info() -> NativeRuntimeInfo { NativeRuntimeInfo { native_allocator: native_allocator_label().to_string(), - rust_features: rust_features_label().to_string(), + rust_features: rust_features_label(), } } @@ -22,20 +22,25 @@ fn native_allocator_label() -> &'static str { } } -fn rust_features_label() -> &'static str { - match ( - cfg!(feature = "vector_faer"), - cfg!(feature = "vector_quant_i8"), - cfg!(feature = "allocator_mimalloc"), - ) { - (true, true, true) => "vector_faer,vector_quant_i8,allocator_mimalloc", - (true, true, false) => "vector_faer,vector_quant_i8", - (true, false, true) => "vector_faer,allocator_mimalloc", - (true, false, false) => "vector_faer", - (false, true, true) => "vector_quant_i8,allocator_mimalloc", - (false, true, false) => "vector_quant_i8", - (false, false, true) => "allocator_mimalloc", - (false, false, false) => "default", +fn rust_features_label() -> String { + let mut features = Vec::new(); + if cfg!(feature = "vector_faer") { + features.push("vector_faer"); + } + if cfg!(feature = "vector_quant_i8") { + features.push("vector_quant_i8"); + } + if cfg!(feature = "allocator_mimalloc") { + features.push("allocator_mimalloc"); + } + if cfg!(feature = "hnsw_streaming_rebuild") { + features.push("hnsw_streaming_rebuild"); + } + + if features.is_empty() { + "default".to_string() + } else { + features.join(",") } } @@ -64,4 +69,15 @@ mod tests { assert!(!info.rust_features.contains("allocator_mimalloc")); } } + + #[test] + fn rust_features_label_lists_enabled_hnsw_streaming_feature() { + let info = native_runtime_info(); + + if cfg!(feature = "hnsw_streaming_rebuild") { + assert!(info.rust_features.contains("hnsw_streaming_rebuild")); + } else { + assert!(!info.rust_features.contains("hnsw_streaming_rebuild")); + } + } } diff --git a/rust_builder/rust/src/api/simple_rag.rs b/rust_builder/rust/src/api/simple_rag.rs index 542ce07..5bbac87 100644 --- a/rust_builder/rust/src/api/simple_rag.rs +++ b/rust_builder/rust/src/api/simple_rag.rs @@ -29,7 +29,7 @@ use crate::api::vector_math::{ #[cfg(feature = "vector_quant_i8")] use crate::api::vector_quant::{ cosine_with_query_norm_i8_blob, dequantize_i8_to_f32, i8_vec_from_blob, l2_norm_i8, - quantize_f32_to_i8, quantize_f32_to_u8_blob, + quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, }; use flutter_rust_bridge::frb; use log::{debug, error, info, warn}; @@ -179,27 +179,9 @@ fn rebuild_hnsw_index_internal(conn: &Connection) -> anyhow::Result<()> { let embedding_i8_blob: Option> = row.get(2)?; let embedding_scale: Option = row.get(3)?; - #[cfg(feature = "vector_quant_i8")] - let embedding = if let (Some(qblob), Some(scale)) = - (embedding_i8_blob.as_deref(), embedding_scale) - { - let quantized = i8_vec_from_blob(qblob); - let restored = dequantize_i8_to_f32(&quantized, scale); - if restored.is_empty() { - decode_f32_embedding_or_warn(&embedding_blob, id) - } else { - restored - } - } else { - decode_f32_embedding_or_warn(&embedding_blob, id) - }; - - #[cfg(not(feature = "vector_quant_i8"))] - let embedding = { - let _ = (embedding_i8_blob, embedding_scale); - decode_f32_embedding_or_warn(&embedding_blob, id) - }; - + // Build the HNSW graph using original high-precision f32 embeddings + let _ = (embedding_i8_blob, embedding_scale); + let embedding = decode_f32_embedding_or_warn(&embedding_blob, id); Ok((id, embedding)) })? .filter_map(|r| r.ok()) @@ -425,6 +407,8 @@ fn search_with_linear_scan(query_embedding: Vec, top_k: u32) -> anyhow::Res let (query_i8, _query_i8_scale) = quantize_f32_to_i8(&query_embedding); #[cfg(feature = "vector_quant_i8")] let query_i8_norm = l2_norm_i8(&query_i8); + #[cfg(feature = "vector_quant_i8")] + let query_q8 = QueryQ8::new(&query_embedding); let mut stmt = match conn.prepare("SELECT content, embedding, embedding_i8 FROM docs") { Ok(stmt) => stmt, @@ -445,8 +429,8 @@ fn search_with_linear_scan(query_embedding: Vec, top_k: u32) -> anyhow::Res #[cfg(feature = "vector_quant_i8")] let similarity = if let Some(qblob) = embedding_i8_blob.as_deref() { - if qblob.len() == query_i8.len() && query_i8_norm > 0.0 { - cosine_with_query_norm_i8_blob(&query_i8, query_i8_norm, qblob) + if (qblob.len() == query_i8.len() || qblob.len() % 36 == 0) && query_i8_norm > 0.0 { + cosine_similarity_q8(&query_q8, qblob, &query_i8, query_i8_norm) } else if let Some(embedding_vec) = decode_f32_embedding(&embedding_blob) { if embedding_vec.len() != query_embedding.len() { continue; diff --git a/rust_builder/rust/src/api/source_rag.rs b/rust_builder/rust/src/api/source_rag.rs index 837a009..9582f3e 100644 --- a/rust_builder/rust/src/api/source_rag.rs +++ b/rust_builder/rust/src/api/source_rag.rs @@ -21,8 +21,8 @@ use crate::api::bm25_search::{bm25_add_documents, bm25_clear_index, is_bm25_inde use crate::api::db_pool::get_connection; use crate::api::error::RagError; use crate::api::hnsw_index::{ - build_hnsw_index_streaming, clear_hnsw_index, is_hnsw_index_loaded, load_hnsw_index, - save_hnsw_index, search_hnsw, + build_hnsw_index, build_hnsw_index_streaming, clear_hnsw_index, is_hnsw_index_loaded, + load_hnsw_index, save_hnsw_index, search_hnsw, }; use crate::api::hybrid_search::{search_hybrid_meta_inner, RrfConfig, SearchFilter}; use crate::api::ingest_metrics::{ @@ -39,7 +39,7 @@ use crate::api::vector_math::{ #[cfg(feature = "vector_quant_i8")] use crate::api::vector_quant::{ cosine_with_query_norm_i8_blob, dequantize_i8_to_f32, i8_vec_from_blob, l2_norm_i8, - quantize_f32_to_i8, quantize_f32_to_u8_blob, + quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, }; use crate::frb_generated::RustAutoOpaqueMoi as RustAutoOpaque; use flutter_rust_bridge::frb; @@ -64,6 +64,17 @@ static CJK_OR_HANGUL_RE: Lazy = Lazy::new(|| { .expect("valid cjk regex") }); +fn hnsw_streaming_rebuild_enabled_for_target_os(target_os: &str, force_enabled: bool) -> bool { + force_enabled || target_os == "macos" +} + +fn hnsw_streaming_rebuild_enabled() -> bool { + hnsw_streaming_rebuild_enabled_for_target_os( + std::env::consts::OS, + cfg!(feature = "hnsw_streaming_rebuild"), + ) +} + fn elapsed_nanos_u64(start: Instant) -> u64 { start.elapsed().as_nanos().min(u128::from(u64::MAX)) as u64 } @@ -914,35 +925,37 @@ fn rebuild_chunk_hnsw_index_for_collection_inner(collection_id: String) -> Resul let embedding_i8_blob: Option> = row.get(2)?; let embedding_scale: Option = row.get(3)?; - #[cfg(feature = "vector_quant_i8")] - let embedding = if let (Some(qblob), Some(scale)) = - (embedding_i8_blob.as_deref(), embedding_scale) - { - let quantized = i8_vec_from_blob(qblob); - let restored = dequantize_i8_to_f32(&quantized, scale); - if restored.is_empty() { - decode_f32_embedding_or_warn(&embedding_blob, id) - } else { - restored - } - } else { - decode_f32_embedding_or_warn(&embedding_blob, id) - }; - - #[cfg(not(feature = "vector_quant_i8"))] - let embedding = { - let _ = (embedding_i8_blob, embedding_scale); - decode_f32_embedding_or_warn(&embedding_blob, id) - }; + // Build the HNSW graph using original high-precision f32 embeddings + // to prevent the Compound Distortion Loop and maintain optimal recall. + let _ = (embedding_i8_blob, embedding_scale); + let embedding = decode_f32_embedding_or_warn(&embedding_blob, id); Ok((id, embedding)) }) .map_err(|e| RagError::DatabaseError(e.to_string()))?; - let points = rows - .filter_map(|row| row.ok()) - .filter(|(_, embedding)| !embedding.is_empty()); - let inserted = build_hnsw_index_streaming(point_count_hint, points) - .map_err(|e| RagError::InternalError(e.to_string()))?; + let inserted = if hnsw_streaming_rebuild_enabled() { + info!( + "[rebuild_chunk_hnsw] Using streaming rebuild path for target_os={}", + std::env::consts::OS + ); + let points = rows + .filter_map(|row| row.ok()) + .filter(|(_, embedding)| !embedding.is_empty()); + build_hnsw_index_streaming(point_count_hint, points) + .map_err(|e| RagError::InternalError(e.to_string()))? + } else { + info!( + "[rebuild_chunk_hnsw] Using collect rebuild path for target_os={}", + std::env::consts::OS + ); + let points: Vec<(i64, Vec)> = rows + .filter_map(|row| row.ok()) + .filter(|(_, embedding)| !embedding.is_empty()) + .collect(); + let inserted = points.len(); + build_hnsw_index(points).map_err(|e| RagError::InternalError(e.to_string()))?; + inserted + }; if inserted == 0 { clear_hnsw_index(); @@ -2350,6 +2363,8 @@ fn search_chunks_linear_in_collection( let (query_i8, _query_i8_scale) = quantize_f32_to_i8(&query_embedding); #[cfg(feature = "vector_quant_i8")] let query_i8_norm = l2_norm_i8(&query_i8); + #[cfg(feature = "vector_quant_i8")] + let query_q8 = QueryQ8::new(&query_embedding); let mut stmt = match conn.prepare( "SELECT c.id, c.source_id, c.chunk_index, c.content, COALESCE(c.chunk_type, 'general'), c.embedding, c.embedding_i8, s.metadata @@ -2412,8 +2427,8 @@ fn search_chunks_linear_in_collection( #[cfg(feature = "vector_quant_i8")] let similarity = if let Some(qblob) = embedding_i8_blob.as_deref() { - if qblob.len() == query_i8.len() && query_i8_norm > 0.0 { - cosine_with_query_norm_i8_blob(&query_i8, query_i8_norm, qblob) as f64 + if (qblob.len() == query_i8.len() || qblob.len() % 36 == 0) && query_i8_norm > 0.0 { + cosine_similarity_q8(&query_q8, qblob, &query_i8, query_i8_norm) as f64 } else if let Some(embedding) = decode_f32_embedding(&embedding_blob) { if embedding.len() != query_embedding.len() { continue; @@ -2822,6 +2837,19 @@ mod tests { .expect("failed to init source_rag test tokenizer"); } + #[test] + fn test_hnsw_streaming_rebuild_policy_is_macos_only_by_default() { + assert!(hnsw_streaming_rebuild_enabled_for_target_os("macos", false)); + assert!(!hnsw_streaming_rebuild_enabled_for_target_os("ios", false)); + assert!(!hnsw_streaming_rebuild_enabled_for_target_os( + "android", false + )); + assert!(!hnsw_streaming_rebuild_enabled_for_target_os( + "linux", false + )); + assert!(hnsw_streaming_rebuild_enabled_for_target_os("ios", true)); + } + fn test_search_meta_hook_collection() -> &'static Mutex> { static HOOK_COLLECTION: OnceLock>> = OnceLock::new(); HOOK_COLLECTION.get_or_init(|| Mutex::new(None)) diff --git a/rust_builder/rust/src/api/vector_quant.rs b/rust_builder/rust/src/api/vector_quant.rs index a3e2eb6..b21a8dc 100644 --- a/rust_builder/rust/src/api/vector_quant.rs +++ b/rust_builder/rust/src/api/vector_quant.rs @@ -45,6 +45,32 @@ pub fn i8_blob_from_slice(input: &[i8]) -> Vec { /// [`quantize_f32_to_i8`] plus a byte conversion would otherwise produce. /// Returns the quantized bytes together with the scale used to dequantize /// them later. Behaviour is bit-for-bit equivalent to the older two-step path. +#[cfg(feature = "vector_quant_i8")] +#[inline] +pub fn quantize_f32_to_u8_blob(input: &[f32]) -> (Vec, f32) { + if input.is_empty() { + return (Vec::new(), 1.0); + } + // Packed block-wise quantization format (Q8_0 style): + // 36 bytes per block of 32: 4-byte f32 scale (little-endian) + 32-byte i8 values. + let (quantized, scales) = quantize_f32_to_i8_blockwise(input); + let mut packed = Vec::with_capacity(scales.len() * 4 + quantized.len()); + + for block_idx in 0..scales.len() { + let scale_bytes = scales[block_idx].to_le_bytes(); + packed.extend_from_slice(&scale_bytes); + + let start = block_idx * BLOCK_SIZE; + let end = (start + BLOCK_SIZE).min(quantized.len()); + for i in start..end { + packed.push(quantized[i] as u8); + } + } + // Return the packed blob and a dummy scale of 1.0 + (packed, 1.0) +} + +#[cfg(not(feature = "vector_quant_i8"))] #[inline] pub fn quantize_f32_to_u8_blob(input: &[f32]) -> (Vec, f32) { if input.is_empty() { @@ -126,6 +152,176 @@ pub fn cosine_with_query_norm_i8_blob(query: &[i8], query_norm: f32, target_blob (dot as f32) / (query_norm * (target_sq_sum as f32).sqrt()) } + +const BLOCK_SIZE: usize = 32; + +/// Quantizes an f32 slice into block-wise i8 elements with independent scales (Q8_0 style). +/// Returns the quantized bytes and a list of scales for each block. +pub fn quantize_f32_to_i8_blockwise(input: &[f32]) -> (Vec, Vec) { + if input.is_empty() { + return (Vec::new(), Vec::new()); + } + + let num_blocks = (input.len() + BLOCK_SIZE - 1) / BLOCK_SIZE; + let mut quantized = Vec::with_capacity(input.len()); + let mut scales = Vec::with_capacity(num_blocks); + + for block_idx in 0..num_blocks { + let start = block_idx * BLOCK_SIZE; + let end = (start + BLOCK_SIZE).min(input.len()); + let slice = &input[start..end]; + + let max_abs = slice + .iter() + .fold(0.0f32, |acc, &v| acc.max(v.abs())); + + if max_abs == 0.0 { + quantized.extend(vec![0; slice.len()]); + scales.push(1.0); + } else { + let scale = max_abs / 127.0; + let inv_scale = 1.0 / scale; + for &v in slice { + quantized.push((v * inv_scale).round().clamp(-127.0, 127.0) as i8); + } + scales.push(scale); + } + } + + (quantized, scales) +} + +/// Dequantizes block-wise i8 slice back into f32. +pub fn dequantize_i8_to_f32_blockwise(input: &[i8], scales: &[f32]) -> Vec { + if input.is_empty() || scales.is_empty() { + return Vec::new(); + } + + let mut output = Vec::with_capacity(input.len()); + for (block_idx, scale) in scales.iter().enumerate() { + let start = block_idx * BLOCK_SIZE; + let end = (start + BLOCK_SIZE).min(input.len()); + if start >= input.len() { + break; + } + for i in start..end { + output.push((input[i] as f32) * scale); + } + } + output +} + + +#[derive(Clone, Debug)] +pub struct QueryQ8 { + pub blocks: Vec, + pub scales: Vec, + pub norm: f32, +} + +impl QueryQ8 { + pub fn new(query_f32: &[f32]) -> Self { + if query_f32.is_empty() { + return Self { + blocks: Vec::new(), + scales: Vec::new(), + norm: 0.0, + }; + } + + let (blocks, scales) = quantize_f32_to_i8_blockwise(query_f32); + + let mut sq_sum: f32 = 0.0; + let num_blocks = scales.len(); + for block_idx in 0..num_blocks { + let scale = scales[block_idx]; + let start = block_idx * BLOCK_SIZE; + let end = (start + BLOCK_SIZE).min(blocks.len()); + let mut block_sum = 0i32; + for i in start..end { + let v = blocks[i]; + block_sum += (v as i32) * (v as i32); + } + sq_sum += (block_sum as f32) * scale * scale; + } + + Self { + blocks, + scales, + norm: sq_sum.sqrt(), + } + } +} + +pub fn cosine_similarity_q8( + query_q8: &QueryQ8, + target_blob: &[u8], + legacy_query_i8: &[i8], + legacy_query_norm: f32, +) -> f32 { + // If the target blob size matches legacy uniform (e.g. 768), fallback to legacy cosine similarity. + if target_blob.len() == legacy_query_i8.len() { + return cosine_with_query_norm_i8_blob(legacy_query_i8, legacy_query_norm, target_blob); + } + + // Otherwise, parse the packed block-wise binary format. + // Each block is 36 bytes: 4-byte f32 scale (LE) + 32-byte i8 values. + if target_blob.len() % 36 != 0 || query_q8.blocks.is_empty() { + return 0.0; + } + + let num_blocks = target_blob.len() / 36; + let mut dot_weighted: f32 = 0.0; + let mut target_sq_sum: f32 = 0.0; + + for block_idx in 0..num_blocks { + let block_start = block_idx * 36; + if block_start + 4 > target_blob.len() { + break; + } + // 1. Read f32 scale + let mut scale_bytes = [0u8; 4]; + scale_bytes.copy_from_slice(&target_blob[block_start..block_start + 4]); + let target_scale = f32::from_le_bytes(scale_bytes); + + let query_scale = if block_idx < query_q8.scales.len() { + query_q8.scales[block_idx] + } else { + 1.0 + }; + + // 2. Compute integer dot product and squared sum for this block + let mut block_dot = 0i32; + let mut block_target_sq = 0i32; + + let start = block_idx * BLOCK_SIZE; + + for i in 0..32 { + let q_idx = start + i; + if q_idx >= query_q8.blocks.len() { + break; + } + let q = query_q8.blocks[q_idx]; + let t = target_blob[block_start + 4 + i] as i8; + + block_dot += (q as i32) * (t as i32); + block_target_sq += (t as i32) * (t as i32); + } + + dot_weighted += (block_dot as f32) * query_scale * target_scale; + target_sq_sum += (block_target_sq as f32) * target_scale * target_scale; + } + + let query_norm = query_q8.norm; + let target_norm = target_sq_sum.sqrt(); + + if query_norm == 0.0 || target_norm == 0.0 { + return 0.0; + } + + dot_weighted / (query_norm * target_norm) +} + #[cfg(test)] mod tests { use super::*; @@ -414,4 +610,81 @@ mod tests { "i8 cosine fidelity regressed: max err {max_err} > {MAX_COS_ERR}" ); } + + #[test] + fn blockwise_quantize_dequantize_roundtrip() { + // Create an input vector with some outliers in a specific block + let mut input = vec![0.0f32; 100]; + // Block 0: small values + for i in 0..32 { + input[i] = 0.05 * (i as f32 / 32.0); + } + // Block 1: huge values (outliers) + for i in 32..64 { + input[i] = 10.0 * (i as f32 / 64.0); + } + // Block 2: mid values + for i in 64..96 { + input[i] = 1.0 * (i as f32 / 96.0); + } + + let (q, scales) = quantize_f32_to_i8_blockwise(&input); + assert_eq!(q.len(), input.len()); + assert_eq!(scales.len(), 4); // 100 elements / 32 block size = 4 blocks + + let restored = dequantize_i8_to_f32_blockwise(&q, &scales); + assert_eq!(restored.len(), input.len()); + + // Check that quantization error in block 0 is small despite the large outlier in block 1 + for i in 0..32 { + let err = (input[i] - restored[i]).abs(); + // With block-wise, block 0 scale is around 0.05/127 ~ 0.0004. Error should be very small. + assert!(err < 0.001, "Block 0 index {}: original={}, restored={}, err={}", i, input[i], restored[i], err); + } + + // Verify with global quantization, the error in block 0 would be much larger + let (global_q, global_scale) = quantize_f32_to_i8(&input); + let global_restored = dequantize_i8_to_f32(&global_q, global_scale); + let mut global_max_err_block0 = 0.0f32; + for i in 0..32 { + global_max_err_block0 = global_max_err_block0.max((input[i] - global_restored[i]).abs()); + } + // Global scale is around 10.0/127 ~ 0.08. Maximum quantization error can be up to 0.04. + println!("Block-wise block 0 max error: {}", (0..32).map(|i| (input[i] - restored[i]).abs()).fold(0.0f32, f32::max)); + println!("Global block 0 max error: {}", global_max_err_block0); + assert!(global_max_err_block0 > 0.01); + } + + #[test] + fn test_blockwise_cosine_similarity() { + // Create two 768-dim vectors with different patterns and outliers + let mut a = vec![0.0f32; 768]; + let mut b = vec![0.0f32; 768]; + for i in 0..768 { + a[i] = 0.1 * (i as f32).sin(); + b[i] = 0.15 * (i as f32).cos(); + } + // Introduce massive outliers in block 5 + for i in 160..192 { + a[i] *= 25.0; + b[i] *= 20.0; + } + + let true_cos = cosine_with_query_norm_f32(&a, l2_norm_f32(&a), &b); + + let query_q8 = QueryQ8::new(&a); + let (packed_blob_b, _) = quantize_f32_to_u8_blob(&b); + + // For legacy comparison fallback + let (legacy_q_a, _) = quantize_f32_to_i8(&a); + let legacy_norm_a = l2_norm_i8(&legacy_q_a); + + let approx_cos = cosine_similarity_q8(&query_q8, &packed_blob_b, &legacy_q_a, legacy_norm_a); + + println!("True f32 cosine: {}", true_cos); + println!("Block-wise approx cosine: {}", approx_cos); + + let err = (true_cos - approx_cos).abs(); + assert!(err < 0.005, "Block-wise cosine error too large: {} (true={}, approx={})", err, true_cos, approx_cos); + } } From 7f838a058c059ad8fc71c479728bea8160807a52 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Sat, 4 Jul 2026 01:01:40 +0900 Subject: [PATCH 6/8] fix(native): resolve CI test compile errors and remove unused imports --- rust_builder/rust/src/api/hybrid_search.rs | 2 +- rust_builder/rust/src/api/simple_rag.rs | 3 +-- rust_builder/rust/src/api/source_rag.rs | 3 +-- rust_builder/rust/src/api/vector_quant.rs | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust_builder/rust/src/api/hybrid_search.rs b/rust_builder/rust/src/api/hybrid_search.rs index 81b5034..6b63326 100644 --- a/rust_builder/rust/src/api/hybrid_search.rs +++ b/rust_builder/rust/src/api/hybrid_search.rs @@ -26,7 +26,7 @@ use crate::api::hnsw_index::{is_hnsw_index_loaded, search_hnsw_slice, HnswSearch use crate::api::query_metrics::record_hybrid_result_content_read; use crate::api::vector_math::{cosine_with_query_norm_f32, decode_f32_embedding, l2_norm_f32}; #[cfg(feature = "vector_quant_i8")] -use crate::api::vector_quant::{cosine_with_query_norm_i8_blob, l2_norm_i8, quantize_f32_to_i8, QueryQ8, cosine_similarity_q8}; +use crate::api::vector_quant::{l2_norm_i8, quantize_f32_to_i8, QueryQ8, cosine_similarity_q8}; #[derive(Debug, Clone)] pub struct SearchFilter { diff --git a/rust_builder/rust/src/api/simple_rag.rs b/rust_builder/rust/src/api/simple_rag.rs index 5bbac87..2913313 100644 --- a/rust_builder/rust/src/api/simple_rag.rs +++ b/rust_builder/rust/src/api/simple_rag.rs @@ -28,8 +28,7 @@ use crate::api::vector_math::{ }; #[cfg(feature = "vector_quant_i8")] use crate::api::vector_quant::{ - cosine_with_query_norm_i8_blob, dequantize_i8_to_f32, i8_vec_from_blob, l2_norm_i8, - quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, + l2_norm_i8, quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, }; use flutter_rust_bridge::frb; use log::{debug, error, info, warn}; diff --git a/rust_builder/rust/src/api/source_rag.rs b/rust_builder/rust/src/api/source_rag.rs index 9582f3e..c610f03 100644 --- a/rust_builder/rust/src/api/source_rag.rs +++ b/rust_builder/rust/src/api/source_rag.rs @@ -38,8 +38,7 @@ use crate::api::vector_math::{ }; #[cfg(feature = "vector_quant_i8")] use crate::api::vector_quant::{ - cosine_with_query_norm_i8_blob, dequantize_i8_to_f32, i8_vec_from_blob, l2_norm_i8, - quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, + l2_norm_i8, quantize_f32_to_i8, quantize_f32_to_u8_blob, QueryQ8, cosine_similarity_q8, }; use crate::frb_generated::RustAutoOpaqueMoi as RustAutoOpaque; use flutter_rust_bridge::frb; diff --git a/rust_builder/rust/src/api/vector_quant.rs b/rust_builder/rust/src/api/vector_quant.rs index b21a8dc..76a5dfa 100644 --- a/rust_builder/rust/src/api/vector_quant.rs +++ b/rust_builder/rust/src/api/vector_quant.rs @@ -94,6 +94,7 @@ pub fn quantize_f32_to_u8_blob(input: &[f32]) -> (Vec, f32) { (blob, scale) } +#[allow(dead_code)] #[inline] pub fn i8_vec_from_blob(blob: &[u8]) -> Vec { blob.iter().map(|v| *v as i8).collect() @@ -325,6 +326,7 @@ pub fn cosine_similarity_q8( #[cfg(test)] mod tests { use super::*; + use crate::api::vector_math::{cosine_with_query_norm_f32, l2_norm_f32}; #[test] fn quantize_dequantize_roundtrip_reasonable_error() { From 09e488eeb2d203d909fe762bd44c5935ad34599e Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Sat, 4 Jul 2026 01:07:38 +0900 Subject: [PATCH 7/8] test(native): fix quantize_f32_to_u8_blob_matches_two_step_pipeline for vector_quant_i8 feature --- rust_builder/rust/src/api/vector_quant.rs | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/rust_builder/rust/src/api/vector_quant.rs b/rust_builder/rust/src/api/vector_quant.rs index 76a5dfa..e08c481 100644 --- a/rust_builder/rust/src/api/vector_quant.rs +++ b/rust_builder/rust/src/api/vector_quant.rs @@ -377,7 +377,7 @@ mod tests { fn quantize_f32_to_u8_blob_matches_two_step_pipeline() { // The direct blob path skips an intermediate Vec; the // resulting bytes and scale must be bit-for-bit identical to - // quantize_f32_to_i8 + i8_blob_from_slice. + // the manual two-step process. let inputs: &[&[f32]] = &[ &[], &[0.0], @@ -385,6 +385,7 @@ mod tests { &[-3.4, 0.0, 3.4, -1.7, 1.7], ]; + #[cfg(not(feature = "vector_quant_i8"))] for input in inputs { let (direct_blob, direct_scale) = quantize_f32_to_u8_blob(input); let (i8_vec, two_step_scale) = quantize_f32_to_i8(input); @@ -392,6 +393,27 @@ mod tests { assert_eq!(direct_scale, two_step_scale); assert_eq!(direct_blob, two_step_blob); } + + #[cfg(feature = "vector_quant_i8")] + for input in inputs { + let (direct_blob, direct_scale) = quantize_f32_to_u8_blob(input); + assert_eq!(direct_scale, 1.0); + if input.is_empty() { + assert!(direct_blob.is_empty()); + continue; + } + let (quantized, scales) = quantize_f32_to_i8_blockwise(input); + let mut two_step_blob = Vec::new(); + for block_idx in 0..scales.len() { + two_step_blob.extend_from_slice(&scales[block_idx].to_le_bytes()); + let start = block_idx * BLOCK_SIZE; + let end = (start + BLOCK_SIZE).min(quantized.len()); + for i in start..end { + two_step_blob.push(quantized[i] as u8); + } + } + assert_eq!(direct_blob, two_step_blob); + } } // --- PR6 shared test helpers (deterministic, no rand dep) --- From 4717e6bad452092e7a1332cc67eb62293764a198 Mon Sep 17 00:00:00 2001 From: "Brian.oh" <49855381+dev07060@users.noreply.github.com> Date: Sat, 4 Jul 2026 01:21:37 +0900 Subject: [PATCH 8/8] fix(test): initialize Rust library in mobile_rag_vector_store_test and export bench APIs --- rust_builder/rust/src/api/vector_quant.rs | 2 ++ rust_builder/rust/src/bench_api.rs | 9 +++++++++ test/native/mobile_rag_vector_store_test.dart | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/rust_builder/rust/src/api/vector_quant.rs b/rust_builder/rust/src/api/vector_quant.rs index e08c481..3f9785a 100644 --- a/rust_builder/rust/src/api/vector_quant.rs +++ b/rust_builder/rust/src/api/vector_quant.rs @@ -26,6 +26,7 @@ pub fn quantize_f32_to_i8(input: &[f32]) -> (Vec, f32) { (quantized, scale) } +#[allow(dead_code)] #[inline] pub fn dequantize_i8_to_f32(input: &[i8], scale: f32) -> Vec { if input.is_empty() { @@ -193,6 +194,7 @@ pub fn quantize_f32_to_i8_blockwise(input: &[f32]) -> (Vec, Vec) { } /// Dequantizes block-wise i8 slice back into f32. +#[allow(dead_code)] pub fn dequantize_i8_to_f32_blockwise(input: &[i8], scales: &[f32]) -> Vec { if input.is_empty() || scales.is_empty() { return Vec::new(); diff --git a/rust_builder/rust/src/bench_api.rs b/rust_builder/rust/src/bench_api.rs index 33c4c2d..2896dcc 100644 --- a/rust_builder/rust/src/bench_api.rs +++ b/rust_builder/rust/src/bench_api.rs @@ -58,6 +58,15 @@ pub fn cosine_with_query_norm_i8_blob(query: &[i8], query_norm: f32, target_blob vector_quant::cosine_with_query_norm_i8_blob(query, query_norm, target_blob) } +#[cfg(feature = "vector_quant_i8")] +#[inline] +pub fn quantize_f32_to_i8_blockwise(input: &[f32]) -> (Vec, Vec) { + vector_quant::quantize_f32_to_i8_blockwise(input) +} + +#[cfg(feature = "vector_quant_i8")] +pub use crate::api::vector_quant::{QueryQ8, cosine_similarity_q8}; + /// Which backend this build compiled (for labelling bench output). pub const BACKEND: &str = if cfg!(feature = "vector_faer") { "faer" diff --git a/test/native/mobile_rag_vector_store_test.dart b/test/native/mobile_rag_vector_store_test.dart index f395ded..898193a 100644 --- a/test/native/mobile_rag_vector_store_test.dart +++ b/test/native/mobile_rag_vector_store_test.dart @@ -2,8 +2,13 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:mobile_rag_engine/mobile_rag_engine.dart'; +import 'package:mobile_rag_engine/src/rust/frb_generated.dart'; void main() { + setUpAll(() async { + await RustLib.init(); + }); + test('MobileRagVectorStore stores and searches precomputed embeddings', () async { final dir = await Directory.systemTemp.createTemp(