fix(stargate-bench): measure validated stream output - #1826
Open
barrygreengus wants to merge 8 commits into
Open
barrygreengus wants to merge 8 commits into
barrygreengus wants to merge 8 commits into
Conversation
barrygreengus
added this pull request to stack #1821
September 11, 2026 21:49
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 11, 2026 22:10
96fd955 to
54b3e6e
Compare
Contributor
🛡️ CodeQL Analysis🚨 Found 5 issue(s) Severity Breakdown:
📋 Top Issues🔗 View full details in Security tab 🕐 Last updated: 2026-09-11 22:27:38 UTC | Commit: 54b3e6e |
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
2 times, most recently
from
September 14, 2026 16:46
b3e0b9f to
6f1913e
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 14, 2026 17:01
4264894 to
a10bd5a
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 14, 2026 21:22
a10bd5a to
59bb253
Compare
barrygreengus
removed this pull request from stack #1821
September 15, 2026 16:28
barrygreengus
added this pull request to stack #1906
September 15, 2026 16:29
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 15, 2026 16:29
fa89124 to
7858489
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 15, 2026 21:00
ec6dc77 to
4e0ef82
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
4 times, most recently
from
September 16, 2026 03:04
3a44d14 to
98e62e7
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 16, 2026 04:41
98e62e7 to
a73c543
Compare
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 16, 2026 04:52
a73c543 to
80cd387
Compare
Validate SSE completion and parse reported output usage instead of crediting requested tokens. Preserve requested workload fields, mark missing usage as unknown, and run benchmark regressions through Bazel. Refs: #1817
Resolve benchmark scenarios from declared runfiles so the full benchmark test suite runs in a clean Bazel sandbox. Refs: #1817
Normalize CR, LF, and split CRLF boundaries and strip a single initial UTF-8 BOM across chunks. Bound buffered events, discard empty events promptly, and keep UTF-8 fixtures in ASCII source. Refs: #1817
Honor include_usage with final generated-token counts and preserve the existing stream shape when usage is not requested. Verify the real mock-to-driver path with a Bazel test using declared executable inputs. Refs: #1817
Add sse-core 0.2.3 under its Apache-2.0 license with only the std feature. Replace custom SSE framing with its bounded decoder and keep completion, usage, and output timing checks in the benchmark driver. Relates to #1817
barrygreengus
force-pushed
the
codex/stargate-maintenance/benchmarks
branch
from
September 16, 2026 05:17
80cd387 to
d27482c
Compare
Only the presence of missing output usage affects scoring. Replace the unused numeric counts with boolean latches while preserving separate successful-request and per-group coverage. Relates to #1817
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The benchmark counted empty or truncated HTTP 200 responses as successful inference and credited requested token limits as generated output. Its native mock omitted streamed usage, leaving no reliable output count for the scorer.
Examples
data: [DONE], previously counted as success. These responses now fail validation.output_tokens: 100andobserved_output_tokens: 3. Scoring uses three.What changed
Customer Release Notes
Stargate benchmarks report validated output usage and reject incomplete success responses. Native mock streams provide actual token counts when requested; missing external usage is shown as unavailable.
Plan Summary
Not applicable.
Usage
Request results include observed_output_tokens. Existing output_tokens fields retain the requested workload limit. The driver requests streamed usage automatically; mock-dynamo also accepts stream_options.include_usage on direct chat-completion requests.
Testing
The YAGNI follow-up passed all 160 benchmark tests and 36 mock-dynamo tests, plus all-target Clippy for both packages with warnings denied. It replaces internal missing-usage counters with boolean flags; existing behavioral tests cover scoring, legacy results, and streamed usage. No runtime schema or dependency changed in this follow-up.
Earlier combined-stack validation passed 1,611 Cargo workspace tests, with 3 existing performance tests ignored, workspace Clippy, and 6 scoped Bazel targets. The native mock-to-driver integration recorded three observed tokens for a request allowing 100. A refusal-only stream recorded first-output timing and three observed tokens; a separate real-driver reproduction verified that later uncounted refusal text invalidates an earlier cumulative count. The full workspace and Bazel suites were not rerun for this internal state simplification. No GPU or live-cluster performance campaign was run.
Notes
The decoder limits each buffered SSE data, event-name, or ID field to 1 MiB. Discarded comments do not consume that buffer budget. Network requests remain owned by the existing HTTP client; decoding does not retry them.
Final layer of the Stargate maintenance stack. Earlier layers fix protocol handling, proxy and relay lifetime, and registration recovery. The streaming deadline finding was already fixed by #1452.
Issues
Closes #1817
References
sse-core decoder
Chat streamed usage
Related Pull Requests
Depends on #1823. Stack, bottom to top: #1818, #1820, #1823, #1826.
Dependencies
Added sse-core 0.2.3 with default features disabled and only std enabled. Its enabled dependencies were already present; no other package versions changed. The crate is dual-licensed MIT OR Apache-2.0. Apache-2.0 was selected and verified against the repository allowlist and the published source revision. Added benchmark attribution, regenerated the root NOTICE index, and refreshed Cargo and Bazel lockfiles, and updated the generated dependency inventory.