Installation and compatibility
0.9.2-beta.1 is a public prerelease based on 0.9.1. Rust Embedded Core implements storage, transactions, queries, recovery and lifecycle semantics for Python, Node, CLI and Server callers. Server and WebUI retain their nightly development channel.
| Artifact | Version and channel |
|---|---|
| Rust crate, CLI and Server source | 0.9.2-beta.1 |
| Python / PyPI | 0.9.2b1, Python 3.9–3.12 |
| Node.js / npm | 0.9.2-beta.1, beta channel |
| Git tag | v0.9.2-beta.1, bound to its validated commit |
| Disk admission | Main format 15, WAL 7, the unified .idx container and current component layouts |
cargo add [email protected]
pip install "triviumdb==0.9.2b1"
npm install [email protected]Before upgrading, retain a complete file-group backup and stop holders of the source database. Use the external migration tool from the same release checkout to create a new destination directory. Open the migrated destination directly with the current SDK on subsequent uses. The tool accepts source main formats 5–15 under the conditions in the migration guide.
cargo build --locked --manifest-path crates/triviumdb-migrate/Cargo.toml --target-dir target/migration
python scripts/migrate.py --source /data/old.tdb --destination /data/current --check
python scripts/migrate.py --source /data/old.tdb --destination /data/current --executeMigration guidance Ordinary SDK opens return
TDB_MIGRATION_REQUIREDfor historical formats. Older applications use the retained source or pre-upgrade backup. The destination'sdatabase.tdb,.idxand associated files form a complete database. Use snapshot APIs for backups and distribution.
Search thresholds and exact-recall entry points
- Rust
SearchConfigand the Python/Node basic, batch, grouped, contextual, advanced and hybrid search entry points now defaultmin_score/minScoreto0.0. Basic and batch methods previously used0.5, while the other configurable entry points used0.1. Default searches include zero and low positive scores. Set a negative threshold explicitly to include negative cosine scores. - Rust adds
SearchConfig::with_exact(bool). Python search methods accept a keyword-onlyexactargument. Node positional methods append an optionalexactargument, while advanced and contextual configurations accept anexactfield. All adapters reuse the existing coreforce_brute_forceroute. Exact requests skip automatic QuIVer construction and scan the original stored vectors with existing ANN indexes or compressed runtime configurations. - Exact recall preserves Payload filtering, stable tie-breaking, Top-K, batch completion, budgets and cancellation. Subsequent text, graph and Hook processing follows the supplied configuration. Existing force-scan options remain available on the Python/Node advanced entry points, with either enabled flag selecting exact recall. Public declarations, the SDK inventory and API examples are updated. Shared cases cover low positive and zero scores, negative thresholds, filtering, Top-K ties, reopening and existing-index routing.
- The Chinese and English READMEs and the QuIVer guide now describe ANN applicability and the published coverage of mainstream semantic embeddings, with exact-search entry points for randomly synthesized vectors, handcrafted features and traditional non-negative descriptors. Cross-model retrieval, cross-modal retrieval and custom vector transformations are evaluated for their actual tasks.
SDK inventory, external migration and current-format admission
- Ordinary opens acquire an existing coordination lease before checking mutable WAL and index-component headers. Competing reader or writer opens return
TDB_DATABASE_LOCKEDwhile shutdown or checkpoint cleanup truncates the WAL. Historical sources without a coordination file are rejected before creating one, preserving source bytes; admission probes the lease again if a Writer appears during the first check. Request accounting uses the standard library'stry_updatename with the same atomic saturating semantics. Historical release fixtures retain their original checkout bytes and provenance digests on Windows. - The SDK inventory records supported Rust application interfaces and kernel boundaries, Python/Node declarations, TQL and JSON protocols, errors and lifecycle semantics.
1.0.0-beta.1targets the SDK freeze, and1.0.0adds the supported kernel contract freeze. - Production internals and current-format tests use responsibility-based names, with Hook stage dispatch named
invoke_stage. The main-file reader and CLI compare a single current-format identity directly, and storage diagnostics report that same identity as the minimum format. Disk-format fields and published FFI symbols follow their persistence and plugin contracts. - Ordinary opens accept only main format 15, WAL 7, the unified index container and current component layouts. Admission runs before coordination files are created and again under the lease. Historical identities return
TDB_MIGRATION_REQUIREDwithcomponent,found,currentandmigration_entrypoint. Current-format WAL and interrupted-publication recovery remain kernel responsibilities. scripts/migrate.pyinvokes a native tool in a separate workspace. Its source recovery backend owns independent source code and transfers logical facts to the current kernel, which writes the destination. Production module assembly maintains the current format. The tool accepts main formats 5–15, all three dtypes and Rom/Mmap. Complete node, vector-bit, Payload, edge-metadata, text, index-definition, document, named-graph and receipt facts are compared before a new directory is published. Ambiguous historical ordinary composite-index field lists are rejected.- Plain documents, parsed documents and fragment tags share document schema 2 in destination main format 15. External migration upgrades schema 1 while retaining document identity, ranges, revisions, business fields, unique constraints and persistent receipts. Formats 5–9 identify dtype through exact vector geometry. Legacy empty checkpoints require
--source-dtype f32/f16/u64, withTDB_MIGRATION_DTYPE_REQUIREDfor missing confirmation. - Tool identity advances to
tdb-migrate-2with orchestration protocol 1. Source and destination use separate staging subdirectories. Database reads require a complete.idxcontainer. Current standalone SSD artifacts and property sidecars retain explicit read/write entry points, and kernel publication manages current staging components. - Check mode requires an existing source lock and preserves source files. Execute mode may create coordination locks while preserving source data. The tool enforces source/destination leases, digest validation, resource admission, ownership and atomic directory publication. A confirmation marker remains until verification finishes; the same command retries after interruption, and post-publication errors report the commit outcome.
- Every QVSSD codec uses envelope 2. Migration preserves complete vectors and removes old compressed caches; hosts configure encoding and cache budgets again. Source snapshot manifests remain at the source. Destinations are ordinary databases; use the current SDK to publish a new snapshot for Immutable distribution.
- Independent fixtures generated from immutable
v0.9.0source cover three dtypes, Rom/Mmap and checkpoint/confirmed-WAL states; fixtures from originalv0.9.1source add parsed documents, source mappings, named graphs and persistent receipts. Acceptance verifies full contents, reopening, uncommitted transactions and torn WAL tails, source preservation, rejection, budgets, leases and retry after process exit before and after publication. Cross-platform commands are added to CI. - Existing fixtures from historical native wheels now verify external migration for format 11/WAL 4 and format 12/WAL 5, with per-file provenance digest checks. All three dtypes migrate into Rom and Mmap targets, preserving default and named graphs, revisions, historical receipt status and idempotent retry of the original command. Subsequent writes verify automatic IDs and unique constraints. The script entry point covers check, publication and same-source retry for both formats.
cargo build --locked --manifest-path crates/triviumdb-migrate/Cargo.toml --target-dir target/migration
python scripts/migrate.py --source /data/old.tdb --destination /data/current --check
python scripts/migrate.py --source /data/old.tdb --destination /data/current --executeMigration note Stop source holders and keep a complete backup. The destination is a new directory containing
database.tdb. See the migration guide for supported sources, resource options and confirmation retries. Platform acceptance depends on CI for the corresponding commit.
Production naming and research isolation
QuIVer::batch_buildis the production batch constructor, using the parallel construction, deferred reverse pruning and connectivity protection previously selected by the database. Historical serial, append and checked comparison builders move out of the production library; individual updates retain the existing incremental API. The research-onlyTRIVIUM_EAGER_PRUNEand historical builder-selection switches retire with those comparisons.- SM queries live in
index::quiver::sm, with snapshots represented bySmIndex.search,search_tracedandsearch_with_vectorsselect the production dispatch automatically and no longer takeSmSearchMode. The independent scalar reference is available only to internal correctness tests. Research graph import/export and the serial research builder are preserved in frozen snapshots. - Compressed hot/SSD execution uses
index::quiver::runtime::{QuiverRuntime, QuiverRuntimeOptions, QuiverArtifactOptions, QuiverRuntimeStats}, replacingSsdQuiver,SsdRuntimeOptions,SsdOptionsandSsdStatsfrom the formerssdmodule. Database and typed Reader calls useconfigure_quiver,search_quiver,quiver_statsandclose_quiver; the INT8 aliases are removed. Centered INT4/INT8, query precision, cache budgets and residency switching retain their configuration semantics. - The TSNG research module, root exports, Database/Reader comparison APIs and dedicated dual-queue navigation leave the production SDK. Related research cases and ablation benchmarks are retained with the source snapshot. TQL/Planner and the existing search APIs remain the application query paths, and document ANN retains its custom scoring interface. EXPLAIN renames
industrial_access_pathtovector_access_path, retaining its values and planning behavior alongside the existing structuredaccess_path. Cargo'sablationfeature is removed, research directories are excluded from release packages, and the existing ICDE archive retains its original content. - Deployment diagnostics retain
TRIVIUM_NO_AVX512,TRIVIUM_DISABLE_384_KERNELand construction profiling throughTRIVIUM_BUILD_PROFILE. Hardware dispatch, scalar fallback, supported dimensions andtest-hooksfault verification remain maintained.
Caller guidance These API changes precede the SDK freeze. Update Rust imports and call arguments using the mapping above, and read
vector_access_pathin EXPLAIN consumers across languages. Python/Node public methods, compressed-runtime JSON fields and declarations retain their contracts. Naming changes retain default algorithm parameters; current-format admission and migration are described above.
Unified index container and acceptance scope
- Main-file format 15 stores a persistent database identity and a fresh checkpoint identifier for each publication. The
.idxcontainer binds to the main file through its length, CRC and both identities, rejecting containers from another database or an older checkpoint of the same database. QuIVer, registered text and keywords, property index definitions, graph directories and optional compressed reranking artifacts share this container; successful checkpoint cleanup removes staging components. See the file-group specification. - The container uses a fixed directory, component CRCs and 64 KiB aligned ranges. Property and graph indexes map their component ranges directly; SSD reads include the component base offset. Existing readers finish through retained file handles. Publication recovery, snapshots and CLI export protection share the artifact catalog. Snapshots include published SSD components.
- Missing containers, identity mismatches and invalid directories produce structured errors. Corrupted registered text or property index definitions remain intact on disk and cause incomplete loading to be rejected. Explicit text rebuilding accepts complete replacement content from the host. Reopening with a committed journal awaiting cleanup validates the complete container and its components first; corruption preserves recovery journals, backups, and staging components.
- Tests requiring automatic historical disk-format upgrades in the normal engine are removed. Historical fixtures remain available; current-format round trips, corruption rejection, transaction recovery, physical read-only behavior and resource release remain in scope. Python and Node text contracts now exercise current-format rebuilding and reopening. Test cleanup covers the container, and fault matrices include container write, sync and replacement failures.
Usage note The development engine writes the new format, which older engines cannot open. Publication rewrites the complete container and requires space for staging components, the candidate container and previous-generation backups. Use snapshot APIs for complete database backups.
CLI JSONL data correctness
- Exports read original vector dtypes in ascending node-ID order. u64 components retain their complete bit patterns as unsigned JSON integers, and f32/f16 retain their corresponding numeric values. Each edge includes
target,label,weight, andmetadata. - Export checks the main database and associated artifact name families before opening the database, covering
.text/.text.meta, Payload generations, publication journals, and QuIVer SSD artifacts. File identity checks detect path aliases. Output is staged and synchronized before atomically replacing the independent export destination. - Parsing buffers vectors in the target dtype's native representation. All nodes and edges in the complete JSONL file commit through one Core transaction. Validation failures involving dimensions, duplicate IDs, invalid components, or missing edge endpoints reject the whole request with a nonzero exit status, preserving existing records and WAL contents.
- Transactions resolve automatically assigned source IDs by insert ordinal, supporting mixed explicit/automatic IDs, ID high-water marks retained after deletion, and edges targeting later records in the same batch. Rust
upsert_edge_from_insert()and the ConsolelinkFromInsertrequest shared by Rust/Python/Node use this capability. Persistence continues to use existing Insert/Link WAL records. - u64 JSONL imports require unsigned integer literals within range and reject floating-point and exponent notation to avoid rounding integer bit patterns during JSON parsing. Missing edge
metadatadefaults tonull, preserving support for existing JSONL records that omit it.
Data exchange note Regenerate u64 JSONL files rounded through f32 by an older exporter from the original database or a complete backup. Full database backups use snapshots to retain document bodies, named graphs, registered text, and index definitions.
Edge version invalidation and cognitive numeric boundaries
- Server node deletion and batch deletion collect actual incoming and outgoing edges across all labels, updating edge and endpoint versions after successful commit. Unlabeled
unlinkupdates versions from stored edges, including edges persisted before Server startup. Transactions carrying stale edge ETags return409 TDB_HTTP_PRECONDITION_FAILEDwithlegacyCode=WRITE_CONFLICT. Failed transactions retain their previous versions, and unrelated edges retain their ETags. - DPP jointly rescales its quality kernel and regularization in log space, with an
f64Cholesky workspace and wider norm calculation. High quality scores, large finite vectors, andQUALITY_WEIGHT 10retain deterministic selection with each candidate selected at most once. Advanced search and TQL share the implementation, and workspace admission accounts for element widths. - NMF initialization, matrix products, multiplicative updates, and residual calculations use
f64, with factor finiteness checked before returning query results. Large finite vectors such as[1e30, 0]produce finite topic weights. Matrix budgets include input, output, and intermediate matrices. - The Rust TQL pipeline changes
ScoreValue.valuetof64, retaining graph scores through projection, sorting, aggregation, and HTTP. Harmonic centrality near1e40from an edge weight of1e-40stays finite. Python and Node continue using their floating-point types. SA-PPR checks its seed adapter's finitef32range and returns a structured query error on overflow. - Editing recovery tests assert the current WAL v7 header and continue verifying complete seals, uncommitted transaction isolation, and acknowledged receipt recovery.
Rust caller note Callers constructing
ScoreValuedirectly should explicitly convertf32scores tof64. Vector storage dtypes andSearchHit.scorefollow their respective public contracts.
Payload prefiltering and Hook return contracts
- Row-level 64-bit prefilter signatures and query masks share JSON's
Eq/Hashrules for top-level fields and complete values. Coverage includes null, empty and nested arrays/objects, signed zero, literal dotted fields, and empty field names. Full Payload predicates verify candidates, with consistent equality across writes, updates, and reopening. - Hook-modified vectors undergo Core dimension and finiteness validation after conversion to the target dtype. Converting
[70000, 0]to f16 returnsTDB_INVALID_VECTORon overflow, and subsequent valid queries continue normally. - Node reranking and post-recall hit callbacks preserve current hits when returning
null. Custom recall returningnulluses built-in recall. An empty array explicitly replaces hits with an empty result, matching Core/Python optional replacement semantics. - Node Hook Promises, invalid vector representations, and malformed hit members return
TDB_HOOK_EXECUTION. Complete hit lists are validated for IDs and finite f32 scores before replacement, and the adapter receives ordinary Promise rejection notifications. Public declarations clarify return semantics, with type-consumption coverage for nullable returns and asynchronous-return rejection.
Text recovery, vector indexes, and search callbacks
- Checkpoints synchronize a unique WAL v7 seal before publishing their file group. TMET v2 binds and checks the seal, main-file size and CRC, and text-file size and CRC. Recovery distinguishes checkpoint-covered deletions from subsequent deletions, covering node ID reuse, eager/deferred loading, Rom/Mmap, and Off synchronization. Unverifiable recovery boundaries return
TDB_RECOVERY_REQUIREDwith targettext_index.recovery_boundaryand preserve the original files for recovery. Historical text formats are read and converted by the external migration tool. - Actual vector insertion during WAL replay invalidates existing QuIVer routing. Subsequent ordinary searches rebuild or use exact fallback according to configuration, making all acknowledged nodes searchable in the recovered instance.
- Current text checkpoints write complete metadata and recovery seals as part of file-group publication, including retries after metadata publication succeeds before WAL cleanup fails. The external tool admits memory for historical WAL frames and pending transactions in its source copy. Recovered logical facts are then passed to the current kernel to create the destination file group.
- Custom recall, post-recall, pre-graph, and final DPP callbacks immediately propagate Hook errors as
TDB_HOOK_EXECUTION. Empty recall and ordinary returns follow the same error contract. $set,$inc, and$unsetoperands are validated as JSON objects before applying a patch. Invalid operands returnTDB_INVALID_INPUTwith apatch.<operator>target, retaining the pre-commit Payload and WAL contents.
Upgrade and recovery note Retain a complete file-group backup before upgrading. Development builds use main format 15, WAL v7 and TMET v2. Explicitly migrate historical databases into a new directory with
scripts/migrate.py. Older engines can open the retained source or pre-upgrade backup. For ambiguous legacy recovery, restore a full database backup or create a new database from the host's retained facts and register its text and keywords. Rebuild text already removed by an older engine from a backup or retained source.
Query accounting, path depth, and document parsing
- Payload query budgets and PROFILE use a separate ledger for each pipeline execution. Parallel property scans and graph workers inherit the owning query's ledger, while the storage layer maintains instance-wide totals. Reusing a pipeline context starts fresh accounting, stage counts, and PROFILE data.
- All-path enumeration handles query
DEPTHand the execution depth budget independently. When the budget prevents further expansion, Core returnsTDB_TRAVERSAL_BUDGET_EXCEEDEDunder Error policy ortruncated=trueunder Partial policy. TQL pipelines use the complete-result Error policy, and query depth and path-count limits retain their specified semantics. Frontier capacity is admitted before constructing adjacency workspace. - Markdown HTML is parsed from actual event contents, with text mapped back to individual source segments. Quote markers and list indentation retain their Markdown structural role, and HTML entity decoding preserves its source ranges.
- Inline Markdown
script,style, andtemplateelements are filtered over their full element ranges, covering text across events, nested templates, and raw-text tokenizer state. Inline code, fenced code, and escaped text retain their literal contents. - Per-path average weights and averages across paths accumulate in
f64before producingf32scores. Twof32::MAXedge weights average tof32::MAX. TQL path aggregate scores outside the finitef32range return structured query errors. - TQL
AVGuses compensated summation and scales by the maximum absolute value when intermediate accumulation overflows, covering ordinary integers, large same-sign inputs, signed cancellation, zeros, and tiny finite values. Two1e308values average to1e308.
Parsing update note Apply the text and source-mapping corrections to stored documents through the host's reparse-and-publish workflow.
Document recovery, deterministic sorting, and graph traversal boundaries
- Fixed stale Delete replay removing the new body archive after a node ID was reused for a staged document and checkpoint publication succeeded before WAL cleanup failed. Recovery coordinates deletion cascades using the checkpoint watermark and upload revision, retaining the new body, manifest, representations, and upload state. Effective post-checkpoint deletions continue to reclaim associated archives and candidates.
- Fixed
RETURN _.nested AS picked ORDER BY picked.rank LIMIT 1incorrectly selecting the fact-levelrankindex. Sort aliases resolve against projected values, and projection-dependent ordering collects its full candidate input before pagination. - Explicit ordering resolves ties through node bindings, named-graph edge identity, pipeline bindings, and path identity. Aggregate rows use stable grouping keys. Range indexes and sort direction preserve the same tie-breaking pagination rules.
- SA-PPR pipelines enforce traversal budgets before admitting seeds, examining edges, growing frontiers, and expanding depth. Workspace admission follows actual growth, and graph steps honor cancellation. Exhaustion returns
TDB_TRAVERSAL_BUDGET_EXCEEDED. Pipelines retain their complete-result contract and consistently use the Error exhaustion policy. Scoring retains compact node IDs and scores, with Payload reads deferred to projections that need them. - Diffusion accumulates seed mass and absolute edge-weight normalization in
f64. With a unit seed score, depth 1, restart ratio 0, and two target edges weightedf32::MAX, each target receives0.5. - Bidirectional shortest paths check budgets before admitting both endpoints and growing frontiers. Partial-result counters stay within their limits. Ordinary shortest paths validate endpoint existence before handling equal endpoints, returning no path for a missing node.
- Regression coverage includes Rom/Mmap, controlled checkpoint I/O failures, repeated reopening and persistence, pagination across index changes, individual budget dimensions, and retries after cancellation. Rust/Python/Node share complete expected query results.
Recovery note Body archives already removed and persisted by an older version require restoration from a retained snapshot or republication from the host's original documents.
Node named exports and Prepared types
- Fixed ESM named imports throwing
SyntaxErrorwhen loading the dynamic CommonJS entry point. The loader explicitly exposes public database, Prepared, runtime, session, request-context, and snapshot-function exports. - The native Prepared class uses
PreparedTql, matching the TypeScript declaration. JavaScript retainsJsPreparedTqlas an alias of the same constructor, and Rust retains its existingJsPreparedTqlexport path. Returned handles supportinstanceofwith either JavaScript name. - Installed npm tarball validation includes
.ctsand.mtsconsumers compiled with NodeNext and executed as CommonJS and ESM. Checks cover public value identity, Prepared parameters, and complete query results.
Validation scope and operating conditions
- Core acceptance covers complete node, vector and Payload contents, transaction atomicity, WAL recovery, stable ordering, budgets, cancellation, concurrent shutdown and release of file resources. External migration uses independent historical fixtures to verify complete facts, source preservation, destination reopening and retries after interruption.
- Python acceptance installs the current wheel and checks runtime behavior, stub generation, stubtest, mypy and pyright. Node acceptance installs the actual npm tarball and verifies runtime behavior, CommonJS/ESM and positive/negative TypeScript consumers.
- Cross-platform CI, release builds and artifact uploads identify their corresponding commit and tag. QuIVer research measurements retain their original datasets, implementations, parameters and hardware identities in the evaluation archive. Use exact retrieval for randomly synthesized vectors, handcrafted features and traditional non-negative descriptors. Select ANN parameters against Recall@K and resource requirements on the actual workload.