Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 42 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ codexometer --codex /path/to/codex
| `s` | Start recording (Monitor view only) |
| `p` | Stop and take a final up-to-date reading (Monitor view only) |
| `b` | Run the selected challenge (Benchmark view only) |
| `a` | Arm, then confirm, Run All (Benchmark view only) |
| `[` / `]`, `Left` / `Right` | Select the previous or next benchmark challenge |
| `u` | Switch between the Core and Extended benchmark suites |
| `a` | Arm, then confirm, Run Suite (Benchmark view only) |
| `[` / `]`, `Left` / `Right` | Select the previous or next challenge in the active suite |
| `f` | Show all, passed, or failed benchmark results |
| `Page Up` / `Page Down` | Scroll through Benchmark result pages |
| `q` | Quit |
Expand Down Expand Up @@ -203,8 +204,8 @@ Select a tab with the mouse, `Tab`, or `Shift+Tab`:
and whose dark segment shows consumed capacity, labelled from Empty to Full;
one full-width tank appears per row. Its reset-cycle comparison also drains
backward and aligns exactly with the tank's first and last inner cells.
6. **Benchmark** — runs a selected hermetic coding challenge, or the complete
four-challenge suite, against every visible model and each reasoning effort
6. **Benchmark** — runs a selected hermetic coding challenge, or the active
Core or Extended suite, against every visible model and each reasoning effort
that model advertises. Results arrive sequentially in a table with task,
pass/fail, wall time, tokens, and estimated standard API-equivalent cost.
Filter the table to all, passed, or failed trials. Scroll a long result matrix
Expand Down Expand Up @@ -250,14 +251,18 @@ they should not be converted directly into the percentage gauges.
### Deterministic benchmark

The Benchmark tab discovers the current account's visible models and their
supported reasoning efforts through `model/list`. Select a challenge with the
arrow buttons, then press `b` or click **Run Selected** to run it against every
model/effort combination. **Run All** runs all four challenges against every
combination. Because that means `challenge count × model/effort count` model
turns, Codexometer displays the exact total and requires a second confirmation
within five seconds. A fresh, ephemeral, read-only app-server thread is used for
each trial, so benchmark history does not clutter normal Codex sessions. The
turns still consume the same account quota shown by Codexometer.
supported reasoning efforts through `model/list`. Press `u` or click the suite
button to switch between **Core** and **Extended**, then select a challenge with
the arrow buttons. Press `b` or click **Run Selected** to run it against every
model/effort combination. **Run Suite** runs all challenges in the active suite
against every combination. Because that means
`suite challenge count × model/effort count` model turns, Codexometer displays
the exact total and requires a second confirmation within five seconds. Keeping
the suites separate prevents the three expensive reasoning challenges from
silently increasing the cost of the default Core run. A fresh, ephemeral,
read-only app-server thread is used for each trial, so benchmark history does
not clutter normal Codex sessions. The turns still consume the same account
quota shown by Codexometer.

Each model/effort trial has a five-minute deadline. If an in-flight turn reaches
that deadline, Codexometer requests `turn/interrupt`, waits for the matching
Expand All @@ -266,16 +271,28 @@ the remaining combinations. Explicit user cancellation, app-server transport
failure, or failure to confirm interruption still stops the suite because the
server's state is then unsafe or unknown.

#### Challenges
#### Core challenges

Every trial asks the model to return one named Starlark function:

| Challenge | Required behavior | Verification set |
| --- | --- | --- |
| **Merge Ranges** | Sort inclusive integer ranges and merge every overlapping or adjacent pair into a canonical union. It must handle empty input, duplicates, nesting, negatives, and arbitrary order. | 8 hand-written edge cases + 48 reproducibly generated cases |
| **LRU Cache** | Process integer `put` and `get` operations, update recency, evict the least-recently-used entry, and return both get results and final entries in most-recently-used order. Capacity zero is valid. | 5 hand-written edge cases + 40 reproducibly generated cases |
| **Expression** | Evaluate tokenized non-negative integers with `+`, `-`, `*`, parentheses, normal precedence, and left associativity—without `eval`. | 8 hand-written edge cases + 40 reproducibly generated expressions |
| **Shortest Path** | Return the minimum four-direction move count through a rectangular blocked/open grid, or `-1` when no route exists. | 5 hand-written edge cases + 40 reproducibly generated mazes |
| **Merge Ranges (Easy)** | Sort inclusive integer ranges and merge every overlapping or adjacent pair into a canonical union. It must handle empty input, duplicates, nesting, negatives, and arbitrary order. | 8 hand-written edge cases + 48 reproducibly generated cases |
| **LRU Cache (Moderate)** | Process integer `put` and `get` operations, update recency, evict the least-recently-used entry, and return both get results and final entries in most-recently-used order. Capacity zero is valid. | 5 hand-written edge cases + 40 reproducibly generated cases |
| **Expression (Moderate)** | Evaluate tokenized non-negative integers with `+`, `-`, `*`, parentheses, normal precedence, and left associativity—without `eval`. | 8 hand-written edge cases + 40 reproducibly generated expressions |
| **Shortest Path (Moderate)** | Return the minimum four-direction move count through a rectangular blocked/open grid, or `-1` when no route exists. | 5 hand-written edge cases + 40 reproducibly generated mazes |

#### Extended challenges

Extended challenges deliberately combine more rules or require bounded search,
which should create more separation between models and reasoning efforts than
simply making the Core inputs larger.

| Challenge | Required behavior | Verification set |
| --- | --- | --- |
| **Dependency Scheduler (Hard)** | Find the minimum makespan for a small dependency DAG with job durations and a limited number of identical workers. Correct solutions must reason about precedence, concurrency, and cases where immediately starting every available job is not optimal. | 6 hand-written edge cases + 8 reproducibly generated DAGs |
| **Version Resolver (Hard)** | Select one version per package while satisfying inclusive dependency ranges and exact conflicts, then return the lexicographically greatest valid solution. | 5 hand-written edge cases + 12 reproducibly generated catalogs |
| **Event Processor (Hard)** | Reorder ledger events by sequence and apply idempotency, transfers, freezes, reversals, failure precedence, and a canonical audit result. | 5 hand-written edge cases + 10 reproducibly generated event streams |

#### How PASS and FAIL are decided

Expand All @@ -290,7 +307,8 @@ A row is `PASS` only when all of the following are true:
- the turn completes and returns the required strict JSON object containing
Starlark source;
- the source loads, defines the correctly named callable, and stays within the
64 KiB source and 250,000 execution-step limits;
64 KiB source limit and the per-case execution budget: 250,000 steps for Core
or 2,000,000 steps for Extended;
- every hand-written and generated case returns the exact reference answer with
the required type and bounded shape; and
- the turn does not emit a tool-use item; and
Expand Down Expand Up @@ -473,10 +491,11 @@ need Go or Codexometer's source dependencies.

## Versioning

Codexometer follows semantic versioning; the current source version is `v0.2.1`. The Git tag is
the release source of truth. Go automatically embeds that tag in binaries built
with `go install github.com/merefield/codexometer@v0.2.1`; direct source builds
fall back to the maintained value in `internal/version/version.go`.
Codexometer follows semantic versioning; the current source version is
`v0.3.0`. The Git tag is the release source of truth. Go automatically embeds
that tag in binaries built with
`go install github.com/merefield/codexometer@v0.3.0`; direct source builds fall
back to the maintained value in `internal/version/version.go`.

Both forms report the embedded version and exit without starting the interface:

Expand All @@ -488,7 +507,7 @@ codexometer --version
Release automation can override the source-build fallback without editing code:

```sh
go build -ldflags="-s -w -X github.com/merefield/codexometer/internal/version.Fallback=0.2.1" .
go build -ldflags="-s -w -X github.com/merefield/codexometer/internal/version.Fallback=0.3.0" .
```

## How refresh works
Expand Down
10 changes: 6 additions & 4 deletions internal/codex/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
)

const (
benchmarkTurnTimeout = 5 * time.Minute
benchmarkInterruptTimeout = 15 * time.Second
benchmarkCodeLimit = 64 * 1024
benchmarkStepLimit = 250_000
benchmarkTurnTimeout = 5 * time.Minute
benchmarkInterruptTimeout = 15 * time.Second
benchmarkCodeLimit = 64 * 1024
benchmarkStepLimit = 250_000
benchmarkExtendedStepLimit = 2_000_000
)

// BenchmarkUsage is the app-server token breakdown for one isolated turn.
Expand Down Expand Up @@ -993,6 +994,7 @@ func verifyMergeRanges(code string) error {
for index, input := range intervalTestCases() {
argument := intervalsToStarlark(input)
before := argument.String()
renewBenchmarkStepBudget(thread)
value, err := starlark.Call(thread, function, starlark.Tuple{argument}, nil)
if err != nil {
return fmt.Errorf("case %d raised an error: %w", index+1, err)
Expand Down
Loading
Loading