Skip to content

Fix cache isolation and admission; optimize CPU hot paths - #7

Merged
loverustfs merged 2 commits into
mainfrom
codex/audit-correctness-cpu-optimizations
Oct 15, 2026
Merged

loverustfs merged 2 commits into
mainfrom
codex/audit-correctness-cpu-optimizations

Conversation

@loverustfs

@loverustfs loverustfs commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem and changes

Rejected or replayed file-store reservations could evict valid cached data, and global idempotency lookup could return another tenant's cached mutation result. Admission now validates before reclamation, batches reject duplicate request IDs before mutation, and replay state is scoped by authenticated tenant and trust domain. A TCP client also stops accepting calls after an incomplete exchange so a late reply cannot answer a later request.

CPU hot-path changes remove per-read LRU disk syncs and two framing copies, move parsing/encoding outside the store mutex, borrow checksum inputs, and index eviction/reload and shard-directory bookkeeping. Directory replay validates tenant/size and rejects older member incarnations. Cold refill charges manifest plus payload to one budget, while simulated DPU writes share a pending/committed byte cap and move payload ownership on completion.

GCK1/GCKR and CacheIdentity encodings are unchanged. No dependencies or hardware integration are added. Documentation makes the remaining production limitations explicit, including reader pins, response allocation, unwired TCP security hooks, distributed fencing, and hidden-slab recovery. Read recency is advisory across restart; committed-block persistence is unchanged.

The cross-process test helper uses Cargo's target/profile-specific binary path and the existing Cargo target-runner environment variable. The helper reuses QEMU CI’s executable and ARM64 library-path arguments so the spawned helper executes correctly; native test execution remains unchanged.

Validation

  • 142 tests pass with cargo test --workspace --all-targets.
  • 142 tests pass with cargo test --workspace --all-targets --all-features.
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and git diff --check pass.
  • Native and runner-wrapped cross-process helper tests pass locally.
  • Four new file-backend regressions were observed failing on the original implementation before the fixes.
  • Local tests ran on macOS arm64 / Rust 1.98.1; CI supplies Linux x86_64, arm64, and qemu coverage.
  • Added cargo run --release -p gpucache-transport --example cpu_audit for reproducible synthetic file/directory microbenchmarks. These are not inference, NIC, or DPU measurements.

RDMA/GPU/BF3 remain NOT_RUN_HARDWARE; cost remains TCO_UNKNOWN.

@loverustfs
loverustfs merged commit 7ef7fc3 into main Oct 15, 2026
6 checks passed
@houseme
houseme deleted the codex/audit-correctness-cpu-optimizations branch October 17, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant