Skip to content

Reject non-finite routing settings and bound prompt calibration - #946

Closed
Gajesh2007 wants to merge 6 commits into
refactor/coordinator-capacityfrom
fix/coordinator-finite-config
Closed

Gajesh2007 wants to merge 6 commits into
refactor/coordinator-capacityfrom
fix/coordinator-finite-config

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Stacked on #943 (refactor/coordinator-capacity); merge #943 first. Its safe context-token addition is required for the calibrated estimate to reach the registry gate without wrapping.

Operator settings such as NaN and +Inf passed the registry's numeric range checks, and prompt-calibration overrides treated non-finite pairs as valid replacements. Reject non-finite quality/warm-pool settings during startup validation and skip non-finite calibration pairs. Bound large finite calibrated products before integer conversion so context estimates have consistent behavior across architectures.

flowchart LR
  subgraph Before
    E[Operator float settings] --> C[Config.Check range comparisons]
    C --> A[Nonfinite values reach target and admission math]
    P[Calibration pairs] --> S[SetPromptContextCalibrationFromEnv]
    S --> M[Replace map including NaN or infinity]
    M --> I[Unchecked float-to-int estimate]
  end
  subgraph After
    E2[Operator float settings] --> C2[Config.Check finite and range checks]
    C2 --> R[Reject nonfinite configuration before serving]
    P2[Calibration pairs] --> S2[Skip nonfinite or invalid pairs]
    S2 --> M2[Replace only when valid pairs remain]
    M2 --> I2[Clamp oversized calibrated product before int conversion]
    I2 --> T[Context-only estimate with stable bounds]
    T --> R2[PredictServable safe sum from parent PR943]
    R2 --> C3[Oversized context rejected]
  end
Loading

The checks include the decode floor even when the warm controller is disabled because admission also consumes it. Valid defaults, finite ranges, zero-value behavior, unmatched/nonpositive estimates, and truncation of ordinary products are unchanged. The shared env.EnvFloat parser and registry setter contracts remain unchanged; main already validates the assembled configuration before invoking those setters. The implementation remains focused on calibration/configuration; the PR now explicitly depends on #943 for the downstream safe context-token sum.

Validation:

  • New fixtures fail on master for actual ReadConfig().Check() acceptance and calibration setter replacement/counts, including all-invalid and mixed overrides.
  • Focused Go 1.25 race tests pass for both packages (registry 1.472s, API 1.774s).
  • Full Go 1.25 registry/API race suites pass: registry 24.186s, API 225.665s.
  • Calibration fixtures cover oversized estimates and a finite multiplier whose product overflows. Baseline arm64 Go already saturates those conversions; the explicit bound removes architecture dependence rather than claiming a negative baseline result on this host.
  • Documentation lint passes (278 pages); independent review of all source and test changes found no blocker.

Review follow-up: an API-to-registry regression fails on the previously independent head (oversized calibrated prompt declared servable) and passes when stacked on #943. Focused stacked registry/API races pass (registry 1.510s, API 1.952s). Full stacked Go 1.25 race suites also pass (registry 24.721s, API 225.800s); pre-stack full results above remain explicitly historical.

The disabled, zero-interval warm-controller range bypass remains compatible: finite negative decode floors still disable the quality cap. This exception is now documented explicitly and covered through actual ReadConfig().Check() calls; non-finite floors remain rejected. Follow-up registry race passes 1.455s and docs lint passes 278 pages. No production code changed after the full stacked race run.

Ready for human review: all findings are resolved and the source/test checks pass. Fresh Codex review of final head 6317351e5 completed with a thumbs-up and no unresolved findings. Merge the explicit #943 dependency first.

@vercel

vercel Bot commented Sep 12, 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 12, 2026 1:00am UTC
d-inference-console-ui-dev Ready Ready Preview Sep 12, 2026 1:00am UTC
d-inference-landing Ready Ready Preview Sep 12, 2026 1:00am UTC

Request Review

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-12T22:08:43.006410Z 6317351 Draft marked ready
ℹ️ 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 Final head 00d1ffa adds the focused Unreleased entry; production remains 9f8ad60, with full registry/API race suites passing.

@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: 00d1ffad29

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

Comment thread coordinator/api/prompt_calibration.go Resolved
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review Please review stacked head281ea379c against base refactor/coordinator-capacity; downstream sum fix and the new API-to-registry regression now make the dependency explicit.

@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: 281ea379c6

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

Comment thread docs/reference/configuration.md Resolved
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review Head6317351e5 clarifies and characterizes the preserved disabled-controller finite range exception; no production delta from the fully race-tested281ea379c head.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@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 (6317351e5a1de14c28b400550d28e51f16494739), 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 — 6317351e Deployed Sep 12, 2026 by vercel[bot]
Preview – d-inference — 6317351e Deployed Sep 12, 2026 by vercel[bot]
Preview – d-inference-landing — 6317351e Deployed Sep 12, 2026 by vercel[bot]
benchmarks — 6317351e Deployed Sep 12, 2026 by Gajesh2007 via E2E Benchmarks #1045
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