← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / low / low effort preferred over openai / gpt-6-luna / max / max 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.1-sol / low / low effort answer

## Recommended contract

A pure JavaScript/TypeScript utility:

```ts
formatDuration(
  milliseconds: number,
  mode: "compact" | "expanded" = "compact"
): string
```

- Accept only finite, nonnegative safe integers: `0 ≤ milliseconds ≤ Number.MAX_SAFE_INTEGER`.
- Accept `-0` as zero.
- No coercion: strings, `bigint`, objects, `null`, and other nonnumbers throw `TypeError`.
- Numeric values outside the domain—including `NaN`, infinities, fractions, and negatives—throw `RangeError`.
- An unsupported mode throws `TypeError`. Validate milliseconds first, then mode.
- Round to the nearest whole second; exactly 500 milliseconds rounds upward.
- A minute is exactly 60 seconds, an hour 3,600 seconds, and a day 86,400 seconds. Days are unbounded; there are no weeks, months, or years.
- Use fixed ASCII digits, spaces, and English labels—not locale APIs, dates, timezones, or calendar arithmetic.

### Output grammar

**Compact:** Emit nonzero components in descending order, separated by one ASCII space, using `d`, `h`, `m`, `s`. Zero is `"0s"`.

**Expanded:** Always emit all four components, separated by one ASCII space. Use singular only when the count equals one:

```text
1 day 0 hours 2 minutes 1 second
```

There are no grouping separators, leading zeros, leading/trailing spaces, or terminal punctuation.

## Arithmetic and invariants

After validation:

```text
wholeSeconds = floor(milliseconds / 1000)
remainderMs  = milliseconds - wholeSeconds * 1000
secondsTotal = wholeSeconds + (remainderMs >= 500 ? 1 : 0)

days         = floor(secondsTotal / 86400)
remainder    = secondsTotal - days * 86400
hours        = floor(remainder / 3600)
remainder    = remainder - hours * 3600
minutes      = floor(remainder / 60)
seconds      = remainder - minutes * 60
```

Avoid `floor((milliseconds + 500) / 1000)`: the addition can exceed the safe-integer range.

Required invariants:

- `0 ≤ remainderMs < 1000`.
- `days ≥ 0`; `0 ≤ hours < 24`; `0 ≤ minutes, seconds < 60`.
- All counts are integers.
- `secondsTotal = days × 86400 + hours × 3600 + minutes × 60 + seconds`.
- Rounding happens once, before decomposition; carries therefore occur naturally.
- All intermediate integer quantities stay within the safe-integer range.

There is no persistent state, mutation, I/O, clock access, or transaction. Each call either returns the complete string or throws; it never produces partial output.

## Boundary examples

| Milliseconds | Compact | Expanded |
|---:|---|---|
| 0 | `0s` | `0 days 0 hours 0 minutes 0 seconds` |
| 499 | `0s` | `0 days 0 hours 0 minutes 0 seconds` |
| 500 | `1s` | `0 days 0 hours 0 minutes 1 second` |
| 1,499 | `1s` | `0 days 0 hours 0 minutes 1 second` |
| 1,500 | `2s` | `0 days 0 hours 0 minutes 2 seconds` |
| 59,499 | `59s` | `0 days 0 hours 0 minutes 59 seconds` |
| 59,500 | `1m` | `0 days 0 hours 1 minute 0 seconds` |
| 3,599,499 | `59m 59s` | `0 days 0 hours 59 minutes 59 seconds` |
| 3,599,500 | `1h` | `0 days 1 hour 0 minutes 0 seconds` |
| 86,399,499 | `23h 59m 59s` | `0 days 23 hours 59 minutes 59 seconds` |
| 86,399,500 | `1d` | `1 day 0 hours 0 minutes 0 seconds` |
| 86,400,500 | `1d 1s` | `1 day 0 hours 0 minutes 1 second` |
| 9,007,199,254,740,991 | `104249991d 8h 59m 1s` | `104249991 days 8 hours 59 minutes 1 second` |

## Measurable acceptance checks

Pass only if:

1. Every table entry matches byte-for-byte in both modes.
2. For each boundary `B ∈ {60,000, 3,600,000, 86,400,000}`, inputs `B−501`, `B−500`, `B−1`, and `B` produce the expected pre-carry/carry results.
3. Invalid-input tests produce the specified exception classes; `-0` matches zero.
4. A property test uses an independent `bigint` oracle:
   ```text
   expectedSeconds = (BigInt(milliseconds) + 500n) / 1000n
   ```
   Reconstructed component totals must equal that oracle, including near the maximum input.
5. Component ranges, output grammar, pluralization, and determinism hold for every tested valid input.
6. The implementation uses no calendar, timezone, locale, clock, or external-state dependency.

## Alternatives and evidence limits

Fixed-width compact output such as `1d 00h 00m 01s` offers stronger visual alignment but is less compact. Returning a tagged error instead of throwing is reasonable if the surrounding API follows that convention. Supporting `bigint` would permit larger durations but is a separate contract, not implicit coercion.

Confidence is high in this arithmetic design. No source implementation or executed tests were supplied; the examples and checks above are proposed expectations, not observed passes. The next useful action is to implement the contract and run the boundary suite plus the independent integer-oracle property tests.

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.

Primary judge's stated reason

Forced, slight preference for A: its independent oracle gives implementers a useful additional way to detect arithmetic errors, including near the maximum input. This is not an established material quality gap; B supplies a comparably complete and practical design, and an independent review could reasonably prefer its exact-integer implementation and remainder sweep.

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_2d5d32ce34317eb69a3c7a770583970ed24991e0b6e5009a42258fdf3094c53c. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.