-
Notifications
You must be signed in to change notification settings - Fork 12
fix(inference): scope run picker to selected scenario / 修复推理面板运行选择器未按场景过滤的问题 #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cquil11
wants to merge
4
commits into
master
Choose a base branch
from
fix/run-picker-scenario-filter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
50bf336
fix(inference): scope run picker to selected scenario
cquil11 3ad2d0c
fix(inference): hide run picker when the scenario has no runs on the …
cquil11 541bd33
fix(inference): resolve scenario run state at the provider
cquil11 181a514
fix(api): invalidate stale workflow-info schema cache
cquil11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| import type { RunConfigRow } from './api'; | ||
| import { scenarioRunIdsForDate } from './run-configs'; | ||
|
|
||
| function row(overrides: Partial<RunConfigRow>): RunConfigRow { | ||
| return { | ||
| github_run_id: 1, | ||
| run_started_at: '2026-07-10T00:00:00Z', | ||
| html_url: null, | ||
| head_sha: null, | ||
| model: 'dsv4', | ||
| precision: 'fp4', | ||
| hardware: 'b200', | ||
| framework: 'sglang', | ||
| spec_method: 'none', | ||
| disagg: false, | ||
| benchmark_type: 'agentic_traces', | ||
| isl: null, | ||
| osl: null, | ||
| ...overrides, | ||
| }; | ||
| } | ||
|
|
||
| const ids = (rows: RunConfigRow[], sequence: string) => | ||
| [...scenarioRunIdsForDate(rows, ['dsv4'], sequence, ['fp4'])].toSorted(); | ||
|
|
||
| describe('scenarioRunIdsForDate', () => { | ||
| it('does not expose July 4 single-turn runs under Agentic Traces', () => { | ||
| const july4 = row({ | ||
| github_run_id: 28593351944, | ||
| benchmark_type: 'single_turn', | ||
| isl: 8192, | ||
| osl: 1024, | ||
| }); | ||
| expect(ids([july4], 'agentic-traces')).toEqual([]); | ||
| expect(ids([july4], '8k/1k')).toEqual(['28593351944']); | ||
| }); | ||
|
|
||
| it('includes a run in each scenario for which it produced data', () => { | ||
| const rows = [ | ||
| row({ github_run_id: 42 }), | ||
| row({ github_run_id: 42, benchmark_type: 'single_turn', isl: 8192, osl: 1024 }), | ||
| ]; | ||
| expect(ids(rows, 'agentic-traces')).toEqual(['42']); | ||
| expect(ids(rows, '8k/1k')).toEqual(['42']); | ||
| }); | ||
|
|
||
| it('filters by model and precision and deduplicates run IDs', () => { | ||
| const rows = [ | ||
| row({ github_run_id: 7 }), | ||
| row({ github_run_id: 7, hardware: 'b300' }), | ||
| row({ github_run_id: 8, model: 'glm5' }), | ||
| row({ github_run_id: 9, precision: 'fp8' }), | ||
| ]; | ||
| expect(ids(rows, 'agentic-traces')).toEqual(['7']); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { rowToSequence } from '@semianalysisai/inferencex-constants'; | ||
|
|
||
| import type { RunConfigRow } from './api'; | ||
|
|
||
| /** Run IDs with benchmark rows for the selected model, scenario, and precision. */ | ||
| export function scenarioRunIdsForDate( | ||
| runConfigs: RunConfigRow[], | ||
| modelDbKeys: string[], | ||
| sequence: string, | ||
| precisions: string[] = [], | ||
| ): Set<string> { | ||
| const selectedPrecisions = precisions.length > 0 ? new Set(precisions) : null; | ||
| const ids = new Set<string>(); | ||
| for (const row of runConfigs) { | ||
| if (!modelDbKeys.includes(row.model)) continue; | ||
| if (selectedPrecisions && !selectedPrecisions.has(row.precision)) continue; | ||
| if (rowToSequence(row) !== sequence) continue; | ||
| ids.add(String(row.github_run_id)); | ||
| } | ||
| return ids; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| import { resolveRunDate } from './run-date'; | ||
|
|
||
| describe('resolveRunDate', () => { | ||
| it('replaces a stale single-turn date with the latest agentic date', () => { | ||
| expect(resolveRunDate(['2026-07-09', '2026-07-10'], '2026-07-04', true)).toBe('2026-07-10'); | ||
| }); | ||
|
|
||
| it('preserves an available date chosen by the user', () => { | ||
| expect(resolveRunDate(['2026-07-09', '2026-07-10'], '2026-07-09', true)).toBe('2026-07-09'); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** Resolve a selected run date against the dates available for the active scenario. */ | ||
| export function resolveRunDate( | ||
| availableDates: string[], | ||
| selectedDate: string, | ||
| preserveSelected: boolean, | ||
| ): string { | ||
| if (availableDates.length === 0) return selectedDate; | ||
| if (preserveSelected && availableDates.includes(selectedDate)) return selectedDate; | ||
| return availableDates.at(-1)!; | ||
| } |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty coverage fallback
Medium Severity
availableRunsalways keeps only IDs fromscenarioRunIdsForDate, with no fallback whenrunConfigsis empty. Empty coverage (missing field, fixtures, or old snapshots) yields an empty set, so the picker andworkflowInfodisappear even though changelog runs exist. The intended path was to keep the changelog list only when the date has no coverage rows at all.Reviewed by Cursor Bugbot for commit 541bd33. Configure here.