-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (76 loc) · 2.81 KB
/
Copy pathMakefile
File metadata and controls
93 lines (76 loc) · 2.81 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
.PHONY: check clippy test contract-test fmt fmt-check build clean ci docs-check publish publish-dry local proof-check check-fwd bench-1m bench-1m-ci
check:
cd crates && cargo check --workspace
clippy:
cd crates && cargo clippy --workspace -- -D warnings
test:
cd crates && cargo test --workspace
contract-test:
cd crates && cargo build --release -p kkernel
python3 tests/contract_test.py
fmt:
cd crates && cargo fmt --all
deno fmt docs/
fmt-check:
cd crates && cargo fmt --all -- --check
build:
cd crates && cargo build --workspace --release
proof-check:
./scripts/check-proof-references.sh
clean:
cd crates && cargo clean
docs-check:
deno fmt --check docs/
check-fwd:
RUSTFLAGS="-D warnings" cargo check --manifest-path crates/khive-merge/Cargo.toml --all-targets
cargo clippy --manifest-path crates/khive-merge/Cargo.toml --all-targets -- -D warnings
cargo test --manifest-path crates/khive-merge/Cargo.toml
ci:
./scripts/ci.sh
publish-dry:
./scripts/publish.sh
publish:
./scripts/publish.sh --live
bench-1m:
@echo "==> Running Vamana 1M scale-proof bench (3-point: 100K/316K/1M, ~7 min)..."
@echo " Set SIFT_DIR to the sift_base.fvecs / sift_query.fvecs directory."
bash scripts/bench_1m.sh
bench-1m-ci:
@echo "==> Running Vamana CI smoke bench (2-point: 10K/50K, <60 s)..."
@echo " Set SIFT_DIR to the sift_base.fvecs / sift_query.fvecs directory."
bash scripts/bench_1m.sh --ci
local:
@echo "==> Building kkernel (release)..."
@cd crates && cargo build --release -p kkernel
@SRC=crates/target/release/kkernel; \
DEST=$$HOME/.cargo/bin/kkernel; \
if [ ! -f "$$SRC" ]; then echo "==> ERROR: build artifact $$SRC missing"; exit 1; fi; \
SRC_HASH=$$(md5 -q "$$SRC"); \
SRC_SIZE=$$(stat -f '%z' "$$SRC"); \
echo "==> Source: $$SRC ($$SRC_HASH, $$SRC_SIZE bytes)"; \
echo "==> Killing running kkernel processes..."; \
pkill -f 'kkernel' 2>/dev/null || true; \
for i in 1 2 3 4 5; do \
if pgrep -f 'kkernel' >/dev/null 2>&1; then sleep 1; else break; fi; \
done; \
if pgrep -f 'kkernel' >/dev/null 2>&1; then \
echo "==> WARNING: still running after 5s — SIGKILL"; \
pkill -9 -f 'kkernel' 2>/dev/null || true; \
sleep 1; \
fi; \
echo "==> Staging + codesigning $$DEST.new..."; \
cp "$$SRC" "$$DEST.new"; \
codesign -s - -f "$$DEST.new" 2>/dev/null || true; \
STAGED_HASH=$$(md5 -q "$$DEST.new"); \
echo "==> Atomically moving into place..."; \
mv "$$DEST.new" "$$DEST"; \
DEST_HASH=$$(md5 -q "$$DEST"); \
DEST_SIZE=$$(stat -f '%z' "$$DEST"); \
DEST_MTIME=$$(stat -f '%Sm' "$$DEST"); \
if [ "$$STAGED_HASH" != "$$DEST_HASH" ]; then \
echo "==> ERROR: post-mv hash drift! staged=$$STAGED_HASH dest=$$DEST_HASH"; \
exit 1; \
fi; \
echo "==> Installed: $$DEST ($$DEST_HASH, $$DEST_SIZE bytes, $$DEST_MTIME)"; \
"$$DEST" --version
@echo "==> Done. Run /mcp in Claude Code to reconnect."