Repository navigation
perf(registry): reduce scan allocation and duplicate evidence work - #1345
Conversation
Reuse bounded private candidate storage, retain compact detached evidence, borrow forecast inputs, project alternates once, and aggregate pending/service evidence. Preserve public quote ownership and locked reservation admission/debits. Include differential/lifetime/boundary tests and measured local validation.
Remove unused routingSnapshot decode and shadow-TTFT wrappers after compact candidate snapshots took over their callers. Preserve live admission and shadow behavior; update comments and measurement provenance. Validated full registry race suite, coordinator vet, macOS and Linux builds, docs impact and docs lint.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Coverage: 0/0 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), 0 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. |
|
Review checkpoint for abf6b84: the original blocking finding was four unused scheduler helpers; both concurrent cleanup histories are preserved and the dead code is removed. Two independent correctness reviews plus a dedicated structure/refactor pass found no additional introduced defect. The new responsibilities remain separated into storage, retained snapshots, pending projection, report validation, and detached ranking. Before/after Mermaid diagrams were verified rendered on GitHub. Final local full coordinator tests, registry race tests, lint, macOS/Linux builds and documentation checks passed. Exact-head GitHub CI now passes Coordinator Tests, Coordinator Lint, Release Integrity, Docs Lint/Impact, Commit Signatures, all three CodeQL analyses and all four Vercel previews. All five PR commits are Verified. Remaining gates: E2E Integration Tests are running; E2E Benchmarks await approval of the benchmarks environment (reviewer Gajesh2007); a required PR approval is still missing. The advisory threat-review pilot reports that it did not review this head and needs maintainer evaluation, despite its workflow succeeding. No inline review findings are currently open. No merge or production deployment performed. |
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. |
davidtai
left a comment
There was a problem hiding this comment.
Just verify the ChunkSize change to 55 is intended.
Summary
Replaces #1341 at the author's request so the head branch lives in
Layr-Labs/d-inference, not the personal fork. Preserves the original signed optimization, both concurrent cleanup commits, and their report/comment improvements. Signed merges integrate both histories and current masterbc1ee1629(including #1342 and #1343), without rewriting history. The personal branch is unchanged.Before
flowchart TD B0([Request]) --> B1["ReservationPlanner: scan providers"] B1 --> B2["Allocate full candidate snapshots; copy forecast inputs"] B2 --> B3["Repeat pending/service and alternate projections"] B3 --> B4["Rank and select candidate"] B4 --> B5{"Locked current-state admission"} B5 -->|Admit and debit| B6(["Provider and detached decision / plan"]) B5 -->|Reject| B7["Retry or existing failure policy"] classDef entry fill:#dbeafe,stroke:#2563eb,color:#172554 classDef work fill:#fef3c7,stroke:#d97706,color:#451a03 classDef safety fill:#dcfce7,stroke:#16a34a,color:#14532d classDef failure fill:#fee2e2,stroke:#dc2626,color:#450a0a class B0 entry class B1,B2,B3,B4 work class B5,B6 safety class B7 failureAfter
flowchart TD A0([Request]) --> A1["reservationCandidateStorage: private bounded reuse"] A1 --> A2["candidateSnapshot: retain compact values"] A2 --> A3["fillPendingSnapshot / ServiceReport: project once"] A3 --> A4["Borrow immutable forecasts; unchanged selection"] A4 --> A5{"Locked current-state admission"} A5 -->|Admit and debit| A6["RetainRanked: project alternates once"] A6 --> A7(["Provider and detached decision / plan"]) A5 -->|Reject| A8["Retry or existing failure policy"] A7 --> A9["Clear private chunks after synchronous readers finish"] A8 --> A9 A0 --> A10["Public / decorated preparations keep owned storage"] classDef entry fill:#dbeafe,stroke:#2563eb,color:#172554 classDef work fill:#e0e7ff,stroke:#4f46e5,color:#1e1b4b classDef safety fill:#dcfce7,stroke:#16a34a,color:#14532d classDef failure fill:#fee2e2,stroke:#dc2626,color:#450a0a class A0 entry class A1,A2,A3,A4,A6,A9,A10 work class A5,A7 safety class A8 failureBlue marks incoming work, amber/indigo computation, green preserved admission/results, and red existing failure behavior. Public scans do not borrow private candidate storage. Later dispatch-plan claims still require current locked revalidation. Shadow occupancy estimates remain confined to
candidateSnapshot.shadowTTFT, outside live admission ceilings.Measurements
The original six paired fresh-process runs reported standard 350-provider reserve latency of 313.661 to 267.959 microseconds (-14.57%), allocation bytes of 435,152 to 8,370 (-98.08%), and 19 to 6 allocations. Candidate size falls from 1,448 to 592 bytes. Retained storage is capped at 64 chunks per pooled object, not globally; indexed scans over 3,520 providers use owned storage.
These are original local microbenchmark results, not a new production latency claim or measurements rerun during this review. The measurement report includes raw samples, methodology, tradeoffs, and comparison with pre-#1324 performance.
Review And Refactor
Two independent correctness reviewers traced storage lifetime/concurrency and projection/selection equivalence. No additional introduced defect was found. A dedicated refactor subagent reviewed the whole optimization and cleanup after focused tests passed, and explicitly found no further changes warranted: the new storage, snapshot, pending projection, service validation, and ranking responsibilities have cohesive owners. It also checked the final merge resolutions and confirmed no lost semantics. The preexisting large scheduler was not broadly rewritten.
Non-blocking coverage opportunities remain: deterministically force a pooled private rescan, test borrowed calibration with a nonempty competitor slice, and exercise a content-commit transition during projection. Existing lifetime, overflow, public/decorated ownership, differential ranking, pending/service, admission and retirement tests pass.
Validation
Rerun in an isolated worktree with Go 1.25.0 and empty
EIGENINFERENCE_DATABASE_URL/TEST_DATABASE_URL:make coordinator-test: all 20 runner guard tests and the full coordinator suite pass (82.550 seconds after the final master integration).go test ./coordinator/tests/registry/... -count=1: all eight packages pass; independently repeated by reviewers and the refactor subagent.go test -race ./coordinator/tests/registry/... -count=1: all eight packages pass, no race report.golangci-lint runusing CI-pinned v2.1.6: zero issues, including a rerun after the refactor pass.make coordinator-build coordinator-build-linux: both pass.make docs-impact-check BASE=origin/master: canonical coverage passes.make docs-check: all 331 committed documents pass after initializing the pinned documentation dependencylibs/mlx-swift-lm.git diff --check: passes.PostgreSQL-dependent local cases are skipped without a database; credential/provider-dependent E2E and performance measurements were not rerun locally. Exact-head CI, protected integration/benchmark gates, and automated review status must be evaluated separately before merge. No merge, release, or production deployment is authorized by this PR.