Skip to content

refactor(registry): own model-load commands and plan timing - #1022

Closed
Gajesh2007 wants to merge 8 commits into
refactor/coordinator-cache-directoryfrom
refactor/coordinator-model-loads
Closed

Gajesh2007 wants to merge 8 commits into
refactor/coordinator-cache-directoryfrom
refactor/coordinator-model-loads

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Pending model-load deadlines, original start times and heartbeat plan timing were shared registry implementation details. modelloads.Commands now owns the two session/model maps behind a private mutex, and modelloads.PlanGate owns the fleet timer state. Focused registry files retain live eligibility, provider publication, command I/O and terminal queue decisions.

Stacked on #1019 (refactor/coordinator-cache-directory). The source includes its reviewed admission citation follow-up.

The registry still holds its existing r.mu / p.mu scopes when validating and reserving loads, removing ineligible commands or disconnecting sessions. The command owner is a leaf and never calls the registry. Completion preserves the original start timestamp; backoff only changes the deadline. Expiry remains strict: unswept entries block a second model even at the exact deadline, while status receipts require an unexpired exact session/model command. Stable-identity dispatch-load cooldowns still survive reconnect. The timer still coalesces heartbeat planning into one leading and one trailing opportunity, releases its lock before the callback, and rearms delayed callbacks; explicit swap requests remain immediate.

Before:

flowchart TD
  H[Heartbeat / queued demand / warm-pool tick] --> G[Registry modelSwapPlanGate]
  G --> P[model_loading.go: live provider selection under registry/provider locks]
  P --> R[Registry pendingModelLoads + pendingModelLoadStarted]
  R --> S[SendLoadModel outside locks]
  S --> O[Exact session/model status: warm + clear or failure backoff]
  O --> R
  E[Expiry / capability revocation / disconnect] --> R
  G --> T[One trailing timer: release gate then plan]
  T --> P
Loading

After:

flowchart TD
  H[Heartbeat / queued demand / warm-pool tick] --> G[modelloads.PlanGate: private timer lock]
  G --> P[model_load_plan.go: same live provider selection and locks]
  P --> R[modelloads.Commands: private coupled maps; registry retains transaction locks]
  R --> S[model_load_commands.go: same SendLoadModel outside locks]
  S --> O[Same exact status: model_load_warm.go publication + clear or backoff]
  O --> R
  E[model_load_state.go + disconnect: same expiry / eligibility / session cleanup] --> R
  G --> T[Same trailing timer: release gate then plan]
  T --> P
Loading

Validation:

  • Go 1.25 race checks: full coordinator tree, 33 package passes and 5,643 test/subtest results (API 224.588s); 117 focused lifecycle results. Both new tests ran separately under the race detector after the full run compiled.
  • The new exact-deadline fixture passes unchanged on the original parent and candidate. A new owner concurrency fixture verifies one model reservation per session and original-start preservation across backoff/completion.
  • All 3,501 existing test/benchmark symbols and original failure calls remain. Token proof verifies 22 mapped production declarations, four extracted transaction bodies and 10,034 retained declarations; the 28 adapter/state/fixture deltas are separately documented and independently reviewed.
  • Five existing fleet snapshot/planning/model-swap/heartbeat benchmark fixtures pass one-iteration smoke on parent and candidate (no performance claim).
  • Pinned golangci-lint v2.1.6: zero issues. Maintained docs: 280 files pass. Original database/opt-in skips remain; no backend or native-provider behavior changed.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 14, 2026 7:02pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 7:02pm UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 7:02pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T19:06:05.255051Z c69ffd6 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Please review source e4507f6 / head 92b81b5 against updated #1019 parent 3307cef. Focus private model-load command ownership, session/model identity and clock semantics, r.mu/p.mu transaction ordering, capability/disconnect cleanup, and trailing timer rearm/release-before-callback. Existing policy values and outcomes remain unchanged.

Independent source/docs peer is clean. Full coordinator race passed 33 packages / 5,643 test results; two new fixtures ran separately under race, and the exact-deadline fixture also passes unchanged on the original parent. Five existing fleet/model-swap benchmark groups passed parent/candidate one-iteration fixture smoke. Pinned Go 1.25 / golangci-lint v2.1.6: zero issues; docs-check: 280 files.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 92b81b5be6

ℹ️ 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".

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Signed head dada570 incorporates #1019's one-file package-comment correction: cacheattempt now names cachedirectory as the receipt/holder owner. All model-load source and documentation bytes remain unchanged. The parent review's source-stamp ancestry claim was independently disproved; verified stamps remain unchanged. Existing source/docs peer and full/focused race receipts still apply, and docs-check again passes 280 files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dada570535

ℹ️ 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".

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

The zero-value Commands.Reserve initialization finding is fixed with a regression that reproduced the panic and now checks coupled clocks, expiry boundaries and completion. Independent peer, affected race, pinned lint and docs checks pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 1b6e11d163

ℹ️ 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".

…/coordinator-model-loads

# Conflicts:
#	docs/developer/build.md
#	docs/developer/test.md
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Refreshed the parent branch and resolved documentation/source-map conflicts. Existing subsystem implementations and regression tests are preserved. Exact parent composition and independent review pass; all coordinator test packages compile and documentation checks pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c69ffd66ad

ℹ️ 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".

@Gajesh2007

Copy link
Copy Markdown
Member Author

Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head (c69ffd66ad1225cb85c4f9213299d436374b634b), including its reviewed fixes, with implementations and regressions reconciled into the coordinator subsystem owners. Closing the component PR to collapse the stack; its branch, commits and review history are retained. Follow #1056 for combined validation and merge status.

@Gajesh2007 Gajesh2007 closed this Sep 16, 2026

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference-console-ui-dev — c69ffd66 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference — c69ffd66 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — c69ffd66 Deployed Sep 14, 2026 by vercel[bot]
benchmarks — c69ffd66 Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1300
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