← Model losses

Head-to-head comparison

openai / gpt-6-luna / max / max effort preferred over openai / gpt-6-luna / low / low effort · close win.

Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.

Reviewed public evidence

Task goal

Design a pure utility converting nonnegative integer milliseconds into human-readable durations for a monitoring UI. Requirements: deterministic locale-neutral formatting, round-to-nearest-second ties upward, correct carries, day/hour/minute/second boundaries, maximum safe integer input, explicit invalid input handling, compact and expanded modes, and no calendar/timezone/date interpretation. Provide contracts and boundary examples.

Give one coherent design with explicit requirements, assumptions and alternatives, state/invariant/transaction details appropriate to the stated scope, and measurable pass/fail acceptance checks. Do not invent benchmark measurements, provider costs, source inspection, executed tests or objective passes. Every contributor must independently answer the complete identical question; there are no separate roles, files or tool evidence.

openai / gpt-6-luna / max / max effort answer

## Recommendation

Define a stateless `formatDuration(ms, mode = "compact")` with two fixed output modes:

- **Compact:** `1d 2h 3m 4s`
- **Expanded:** `1 day, 2 hours, 3 minutes, 4 seconds`

Use fixed English labels and ASCII abbreviations—not locale-aware formatting. Treat one day as exactly 86,400 seconds. This is elapsed-duration formatting only; it has no calendar, timezone, or date interpretation.

### Contract

- Accept only JavaScript numbers that are nonnegative safe integers, from `0` through `Number.MAX_SAFE_INTEGER` inclusive. Treat `-0` as zero.
- Accept only `"compact"` or `"expanded"` for `mode`; omitted mode means `"compact"`.
- Throw `TypeError` if `ms` is not a number or `mode` is unsupported. Throw `RangeError` if `ms` is negative, fractional, non-finite, or unsafe. Validate `ms` before `mode`.
- Round the **total** duration to the nearest second, with ties upward. Compute quotient and remainder exactly:
  - `q = floor(ms / 1000)`, `r = ms mod 1000`
  - rounded seconds = `q + (r >= 500 ? 1 : 0)`
- In JavaScript, use `BigInt(ms)` for quotient/remainder and decomposition after validating the number. This avoids precision errors near the maximum safe integer and avoids adding 500 to the input.
- Decompose rounded seconds into days, hours, minutes, and seconds. Omit zero-valued units; if the result is zero, emit `0s` or `0 seconds`. In expanded mode, use singular only for a value of one. List units largest to smallest, separated by spaces in compact mode and comma-space in expanded mode.

The decomposition invariant is `T = 86400d + 3600h + 60m + s`, with `0 ≤ h < 24`, `0 ≤ m < 60`, and `0 ≤ s < 60`. Rounding the total first ensures carries across second, minute, hour, and day boundaries.

### Boundary examples

| Input (ms) | Compact | Expanded |
|---:|---|---|
| `0` | `0s` | `0 seconds` |
| `499` | `0s` | `0 seconds` |
| `500` | `1s` | `1 second` |
| `59,499` | `59s` | `59 seconds` |
| `59,500` | `1m` | `1 minute` |
| `3,599,499` | `59m 59s` | `59 minutes, 59 seconds` |
| `3,599,500` | `1h` | `1 hour` |
| `86,399,499` | `23h 59m 59s` | `23 hours, 59 minutes, 59 seconds` |
| `86,399,500` | `1d` | `1 day` |
| `Number.MAX_SAFE_INTEGER` | `104249991d 8h 59m 1s` | `104249991 days, 8 hours, 59 minutes, 1 second` |

### State and failure behavior

The utility has no persistent state, I/O, or external effects. It either returns one complete string or throws during validation; it does not produce partial output or modify its input.

### Acceptance checks

These are proposed conformance checks, not tests claimed to have been run:

1. Exact outputs match the table in both modes.
2. Inputs `-1`, `1.5`, `NaN`, `Infinity`, and `Number.MAX_SAFE_INTEGER + 1` throw `RangeError`; a string input throws `TypeError`; an unsupported mode throws `TypeError`.
3. For inputs `1000q + r` within the valid range, test every `r` from `0` through `999` for selected `q` values around `59`, `60`, `3599`, `3600`, `86399`, `86400`, and the maximum input. The rounded result must be `q + 1` exactly when `r >= 500`.
4. For each valid result, decomposition reconstructs the rounded total and satisfies the stated component bounds; formatting omits zero units except for the all-zero result.
5. Repeated calls with the same arguments produce byte-identical output, independent of locale settings. The implementation must not use locale, date, timezone, or clock APIs.

**Alternatives:** A UI could prefer `HH:MM:SS` or a `Result` return value instead of exceptions, but those change the output or error contract. The fixed-unit strings and thrown validation errors above provide one unambiguous design.

**Evidence and dependencies:** This is based only on the supplied requirements; no source path or implementation was provided, and no tests were run. The contract is ready to implement; the next useful step is to add the acceptance checks for the chosen language.

openai / gpt-6-luna / low / low effort answer

## Recommended design

Provide a pure function with explicit input validation and two output modes:

```text
formatDuration(milliseconds, mode = "compact") -> string
```

**Contract and assumptions**

- Accept only nonnegative safe integers (`0` through `Number.MAX_SAFE_INTEGER`). Reject other values, including fractions, negatives, `NaN`, infinities, strings, and unsafe integers, with a documented `RangeError` or equivalent.
- Round to the nearest second, with exact half-second ties upward, before decomposing into units. For nonnegative inputs, use `floor((milliseconds + 500) / 1000)`, taking care that the intermediate addition does not exceed the exact integer range. An alternative is quotient/remainder rounding, which avoids that intermediate overflow.
- Decompose total seconds into days, hours, minutes, and seconds using fixed units: 86,400; 3,600; and 60 seconds. Do not use dates, calendars, or timezones.
- Make formatting locale-neutral: fixed unit labels, numeric digits, spacing, and ordering; no locale APIs.
- Compact mode emits nonzero units with short labels, such as `1d 2h 3m 4s`. Expanded mode emits nonzero units with full labels and fixed pluralization, such as `1 day, 2 hours, 3 minutes, 4 seconds`. Specify zero behavior explicitly: recommend `0s` and `0 seconds` when the rounded duration is zero. Omit zero-valued units otherwise.
- Reject unsupported modes explicitly rather than silently selecting one.

The operation is stateless and has no transaction or mutable-state requirements. Its key invariant is that after rounding, the emitted units represent exactly the rounded total seconds, with each subordinate unit below its radix (hours < 24, minutes < 60, seconds < 60). Carrying follows naturally from quotient/remainder decomposition.

## Boundary examples

- `0 ms` → `0s` / `0 seconds`
- `499 ms` → `0s` / `0 seconds`
- `500 ms` → `1s` / `1 second`
- `59,499 ms` → `59s` / `59 seconds`
- `59,500 ms` → `1m` / `1 minute`
- `3,599,500 ms` → `1h` / `1 hour`
- `86,399,500 ms` → `1d` / `1 day`
- `Number.MAX_SAFE_INTEGER` is accepted and formatted by the same fixed-unit decomposition.

## Acceptance checks

Pass if tests establish that: valid safe-integer inputs return deterministic strings in both modes; locale changes do not affect output; all listed rounding ties and unit carries behave as specified; zero and pluralization follow the contract; invalid inputs and invalid modes fail explicitly; and the maximum safe integer is handled without precision loss. Also verify decomposition by parsing or independently recomputing units and confirming they reconstruct the rounded second count. No implementation or test execution is claimed here.

## Alternatives and dependencies

A design could retain zero-valued intermediate units (for example, `1h 0m 2s`) or use different labels, but that should be a deliberate documented contract; omitting them is more compact. The task does not specify exact labels, exception type, or zero-unit policy, so these are design choices rather than established requirements. No source evidence or execution results were supplied; implementation-specific conclusions remain unverified.

Primary judge's stated reason

B is a forced, weak preference because its maximum-input example provides a concrete conformance target where A provides a general acceptance condition. This is a practical verification advantage, not an established material quality gap; an independent review could reasonably favor A's sufficient, less prescriptive design.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: 585c0981-9fac-4115-8abf-75261811b5a0. Pair: brp1_10b4bb574583ff59384209e173302c2a0f835a7b53de5515c061ec12adaa4539. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.