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
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Infino Authors
// The crate-level docs ARE the project README, so the Rust quick example
// runs as a `cargo test --doc` doctest and can't drift from the API.
// `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
// `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.
// ---- Curated public surface ----
/// 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;
/// Value types named by the public method signatures.
pub use VectorSearchOptions;
pub use ;
/// Single-table handle: `append` / `update` / `delete` / `bm25_search`
/// / `vector_search` / `schema`.
pub use Supertable;
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.