Skip to content

FEAT: make benchmark runs additive - #27

Merged
merefield merged 7 commits into
mainfrom
codex/additive-benchmark-results
Aug 23, 2026
Merged

merefield merged 7 commits into
mainfrom
codex/additive-benchmark-results

Conversation

@merefield

@merefield merefield commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • retain benchmark results outside the scope of a new scoped run
  • replace matching result metadata instead of accumulating duplicate rows
  • clear the full result matrix before Run All and add an explicit Clear All action
  • keep current-run status separate from accumulated historical results
  • make scope editing transactional, with Cancel discarding changes and Done committing them
  • show Scope row highlighting only for keyboard interaction, using Bubble Tea input events to switch modality
  • separate Scope from the right-aligned run actions in the Benchmark controls
  • refresh embedded Standard API pricing from the official OpenAI pricing page, including GPT-5.6 Sol rates and the retrieval date

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 ./...

@merefield merefield changed the title [codex] make benchmark runs additive FEAT: make benchmark runs additive Aug 23, 2026
@merefield
merefield marked this pull request as ready for review August 23, 2026 04:28
@merefield
merefield requested a lite review from Copilot August 23, 2026 04:28

Copilot AI 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.

🟢 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.

Copilot AI 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.

🔵 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

  • upsertBenchmarkResult does a linear scan and recomputes benchmarkRunKey for 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

Copilot AI 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.

🟡 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

Comment thread internal/ui/model.go Resolved
@merefield
merefield merged commit 87680fc into main Aug 23, 2026
6 checks passed
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.

2 participants