1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Infino Authors
// The crate-level docs are a Rust-focused page (Rust quickstart + API map),
// separate from the multi-language project README. The Rust quick example
// runs as a `cargo test --doc` doctest so it can't drift from the API. The
// Python/Node guides live in their own bindings and on the docs site.
// `coverage_nightly` is set by `cargo +nightly llvm-cov`. Under it we opt
// into `#[coverage(off)]` annotations on stable-uncoverable error paths
// (OOM handlers, overflow guards). On stable the feature flag is inert
// and the annotations become no-ops.
// No `.unwrap()` anywhere — including tests and benches. Production
// code uses `?` for fallible operations or
// `.expect("invariant: ...")` for paths that are infallible by
// construction. Test/bench code uses `.expect("description")` so a
// failing test panic message tells you which step broke without
// having to count line numbers in the source. The integration tests
// in `tests/` and benches in `benches/` are separate crates; the
// lint is reasserted there via inner attributes.
// `doc_lazy_continuation` fires across a lot of existing doc comments
// where a paragraph wraps a leading punctuation token (`+`, `-`) and
// rustdoc's Markdown parser treats it as a list-item start. The
// rendered docs are fine; rewording each site would distort prose.
// Allowed crate-wide as a style decision.
// `type_complexity` flags reader-cache and manifest-aggregate state
// types that are intentionally nested. Factoring them into aliases
// adds indirection without clarity at the call sites. Allowed
// crate-wide; revisit when the underlying state shapes stabilize.
// `too_many_arguments` flags `disk.rs::finalize_to_mmap` which has 8
// parameters by design (each captures a distinct stage hand-off).
// Restructuring into a builder adds boilerplate without clarity.
// In a normal (non-`test-helpers`) build the internal layers (`config`,
// `storage`, the manifest + WAL + reader-cache + query stack) are
// `pub(crate)`. The curated public surface reaches a large part of them
// (`Connection` builds storage + creates/opens tables; `append` commits;
// the search methods query), but not all of it — the WAL lease/heartbeat
// machinery, cold-fetch cache tiers, config-file loading, and assorted
// deeper query/format helpers are only driven from paths the minimal
// public API doesn't exercise yet, so they read as dead here, and some
// test-facing re-exports go unused. Allow that *only* in this build mode:
// the `test-helpers` build — which CI compiles with `-D warnings` and
// which runs every test/bench — exercises those paths, so genuinely dead
// code (dead even under `test-helpers`) is still caught. Narrow or drop
// this as more of the surface (SQL, cache config) lands.
// `mimalloc` calls into a C runtime; miri can't execute foreign
// functions, so we fall back to the system allocator under miri.
// Production builds and tests not under miri keep mimalloc. Gated on the
// default-on `mimalloc` feature so an embedding loaded into a host
// process with its own allocator (the Python extension) can opt out — a
// second global allocator dlopened into a live process segfaults.
static GLOBAL: MiMalloc = MiMalloc;
/// Compile-time-baked writer identification, written to `inf.builder` KV.
/// Format: `infino/<crate-version>+<git-short-hash>[-dirty]`, or `…+unknown`
/// when built outside a git checkout (e.g. crates.io). Captured at build time
/// by `build.rs`; not user-overridable.
pub const BUILDER_ID: &str = concat!;
/// Visibility shim for items the layer-isolated integration tests and
/// benches — which are *separate* crates and so can only see `pub`
/// items — must call, but which are not part of the curated public
/// surface. Under `test-helpers` the item is `pub` (reachable through
/// the then-`pub` internal modules); in a normal build it is
/// `pub(crate)`, so it stays internally callable but off the public
/// API. The `cargo-public-api` snapshot is generated without
/// `test-helpers`, so these never enter the public contract.
// Internal layers. `pub` in a `test-helpers` build so the layer-isolated
// integration tests and benches can reach format/storage internals;
// `pub(crate)` otherwise, so the curated public surface is exactly the
// crate-root re-exports below. The `cargo-public-api` snapshot is taken
// without `test-helpers`, keeping these subtrees off the public contract.
pub
pub
pub
pub
// Same reason: benches/tests that drive the vector kernel name
// `ConnectionMemoryBudget` in its signatures.
pub
// `roaring` is already an internal dependency. Re-export it under
// `test-helpers` only, so a bench can build an allow-set for the filtered
// vector kernel without its own `roaring` dependency. Off the public
// contract (the `cargo-public-api` snapshot is taken without the feature).
pub use roaring;
// The catalog layer (`Connection` + `connect`). Internal module; its
// public items are re-exported at the crate root below.
// Process CPU / RSS samplers: benches use `test-helpers`; platform
// Prometheus uses `metering`. Same module either way — no second copy.
pub
// ---- Curated public surface ----
/// Arrow `Schema` / `RecordBatch` builders for the public API.
/// Import as `infino::arrow_schema` and `infino::arrow_array`.
pub use arrow_array;
pub use arrow_schema;
/// Single-table handle: `append` / `update` / `delete` / `bm25_search`
/// / `vector_search` / `schema`. The public handle is the catalog wrapper,
/// which serves a local or a hosted table behind one type; the engine's
/// concrete handle stays internal (reachable as `supertable::Supertable`
/// only under `test-helpers`).
pub use Supertable;
/// Catalog entry points and handle: open a `Connection`, then create /
/// open / drop / list tables.
pub use ;
pub use ;
/// The single public error type for the curated API.
pub use InfinoError;
// `VectorSearchOptions` (probe width / rerank budget) is deliberately
// NOT part of the public surface: serving is drain-calibrated, and
// manual tuning is a test-and-bench-only instrument (recall sweeps,
// the exact-scan oracle). Reachable only under `test-helpers`, which
// the `cargo-public-api` snapshot excludes — users cannot set these.
pub use VectorSearchOptions;
/// Value types named by the public method signatures.
pub use ;
pub use ;
/// Convenience builders for test fixtures. Visible to:
/// - Unit tests (via `cfg(test)` — always on for `cargo test`)
/// - Integration tests (via `cargo test --features test-helpers`,
/// wired into the `Makefile`)
/// - Benches (which pull `test-helpers` in transitively through
/// the `infino-bench-utils` dev-dependency)
///
/// NOT part of infino's stable API. Signatures may change.