Repository navigation
FEAT: make benchmark runs additive - #27
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral changes are cohesive, have targeted unit test coverage for the new UI/result semantics, and the pricing refresh is consistently applied across code and docs.
Pull request overview
This PR updates the benchmark UI/data flow so scoped runs preserve out-of-scope historical results while replacing in-scope rows (instead of appending duplicates), adds explicit “Clear All” behavior for the full result matrix, makes scope editing cancelable/transactional, and refreshes the embedded Standard API pricing retrieval date/rates.
Changes:
- Make benchmark result accumulation additive across runs by upserting results and retaining out-of-scope rows on scoped runs (while “Run All” clears everything).
- Add explicit “Clear All” action for the result matrix and separate “current run” results for status messaging.
- Implement transactional scope editing (Cancel discards; Done commits) and refresh compiled pricing metadata/rates.
File summaries
| File | Description |
|---|---|
| README.md | Updates the documented Standard API pricing retrieval date. |
| internal/ui/model.go | Tracks per-run results separately, upserts results by run key, retains out-of-scope historical rows on scoped runs, and adds a clear-all reset path. |
| internal/ui/benchmark.go | Updates scope editor UX to Cancel/Done actions, adds Clear All control wiring, and ensures status reflects current-run results. |
| internal/ui/benchmark_test.go | Adds/updates UI behavior tests for Clear All, upsert semantics, scoped retention, and transactional scope editing. |
| internal/codex/benchmark.go | Refreshes Standard API pricing retrieval date and updates GPT-5.6 Sol price constants. |
| internal/codex/benchmark_test.go | Updates pricing-based expectation to match refreshed GPT-5.6 Sol rates. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
The new per-event result upsert path is O(N²) over run size and may cause noticeable UI lag for large benchmark scopes unless optimized.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
internal/ui/model.go:1285
upsertBenchmarkResultdoes a linear scan and recomputesbenchmarkRunKeyfor every existing element on every event. Over a run with N unique results, this turns result collection into O(N^2) work (and does extra allocations for key strings), which can noticeably degrade UI responsiveness for large scopes / Run All.
func upsertBenchmarkResult(results []codex.BenchmarkResult, result codex.BenchmarkResult) []codex.BenchmarkResult {
key := benchmarkRunKey(result)
for index := range results {
if benchmarkRunKey(results[index]) == key {
results[index] = result
return results
}
}
return append(results, result)
- Files reviewed: 6/6 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
A verified UI state bug can incorrectly enable Scope keyboard highlighting after pressing s during an active run, causing mouse-opened Scope to render with the wrong modality.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
What changed
Why
Benchmark results should remain useful across targeted runs while still giving users explicit reset behavior. Scope editing also needs conventional Cancel semantics so exploratory changes do not silently alter the next run. Embedded API-equivalent estimates should identify and use the latest verified published rates.
Validation
go test ./...