feat(benchsdk): add optional display manifest to BenchmarkConfig and upload it on upsert - #389
Open
dtice25 wants to merge 5 commits into
Open
feat(benchsdk): add optional display manifest to BenchmarkConfig and upload it on upsert#389dtice25 wants to merge 5 commits into
dtice25 wants to merge 5 commits into
Conversation
…hmark - Add optional BenchmarkConfig.display spec with metrics, steps, and overview defaults. - Validate display manifest in defineBenchmarkConfig. - Upload display config into benchmarks.config JSONB on upsert. - Export display types from @benchsdk/runner. - Add display manifest to browser-lifecycle benchmark. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…arks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor License AgreementAll contributors are covered by a CLA. |
…ed metrics Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Make optional in and treat as the canonical source of metric metadata. now resolves each scoring metric's unit from the display manifest at runtime, falling back to the scoring metric's own unit and then to an empty string. no longer requires ; when both and declare the same key, it validates that their units do not conflict. Updated , , and the template to remove duplicate declarations from and rely on instead. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
Makes the
*.bench.tsfile the source of truth for both display and scoring metadata. This PR adds an optionaldisplaymanifest toBenchmarkConfigand also makesscoring.metricsunit metadata derive fromdisplay.metrics, removing the risk that the two config blocks drift.What changed
packages/benchsdk-runner/src/bench-config.tsdisplay?: BenchmarkDisplayConfigtoBenchmarkConfig.BenchmarkDisplayConfigcarriesmetrics,steps, andoverviewdefaults.defineBenchmarkConfigvalidates the manifest shape and rejects unknown metric display fields.validateBenchmarkScoringConfignow accepts an optionaldisplayargument:scoring.metrics[i].unitis optional, and when bothscoringanddisplaydeclare the same key the units must match.packages/benchsdk-runner/src/scoring.tsBenchmarkScoringMetric.unitandMetricScoring.unitare now optional.scoringConfigToSpec(config, dimensions, display)resolves each scoring metric's unit from the matchingdisplay.metricsentry, falling back tometric.unit, then defaulting to an empty string.lowerIsBetter/higherIsBetteraccept an optionalunitso existingonScorecallbacks keep working.packages/benchsdk-runner/src/runner.tsconfig.displayintoscoringConfigToSpecso runtime scoring uses the canonical display unit.packages/benchsdk-runner/src/__tests__/bench-config.test.tsandsrc/__tests__/scoring.test.tsbenchmarks/browser/browser.bench.ts,benchmarks/sandbox/tti.bench.ts,packages/create-bench/src/index.tsunitfromscoring.metricsand left it ondisplay.metricsonly.Why
Previously the platform had to know about each benchmark's metrics in
custom-metrics.tsand title-cased step names. Now the author declares labels, units, sort direction, and default overview layout in the same file that defines the workload, andscoringcan reference those metrics without duplicating unit metadata.Backwards compatibility
displayis optional. Benchmarks without it continue to use existing platform-side fallbacks (METRIC_DISPLAYand title-cased step names).scoring.metrics[i].unitis still accepted whendisplayis absent.Link to Devin session: https://app.devin.ai/sessions/a45e3a08012c47e989ccfc4c055275ac
Open in Devin Desktop: https://app.devin.ai/desktop/session/a45e3a08012c47e989ccfc4c055275ac?variant=devin
Requested by: @dtice25