Back to the coding-agent index
Other run of this benchmark: WSL run, 2026-11-20
Benchmark: Fix a newest-first story sort
Run of 2026-11-20 on the Backprop VPS. One workload on the Backprop VPS (8 vCPUs, 23 GB memory), three attempts per setup, scored as submitted by nine hidden tests.
On this VPS, Claude Code passed all nine tests in each of three attempts. Codex CLI’s sandbox failed to start in all three attempts, so it produced no patch. The untouched fixture passed three of nine tests. The model comparison is inconclusive.
Setups: Claude Code 2.1.329 with claude-opus-5-5; Codex CLI 0.168.0 with gpt-6.1-sol. Time limit 600 seconds per attempt; each attempt started from a fresh copy of the broken fixture.
Baseline: the untouched broken fixture scores 3/9 (failing C01, C02, C03, C04, C05, C09). An attempt that produces no patch gets exactly this score. Open the baseline scorer output (JSON)
| Setup | Model | Attempt | Score | Elapsed | Completion | Dollar figure | Evidence |
|---|---|---|---|---|---|---|---|
| Claude Code | claude-opus-5-5 | 1 | 9/9 | 64.4 s | Completed | $0.39 (CLI estimate) | Patch · Scorer output |
| Claude Code | claude-opus-5-5 | 2 | 9/9 | 63.9 s | Completed | $0.40 (CLI estimate) | Patch · Scorer output |
| Claude Code | claude-opus-5-5 | 3 | 9/9 | 53.2 s | Completed | $0.35 (CLI estimate) | Patch · Scorer output |
| Codex CLI | gpt-6.1-sol | 1 | 3/9 | 41.2 s | Completed; sandbox failed, no patch produced | not reported | No patch · Scorer output |
| Codex CLI | gpt-6.1-sol | 2 | 3/9 | 51.3 s | Completed; sandbox failed, no patch produced | not reported | No patch · Scorer output |
| Codex CLI | gpt-6.1-sol | 3 | 3/9 | 27.8 s | Completed; sandbox failed, no patch produced | not reported | No patch · Scorer output |
Claude Code's dollar figures are the CLI's own estimates at list prices; the run used included subscription usage, not a billed API. Codex CLI reports no cost.
Why Codex CLI produced no patch
In all three attempts on this VPS, Codex CLI’s sandbox failed to start. Codex runs its shell commands and file edits inside that sandbox, so its commands failed before they ran and its edit tool could not write sort-stories.js. Codex CLI’s sandbox prevented it from writing a patch.
Each attempt still ended normally (exit code 0) with no file changed, so each scored 3/9: exactly the score of the untouched fixture. Codex’s own messages described the intended fix, but it was never applied.
The cause was this host’s security settings, not the quality of a fix: the same sandbox also failed to start on this VPS with no model involved.
Verdict (this workload only)
Claude Code passed all nine tests in each of three attempts. Codex CLI’s 3/9 scores record its sandbox failure, not an incorrect fix. This run cannot compare the two models: the model comparison is inconclusive.
Patches and scorer output
Each patch and scorer output below is the saved file from this run, shown and linked exactly as saved. Scores come from each attempt's scorer output.
Claude Code attempt 1: claude-code/attempt-1.patch
diff --git a/sort-stories.js b/sort-stories.js
index d7e703e..a6cea9a 100644
--- a/sort-stories.js
+++ b/sort-stories.js
@@ -1,9 +1,80 @@
// Sort synthetic news stories newest first by their publication time.
// A story is { id, title, published_at }, where published_at is an ISO 8601 timestamp with an explicit UTC offset.
+
+// YYYY-MM-DDThh:mm[:ss[.fraction]] followed by Z or a ±hh:mm / ±hhmm offset.
+// Strict on purpose: Date.parse also accepts offset-less strings (read as local
+// time), out-of-range days like Feb 30 (silently rolled over) and free-form text.
+const ISO_WITH_OFFSET =
+ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/i;
+
+const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+
+function daysInMonth(year, month) {
+ const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ return month === 2 && isLeapYear ? 29 : DAYS_IN_MONTH[month - 1];
+}
+
+// Returns { ms, sub } for a valid timestamp, or null if missing/invalid.
+// ms is the instant in whole milliseconds since the epoch; sub holds any
+// fractional-second digits beyond milliseconds, so finer precision still orders correctly.
+function parseInstant(value) {
+ if (typeof value !== "string") return null;
+ const m = ISO_WITH_OFFSET.exec(value);
+ if (!m) return null;
+
+ const year = Number(m[1]);
+ const month = Number(m[2]);
+ const day = Number(m[3]);
+ const hour = Number(m[4]);
+ const minute = Number(m[5]);
+ const second = m[6] === undefined ? 0 : Number(m[6]);
+ const fraction = m[7] ?? "";
+
+ if (month < 1 || month > 12) return null;
+ if (day < 1 || day > daysInMonth(year, month)) return null;
+ if (minute > 59 || second > 59) return null;
+ // 24:00[:00] is ISO 8601's "end of day" and equals 00:00 of the next day.
+ if (hour > 24 || (hour === 24 && (minute !== 0 || second !== 0 || /[1-9]/.test(fraction)))) return null;
+
+ let offsetMinutes = 0;
+ if (!m[8]) {
+ const offHours = Number(m[10]);
+ const offMins = Number(m[11]);
+ if (offHours > 23 || offMins > 59) return null;
+ offsetMinutes = (m[9] === "-" ? -1 : 1) * (offHours * 60 + offMins);
+ }
+
+ const millis = Number(fraction.slice(0, 3).padEnd(3, "0"));
+ // setUTCFullYear avoids Date.UTC's mapping of years 0-99 to 1900-1999.
+ const date = new Date(0);
+ date.setUTCFullYear(year, month - 1, day);
+ date.setUTCHours(hour, minute, second, millis);
+
+ return {
+ ms: date.getTime() - offsetMinutes * 60_000,
+ sub: fraction.slice(3).replace(/0+$/, ""),
+ };
+}
+
+function compareInstants(a, b) {
+ if (a.ms !== b.ms) return a.ms - b.ms;
+ const len = Math.max(a.sub.length, b.sub.length);
+ const subA = a.sub.padEnd(len, "0");
+ const subB = b.sub.padEnd(len, "0");
+ return subA < subB ? -1 : subA > subB ? 1 : 0;
+}
+
export function sortStoriesNewestFirst(stories) {
- return stories.slice().sort((a, b) => {
- if (a.published_at < b.published_at) return 1;
- if (a.published_at > b.published_at) return -1;
- return 0;
- });
+ return stories
+ .map((story, index) => ({ story, index, instant: parseInstant(story?.published_at) }))
+ .sort((a, b) => {
+ if (a.instant && b.instant) {
+ const byTime = compareInstants(b.instant, a.instant); // newest first
+ if (byTime !== 0) return byTime;
+ } else if (a.instant || b.instant) {
+ return a.instant ? -1 : 1; // valid dates before missing/invalid ones
+ }
+ return a.index - b.index; // same instant, or both invalid: keep input order
+ })
+ .map((entry) => entry.story);
}
Claude Code attempt 1: claude-code/attempt-1.score.json (9/9)
All nine cases pass. Open the scorer output (JSON)
Claude Code attempt 2: claude-code/attempt-2.patch
diff --git a/sort-stories.js b/sort-stories.js
index d7e703e..7ea875c 100644
--- a/sort-stories.js
+++ b/sort-stories.js
@@ -1,9 +1,78 @@
// Sort synthetic news stories newest first by their publication time.
// A story is { id, title, published_at }, where published_at is an ISO 8601 timestamp with an explicit UTC offset.
+
+// ISO 8601 extended-format date-time with a mandatory UTC offset ("Z" or ±hh:mm).
+// Seconds and fractional seconds are optional.
+const ISO_WITH_OFFSET =
+ /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(?:([Zz])|([+-])(\d{2}):(\d{2}))$/;
+
+const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+
+function daysInMonth(year, month) {
+ const isLeap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ return month === 2 && isLeap ? 29 : DAYS_IN_MONTH[month - 1];
+}
+
+// Parses published_at into a comparable instant, or returns null if it is missing or invalid.
+// The instant is { seconds, fraction }: whole seconds since the Unix epoch, plus the fractional-second
+// digits with trailing zeros removed, so sub-millisecond precision is not lost.
+// Date.parse is not used directly because it silently accepts offset-less (local-time) strings,
+// non-ISO formats and impossible dates such as February 30.
+function parseInstant(value) {
+ if (typeof value !== "string") return null;
+ const m = ISO_WITH_OFFSET.exec(value);
+ if (!m) return null;
+
+ const [, y, mo, d, h, mi, s = "0", frac = "", zulu, sign, oh, om] = m;
+ const year = Number(y);
+ const month = Number(mo);
+ const day = Number(d);
+ const hour = Number(h);
+ const minute = Number(mi);
+ const second = Number(s);
+ const offsetHours = zulu ? 0 : Number(oh);
+ const offsetMinutes = zulu ? 0 : Number(om);
+
+ if (month < 1 || month > 12) return null;
+ if (day < 1 || day > daysInMonth(year, month)) return null;
+ if (hour > 23 || minute > 59 || second > 59) return null;
+ if (offsetHours > 23 || offsetMinutes > 59) return null;
+
+ const offsetSeconds = (sign === "-" ? -1 : 1) * (offsetHours * 3600 + offsetMinutes * 60);
+ // Date.UTC treats years 0-99 as 1900-1999, so set the full year explicitly.
+ const date = new Date(Date.UTC(2000, month - 1, day, hour, minute, second));
+ date.setUTCFullYear(year);
+ const seconds = date.getTime() / 1000 - offsetSeconds;
+
+ return { seconds, fraction: frac.replace(/0+$/, "") };
+}
+
+// Negative if instant a is earlier than b, positive if later, 0 if the same instant.
+function compareInstants(a, b) {
+ if (a.seconds !== b.seconds) return a.seconds - b.seconds;
+ // Fraction digit strings without trailing zeros compare correctly lexicographically.
+ if (a.fraction === b.fraction) return 0;
+ return a.fraction < b.fraction ? -1 : 1;
+}
+
export function sortStoriesNewestFirst(stories) {
- return stories.slice().sort((a, b) => {
- if (a.published_at < b.published_at) return 1;
- if (a.published_at > b.published_at) return -1;
- return 0;
+ const decorated = stories.map((story, index) => ({
+ story,
+ index,
+ instant: parseInstant(story?.published_at),
+ }));
+
+ decorated.sort((a, b) => {
+ if (a.instant && b.instant) {
+ const byInstant = compareInstants(b.instant, a.instant); // newest first
+ if (byInstant !== 0) return byInstant;
+ } else if (a.instant) {
+ return -1; // valid dates before missing/invalid ones
+ } else if (b.instant) {
+ return 1;
+ }
+ return a.index - b.index; // ties keep input order
});
+
+ return decorated.map((entry) => entry.story);
}
Claude Code attempt 2: claude-code/attempt-2.score.json (9/9)
All nine cases pass. Open the scorer output (JSON)
Claude Code attempt 3: claude-code/attempt-3.patch
diff --git a/sort-stories.js b/sort-stories.js
index d7e703e..c90642a 100644
--- a/sort-stories.js
+++ b/sort-stories.js
@@ -1,9 +1,72 @@
// Sort synthetic news stories newest first by their publication time.
// A story is { id, title, published_at }, where published_at is an ISO 8601 timestamp with an explicit UTC offset.
+
+// YYYY-MM-DDTHH:MM[:SS[.fraction]] followed by Z or a ±HH:MM / ±HHMM offset.
+const ISO_WITH_OFFSET =
+ /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(?:([Zz])|([+-])(\d{2}):?(\d{2}))$/;
+
+// Parses published_at into a comparable instant, or returns null when it is
+// missing or not a valid ISO 8601 timestamp with an explicit offset.
+// Date.parse is deliberately avoided: it accepts non-ISO formats, treats
+// offset-less timestamps as local time, and rolls over impossible dates
+// such as February 30.
+function parseInstant(value) {
+ if (typeof value !== "string") return null;
+ const m = ISO_WITH_OFFSET.exec(value);
+ if (!m) return null;
+
+ const [, y, mo, d, h, mi, s = "0", frac = "", z, sign, oh, om] = m;
+ const year = Number(y);
+ const month = Number(mo);
+ const day = Number(d);
+ const hour = Number(h);
+ const minute = Number(mi);
+ const second = Number(s);
+
+ if (month < 1 || month > 12) return null;
+ const daysInMonth = new Date(Date.UTC(year, month, 0)).getUTCDate();
+ if (day < 1 || day > daysInMonth) return null;
+ if (hour > 23 || minute > 59 || second > 59) return null;
+
+ let offsetMinutes = 0;
+ if (!z) {
+ const offH = Number(oh);
+ const offM = Number(om);
+ if (offH > 23 || offM > 59) return null;
+ offsetMinutes = (sign === "+" ? 1 : -1) * (offH * 60 + offM);
+ }
+
+ // Date.UTC maps years 0-99 to 1900-1999, so set the full year explicitly.
+ const date = new Date(Date.UTC(2000, month - 1, day, hour, minute, second));
+ date.setUTCFullYear(year);
+ const wholeMs = date.getTime() - offsetMinutes * 60_000;
+
+ // Keep sub-second precision exactly: milliseconds plus the remaining digits.
+ const fracDigits = frac.padEnd(3, "0");
+ const ms = wholeMs + Number(fracDigits.slice(0, 3));
+ const subMs = fracDigits.length > 3 ? Number("0." + fracDigits.slice(3)) : 0;
+ return { ms, subMs };
+}
+
export function sortStoriesNewestFirst(stories) {
- return stories.slice().sort((a, b) => {
- if (a.published_at < b.published_at) return 1;
- if (a.published_at > b.published_at) return -1;
- return 0;
+ const decorated = stories.map((story, index) => ({
+ story,
+ index,
+ instant: parseInstant(story?.published_at),
+ }));
+
+ decorated.sort((a, b) => {
+ // Valid dates first; invalid or missing ones after, in input order.
+ const aValid = a.instant !== null;
+ const bValid = b.instant !== null;
+ if (aValid !== bValid) return aValid ? -1 : 1;
+ if (!aValid) return a.index - b.index;
+ // Newest first.
+ if (a.instant.ms !== b.instant.ms) return b.instant.ms - a.instant.ms;
+ if (a.instant.subMs !== b.instant.subMs) return b.instant.subMs - a.instant.subMs;
+ // Same instant: keep input order.
+ return a.index - b.index;
});
+
+ return decorated.map((entry) => entry.story);
}
Claude Code attempt 3: claude-code/attempt-3.score.json (9/9)
All nine cases pass. Open the scorer output (JSON)
Codex CLI attempt 1: codex-cli/attempt-1.score.json (3/9)
Failing cases: C01, C02, C03, C04, C05, C09. Open the scorer output (JSON)
Codex CLI attempt 2: codex-cli/attempt-2.score.json (3/9)
Failing cases: C01, C02, C03, C04, C05, C09. Open the scorer output (JSON)
Codex CLI attempt 3: codex-cli/attempt-3.score.json (3/9)
Failing cases: C01, C02, C03, C04, C05, C09. Open the scorer output (JSON)