Repository navigation
Improve prefix retention and cache-aware request routing - #1326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. LOW: Changelog describes publishing short repeated prefixes to the SSD cache, outside the T-041 per-donation gateCHANGELOG.md:8 · T-041 The changelog says an aligned demanded boundary is now captured "below the normal solo stripe, so repeated short prefixes can be published for reuse". It also says repeated checkpoints get the reserved SSD write share on first local appearance. T-041 records the encrypted SSD tier as signed off only for donations whose whole-block prefix exceeds the model's adoption bound plus the 1,024-token benefit floor. T-041's detection_hint says loosening that gate widens the at-rest surface and needs a fresh SEC-035 review. If this code lets sub-threshold prefixes reach SSDPrefixCache.donate, more at-rest artifacts are written and the same-account TTFT oracle extends to short prefixes. Only the changelog was supplied, so the actual gate behaviour is unverified. Fix: confirm that the SSD donation guard still applies to demanded short captures, or document the exception and refresh the T-041/SEC-035 sign-off. Raised by: anthropic/claude-sonnet-5.5 LOW: New public model-demand statistics disclosure surface is not covered by the threat modelCHANGELOG.md:608 · T-051 CHANGELOG.md line 608 describes publishing per-model hourly request and fulfillment aggregates on the Stats page, with CSV export and 24h, 7d and 30d histories. The listed controls are a one-hour publication delay, suppression of cohorts with fewer than 20 requests or 3 consumer accounts, and exclusion of suppressed hours from every resolution. The base threat model has no entry for public aggregate leakage of consumer activity. T-051 covers only profiler tables and admin exports. Risks to model: a consumer or competitor could use small cohorts, hour-boundary differencing between resolutions, or sybil accounts to infer or influence demand. Public outcome counts for capacity, timeout and error could also reveal fleet weaknesses. Fix: add a threat entry and assumptions for the public stats boundary, and verify the suppression and differencing logic in the code. This unit shows only the changelog text, so the implementation is not verified. Raised by: anthropic/claude-sonnet-5.5 Scan incomplete: 2 file(s) could not be fully read as text. Binary, Git LFS and submodule changes require manual review. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Coverage: 36/1105 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 9 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. Bedrock: 2 request(s), 123565 input / 2975 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately. |
|
@codex review Please review latest signed head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a10e4d6464
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please review the latest head |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Final preparation status for
The protected benchmark run is intentionally left awaiting approval as requested. Required human PR approval remains outstanding. No release, version bump, deployment, protected-environment approval, or merge into master was performed. |
…ation report #1326 moved coordinator/registry/cache_match_groups.go to coordinator/internal/registry/cachetracker/match_groups.go. The report still linked the old path, so Docs Lint fails on master and on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rce link (#1423) The report added by #1326 links `../../coordinator/registry/cache_match_groups.go`. That path has never existed on master: #1326 itself landed the file as `coordinator/internal/registry/cachetracker/match_groups.go`, so the frozen-record history lookup cannot verify the link either. Docs Lint fails on master and on pull requests that do not already carry this line. Point the link at the file in the commit that landed the report. The replacement line is byte-identical to the one already carried by open pull requests 1381, 1395, 1396 and 1418, so they merge without a conflict on this line. Nothing else in the report changes. Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Improve usable prefix reuse and reduce planning/routing overhead while preserving exact proofs, memory limits and the original first-content clock.
This refresh integrates current
masterthroughe3575b993, including #1212-1215, the persistent SSD write cap, compact candidate storage, native retirement and typical MTP acceptance. It preserves the earlier local coordinator-ownership port. Branch history is retained with a signed, non-force merge update.Current head:
cb7c94881015e1a1dd7c8428d1d6c441dc500c0c. GitHub reports MERGEABLE, all ten PR commits Verified, and all runnable automatic checks passing. The current-head automated review completed without new findings. Benchmark approval is intentionally left pending as requested; required human PR approval remains outstanding.Before
After
Blue identifies processing, amber admission/qualification and green verified reuse. Both diagrams describe this PR's remaining change against current master; SDK #289's native historical retention is already inherited, not a new dependency delta here.
Implementation
LoadedContractkeeps prepared templates within the bounded contract cache. Incremental preload captures the resident owner before dispatch and usesget_or_load_bounded; a removed active owner cannot create unaccounted replacement capacity. Production avoids fixture-only copies without changing exact tokens or proofs.cacheMatchGroupspreserves deepest compatible representatives, complete hints and holder counts with eight groups/provider and 256 tracked providers. Overflow resumes the original append-all path. Two immutable renderer strings survive compact candidate evaluation; 48-candidate arena chunks stay below the existing 32 KiB allocation boundary.api/inference,internal/inference/firstcontent, dispatch and attempt owners. Reservation binds the serving renderer's original-ingress cutoff; final unsent authorization rejects identity drift. Caller/account limits, alias behavior, response byte budgets, retries, independent hedge expiry and physical admission remain enforced.donationHashesstops at the offered checkpoint while preserving addresses, endpoint rules and native-media identity. Existing fix(cache): preserve durable SSD reuse and bound shorter restores #1215 restore, eviction, file-coordination and tracked-retirement paths remain intact.Dependencies And Compatibility
The final pins match current master: MLX-LM
3fd4944c3b3ee5cb45c5cbfac8805876332d3a29, MLX Swift6923a80f624f5c91fbf456efe4e00e9698a72961, and both MLX sourcescb77239be31b1df7f5db895226af55c39fc4f093. The SDK contains #289, #290 and #165; standalone SDK validation must bind to the provider's local Swift pin rather than the older manifest revision.No API/protocol JSON-shape change, schema migration, configuration change or new release operation. Checked-in version constants remain
0.9.19from master. No release tag, deployment, merge intomasteror protected-environment approval is performed by this refresh.The unmerged #1216 first-sight policy and #1349 copied-holder revocation fix remain separate PRs; neither is silently included or claimed fixed here.
Refactor Pass
Dedicated post-validation subagents reviewed the refreshed implementation. Rust/docs/CI and Swift received explicit no-change assessments. The Go pass removed the single-field cache-group wrapper in favor of
map[string][]int, preserving all grouping and overflow behavior. A separate dedicated pass reviewed the seven-file CPU-isolation follow-up after its RED/GREEN and focused validation, with no further changes warranted. Affected focused tests, builds, lint and documentation checks pass after the combined refactor.Validation
Fresh local validation uses Go 1.26.8, Rust 1.88.0, Swift 6.4/Xcode 27A266a, the exact dependency tuple above and source-built Metal. These are new correctness checks, not transferred historical runtime populations or new performance measurements.
make prompt-sidecar-format prompt-sidecar-check prompt-sidecar-test prompt-sidecar-buildwith pinned MiMo metadata, 201 passes and three documented optional artifact/benchmark ignores. The active-preload regression fails with the old unbounded loader and passes with the merged ownership path.make coordinator-test,make coordinator-build,go vet ./coordinator/..., Linux/amd64 cross-build and golangci-lint v2.1.6 pass. The complete canonical test run uses fresh PostgreSQL 16.14 and passes 20 runner guards, 40 API shards and all unsharded packages; the Postgres store package executes 203 test/subtest passes without skips. Declared optional/helper tests still skip in that aggregate. Separate focused race gates and four actual sidecar/API healthy-subset/ninth-contract subcases pass without skips.cb7c94881in 484.293 seconds: 4,902 framework-reported cases, 217 skipped tests, zero failures/known issues. One skipped-suite marker is not another testcase. All ten invocations complete, including both strict fresh CPU gates without skips. Compiled inputs prove the intended local dependency tuple, with no fallback Swift checkout paths; images remain unchanged through execution. Pinned CMake 3.31.12 builds the same source-matched Metal bytes. The earlier uninstrumentedmake providerand 156 focused methods also pass, but are recorded separately.check-release-version.shconfirms unchanged0.9.19parity.make docs-impact-check BASE=origin/masterpasses on the final committed 293-file delta;make docs-checkpasses for 367 tracked docs. Committed diff whitespace and signatures pass. Both published diagrams are visually verified on GitHub.Current-head CI, system integration, and SDK 27 unsigned release preparation/qualification all pass. The hosted provider transcript confirms both new CPU suites execute and pass in separate processes, with no timeout or interruption. CodeQL, contribution-policy checks and preview checks also pass. The advisory threat-review wrapper is skipped, not a completed security review.
CPU Gate Isolation
The initial refreshed provider job failed three exact F32 assertions in
SSDShorterNativeBlockRestoreTests.typedCapacityRestoresNativeState("plan"). The failure reproduced in a coverage-enabled process after the existing GPU native-store tests. Authenticated file and adopted bytes matched the actual donor exactly; a separate no-SSD control reproduced the cold-state drift across sequential CPU threads using the same frozen parameters.Swift's task-local CPU selection does not change the native default-stream key used by MLX's per-thread compiled-function cache. A prior GPU trace can therefore affect a CPU recomputation after an executor hop. The fix gives
SSDShorterNativeBlockRestoreTestsand the newSSDNativeCheckpointOracleTestsindependent, mandatory fresh processes through the existing nonempty/no-skip wrapper. All original cold-state, offset, key/value and suffix bitwise assertions remain. New donor/file/adoption witnesses and same-thread/owned-thread no-SSD controls add coverage; there is no tolerance change, seed-only workaround, compile toggle or serving-policy change.The ordered mixed-device reproducer remains RED. Repeated fresh CPU invocations are GREEN, including both restore methods/five cases and both oracle methods/ten cases. Process-routing regression tests reject failure, empty execution and both skip formats while proving later gates still run. Fresh
cb7c94881coverage-enabled local validation, hosted provider tests and system integration pass; the earlier failingc24c4ed4cattempt remains available rather than being relabeled as successful.Historical Evidence
The original all-model qualification report, prefix qualification and live baseline and their evidence remain byte-for-byte unchanged.
Their A5/B7/provider populations, short-model TTFT/TPS gains and experimental 1,024-stripe results apply only to their recorded sources, kernels, artifacts and acceptance modes. They do not qualify this combined tuple or establish a future fleet cache-hit lift. Default-profile output failures, failed/unavailable model runs and zero qualified long-serving blocks remain documented; no gate is broadened to hide them.
The protected E2E Benchmarks run remains waiting for human approval, intentionally deferred by request. No new benchmark result or production performance lift is claimed. Human PR approval and any eventual release, version bump, signing/notarization, registration or deployment are separate authorized operations.