-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
192 lines (178 loc) · 9.23 KB
/
Copy pathCargo.toml
File metadata and controls
192 lines (178 loc) · 9.23 KB
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
[workspace]
resolver = "2"
members = [
"crates/plugmem-arena",
"crates/plugmem-core",
"crates/plugmem-host",
"crates/plugmem-cli",
"crates/plugmem-mcp",
"crates/plugmem-napi",
"crates/plugmem-py",
"crates/plugmem-testgen",
"tools/bench-matrix",
"tools/bench-charts",
"tools/wasm-probe",
]
# The fuzz targets are their own workspace: they build on nightly against a
# sanitizer runtime and must not enter this lockfile or lint set.
exclude = ["fuzz"]
[workspace.package]
version = "0.12.0"
edition = "2024"
authors = ["Mansur Azatbek <mansur62624@gmail.com>"]
license = "MIT"
repository = "https://github.com/m62624/plugmem"
homepage = "https://github.com/m62624/plugmem"
[workspace.dependencies]
# Local crates (version pinned so the crates can be published to crates.io)
plugmem-arena = { path = "crates/plugmem-arena", version = "0.12.0", default-features = false }
plugmem-core = { path = "crates/plugmem-core", version = "0.12.0", default-features = false }
plugmem-host = { path = "crates/plugmem-host", version = "0.12.0" }
# Internal, never published: path-only, so cargo strips it from published
# manifests when it appears as a dev-dependency.
plugmem-testgen = { path = "crates/plugmem-testgen" }
# Core dependencies (no_std; each entry build-verified against wasm32v1-none — specs/08)
thiserror = { version = "2.0.18", default-features = false }
xxhash-rust = { version = "0.8.17", default-features = false, features = ["xxh3"] }
hashbrown = { version = "0.17.1", default-features = false }
# Tokenizer decomposition helper retained for the search policy's
# diacritic/combining-mark rules.
unicode-normalization = { version = "0.1.25", default-features = false }
# ICU4X is the production Unicode backend: NFKC, locale-neutral lowercase,
# Unicode properties, and UAX #29 word segmentation with complex-script data.
icu-casemap = { version = "2.2.0", package = "icu_casemap", default-features = false, features = ["compiled_data"] }
icu-locale-core = { version = "2.2.0", package = "icu_locale_core", default-features = false }
icu-normalizer = { version = "2.2.0", package = "icu_normalizer", default-features = false, features = ["compiled_data", "utf8_iter"] }
icu-properties = { version = "2.2.0", package = "icu_properties", default-features = false, features = ["compiled_data"] }
icu-segmenter = { version = "2.2.0", package = "icu_segmenter", default-features = false, features = ["compiled_data", "auto"] }
writeable = { version = "0.6.3", default-features = false }
# Float math for no_std (BM25 idf/tf norms, recency decay).
libm = { version = "0.2.16", default-features = false }
# Optional serde support, gated behind each crate's `serde` feature (off by
# default). no_std-compatible: `derive` + `alloc`, no std. Used only to
# Serialize/Deserialize the public data types for JSON-facing consumers.
serde = { version = "1.0.229", default-features = false, features = ["derive", "alloc"] }
# Wrapper dependencies (std)
clap = { version = "4.6.2", features = ["derive"] }
# Canonical per-user config/data paths for Linux, macOS and Windows.
directories = "6.0.0"
# Cross-platform mmap for the host's zero-copy read-only open (specs/16).
# 0.9.11: MSRV 1.65, MIT/Apache-2.0, covers linux/macos/windows ×
# x86_64/aarch64. (The original `memmap` is unmaintained — RUSTSEC-2020-0077.)
memmap2 = "0.9.11"
# Safe self-referential struct: ReadOnlyDatabase owns the `Mmap` and a
# `Memory<'a>` borrowing it. Keeps the self-reference safe so the only
# `unsafe` on the read-only path is the (inherent) mmap call itself.
self_cell = "1.3.0"
ureq = "3.3.0"
serde_json = "1.0.150"
# config.toml parsing, shared by the host `config` loader and the CLI. Parse
# only — `toml::Table` via FromStr; no serializer needed.
toml = { version = "0.8", default-features = false, features = ["parse"] }
# Native Node.js addon (plugmem-napi): napi-rs bindings over plugmem-host.
# Node-API version pinned to 8 (Node 12.22+/14.17+/16+; we build for 26). No
# `async`/`tokio_rt` features — concurrency rides the libuv threadpool, not tokio.
napi = { version = "2.16", default-features = false, features = ["napi8"] }
napi-derive = "2.16"
napi-build = "2.1"
# Python extension module (plugmem-py): PyO3 over plugmem-host.
#
# `abi3-py310` is what makes one wheel per platform cover every GIL build of
# Python from 3.10 on: it restricts the binding to CPython's stable ABI, which
# does not change between versions. It costs nothing here because this crate
# touches no CPython API directly — everything goes through PyO3.
#
# `experimental-inspect` is what `maturin generate-stubs` reads to emit the
# `.pyi`, so the stubs come from the same macros as the binding instead of
# being written by hand and drifting.
#
# No `pyo3-async-runtimes`: the engine is CPU-bound and has no runtime to
# bridge. Concurrency is `Python::detach` plus the caller's own threads.
pyo3 = { version = "0.29.1", features = ["abi3-py310"] }
# Type stubs (`.pyi`) for the Python binding, which is what gives an IDE
# completion and a type checker something to check against a compiled module.
#
# Not PyO3's own `experimental-inspect` + `maturin generate-stubs`: measured on
# this crate at PyO3 0.29.1, that pair emits a stub containing nothing but
# `def __getattr__(name: str) -> Incomplete`, with the feature verifiably
# enabled. This crate reads the same macros the binding is written with and
# emits real signatures.
pyo3-stub-gen = { version = "0.23.0", default-features = false }
# Dev dependencies
proptest = "1.11.0"
criterion = "0.8.2"
insta = "1.48.0"
# Cross-platform resident-set-size probe (linux/macos/windows) for the host
# overlay RAM-win test (specs/16 §9): proves an mmap overlay open residents
# far less physical memory than an owned open of the same file. Dev-only.
memory-stats = "1.2.0"
# rand_xoshiro was reserved for testgen (specs/08) and dropped: the
# generator implements its own PRNG in place (specs/11 §3) so corpus
# reproducibility never depends on an external crate's stream stability.
# Every crate opts in via `[lints] workspace = true`. Documentation is not
# optional in this project: any public item without docs fails the build.
# All code and docs are English-only.
[workspace.lints.rust]
missing_docs = "deny"
unsafe_op_in_unsafe_fn = "deny"
# `cargo-tarpaulin` sets `--cfg=tarpaulin`; the hardening jobs pass
# `--cfg=valgrind` (valgrind sets no cfg of its own). Declare both so
# `#[cfg_attr(tarpaulin, ignore)]` / `#[cfg_attr(valgrind, ignore)]` on the
# timing-sensitive concurrency stress tests do not trip the unexpected-cfg lint.
# Those tests are covered by normal `cargo test`; under tarpaulin's ptrace or
# valgrind's ~100x slowdown their wall-clock watchdogs only time out (a false
# deadlock) without adding coverage. (`miri` is a built-in cfg — no declaration
# needed.)
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin)', 'cfg(valgrind)'] }
[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
# Config for 'dist'
[workspace.metadata.dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.31.0"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "homebrew", "msi"]
# A GitHub repo to push Homebrew formulas to
tap = "m62624/homebrew-plugmem"
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
# Skip checking whether the specified configuration files are up to date
allow-dirty = ["ci"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Which actions to run on pull requests
pr-run-mode = "plan"
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Whether to install an updater program
install-updater = false
# Build aarch64-windows on a NATIVE Windows runner. By default dist
# cross-builds it on Linux via cargo-xwin, but the `.msi` needs WiX v3's
# `candle.exe` (a Windows binary that can't run under xwin) — so it must
# build on Windows. This is the Windows-specific fix carried over from the
# elenchus release pipeline.
[workspace.metadata.dist.github-custom-runners]
aarch64-pc-windows-msvc = "windows-2022"
# The hot loops are split across crates by design — the arena holds the page
# walk and the byte moves, the core holds the scoring and the distance kernels
# — so without cross-crate inlining every posting decode and every slot read
# crosses a call boundary the optimizer cannot see through. `lto = "fat"` plus a
# single codegen unit is what lets it. Benches inherit this: a benchmark built
# with different inlining measures a different program.
[profile.release]
lto = "fat"
codegen-units = 1
[profile.bench]
inherits = "release"
# `dist` keeps `thin` deliberately: the release pipeline builds six targets and
# pays fat LTO six times for a binary whose cost is dominated by I/O, not by the
# scoring loops a benchmark exercises. `codegen-units` is restated for the same
# reason and not left to inheritance — the single unit above buys inlining a
# benchmark can measure, at the price of serializing codegen, and `dist` pays
# that price six times over for a binary that cannot show the gain.
[profile.dist]
inherits = "release"
lto = "thin"
codegen-units = 16