Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(config): shipped xerj.default.toml parses again — remove dead hnsw_offload_threshold (RC4 blocker 14)

xerj-org5c85cba6d91a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 875658f34..1daae4af7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -136,6 +136,38 @@ jobs:
working-directory: engine
run: cargo build --release -p xerj-server -p es-yaml-runner
+ # rc.3 regression: the shipped xerj.default.toml failed to parse
+ # (`unknown field hnsw_offload_threshold`) so the documented
+ # `--config` invocation was a dead boot. Boot the real binary with
+ # the real shipped file and require it to answer HTTP before the
+ # conformance server takes port 9200. Runs from a temp dir because
+ # the shipped config uses a relative `data_dir = "./data"`, and
+ # accepts any HTTP status (auth is enabled in the shipped config,
+ # so an unauthenticated probe legitimately gets 401).
+ - name: Shipped default config boots (rc.3 regression)
+ run: |
+ set -euo pipefail
+ SMOKE="$(mktemp -d)"
+ cd "$SMOKE"
+ "$GITHUB_WORKSPACE/engine/target/release/xerj" \
+ --config "$GITHUB_WORKSPACE/engine/xerj.default.toml" > server.log 2>&1 &
+ SMOKE_PID=$!
+ up=""
+ for _ in $(seq 1 80); do
+ code="$(curl -s -m1 -o /dev/null -w '%{http_code}' localhost:9200/ || true)"
+ if [ "$code" != "000" ] && [ -n "$code" ]; then up="$code"; break; fi
+ if ! kill -0 "$SMOKE_PID" 2>/dev/null; then break; fi
+ sleep 0.25
+ done
+ if [ -z "$up" ]; then
+ echo "xerj failed to boot with the shipped xerj.default.toml"
+ cat server.log
+ exit 1
+ fi
+ echo "shipped-config boot OK (HTTP $up)"
+ kill "$SMOKE_PID" 2>/dev/null || true
+ wait "$SMOKE_PID" 2>/dev/null || true
+
- name: Boot xerj
working-directory: engine
run: |
diff --git a/engine/crates/xerj-common/src/config.rs b/engine/crates/xerj-common/src/config.rs
index 79e57b7a1..c7111ef20 100644
--- a/engine/crates/xerj-common/src/config.rs
+++ b/engine/crates/xerj-common/src/config.rs
@@ -1063,6 +1063,21 @@ mod tests {
);
}
+ #[test]
+ fn shipped_default_config_parses_and_validates() {
+ // rc.3 regression: the shipped engine/xerj.default.toml failed to
+ // parse (`unknown field hnsw_offload_threshold`, line 223) so the
+ // documented `--config xerj.default.toml` invocation was a dead
+ // boot. Every sub-config is `deny_unknown_fields`, so ANY key that
+ // drifts out of the schema kills the boot — guard the shipped file
+ // byte-for-byte at compile time.
+ let toml_src = include_str!("../../../xerj.default.toml");
+ let cfg = Config::from_toml_str(toml_src)
+ .expect("shipped xerj.default.toml must parse against the current Config schema");
+ cfg.validate()
+ .expect("shipped xerj.default.toml must pass Config::validate");
+ }
+
#[test]
fn count_user_facing_settings() {
// 47 user-facing settings:
diff --git a/engine/xerj.default.toml b/engine/xerj.default.toml
index be65dc05e..36ee92663 100644
--- a/engine/xerj.default.toml
+++ b/engine/xerj.default.toml
@@ -207,21 +207,14 @@ hnsw_ef_search = 100
# "none" — Full float32 (highest accuracy; highest memory usage).
# "scalar8" — 8-bit scalar quantization (~4× memory saving; ~1–2% accuracy loss).
# Recommended for most workloads.
-# "scalar4" — 4-bit scalar quantization (~8× memory saving; ~2–4% accuracy loss).
-# Use when vector count is very large and memory is constrained.
-# xerj can also switch to scalar4 automatically when vector count
-# exceeds `hnsw_offload_threshold` (see below).
-# "binary" — 1-bit binary quantization (~32× memory saving; ~10% accuracy loss).
-# Best for extremely large vector collections.
+#
+# "binary" (1-bit) is recognised but NOT implemented in this build — the
+# engine rejects it at startup rather than silently storing full-precision
+# vectors while claiming a 32× saving. 4-bit ("scalar4") quantization and
+# automatic quantization downgrade are not implemented either and have no
+# settings here.
default_quantization = "scalar8"
-# Vector count threshold for automatic scalar4 quantization.
-# When the number of vectors in an index exceeds this value, xerj automatically
-# downgrades new vectors to 4-bit (scalar4) quantization to reduce RAM usage.
-# Set to 0 to disable automatic downgrade (default: 0 — disabled).
-# Typical value: 1_000_000 (1 million vectors).
-hnsw_offload_threshold = 0
-
# Maximum supported vector dimensionality.
# Vectors with more dimensions than this are rejected at ingest time.
# xerj supports up to 16,384 dimensions — 4× Elasticsearch's limit of 4,096.