← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / xhigh / xhigh 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.1-sol / xhigh / xhigh effort answer

## Recommended contract

Use a pure `formatDuration(milliseconds, mode = "compact") → string` utility.

**Assumptions**
- Input uses JavaScript `number` semantics.
- A day is exactly 86,400 seconds; hours and minutes are fixed units.
- Expanded wording is fixed English, not localized.
- No dates, calendars, time zones, DST, leap seconds, or clock access.

**Input handling**
- Accept only nonnegative safe integers: `0 ≤ milliseconds ≤ Number.MAX_SAFE_INTEGER`.
- Accept `-0` as zero.
- Throw `TypeError` for non-number inputs, without coercion.
- Throw `RangeError` for negative numbers, fractions, `NaN`, infinities, or unsafe integers.
- Omitted or `undefined` mode means `"compact"`. Reject any other value besides `"compact"` and `"expanded"` with `TypeError`.
- Validate in that order: input type, input range, mode.

**Formatting**
- Round the entire duration to the nearest second first; exactly 500 milliseconds rounds upward.
- Emit nonzero units in descending order: days, hours, minutes, seconds.
- Never truncate units or introduce thousands separators.
- Compact: `1d 2h 3m 4s`.
- Expanded: `1 day, 2 hours, 3 minutes, 4 seconds`; singular only when the value is one.
- Zero: `0s` or `0 seconds`.
- No leading/trailing whitespace, padding, or trailing separator.

## Arithmetic and invariants

Avoid adding 500 directly to the input: that addition can exceed the safe-integer range.

```text
wholeSeconds = floor(milliseconds / 1000)
remainderMs  = milliseconds % 1000
seconds      = wholeSeconds + (remainderMs >= 500 ? 1 : 0)

days         = floor(seconds / 86400)
remainder    = seconds % 86400
hours        = floor(remainder / 3600)
remainder    = remainder % 3600
minutes      = floor(remainder / 60)
secondsPart  = remainder % 60
```

All quantities remain safely representable under the stated input contract. The maximum rounded total is `9007199254741` seconds.

Required invariants:
- `days ≥ 0`, `0 ≤ hours < 24`, and `0 ≤ minutes, secondsPart < 60`.
- `86400 × days + 3600 × hours + 60 × minutes + secondsPart` equals the rounded total.
- Rounding precedes decomposition, so minute/hour/day carries occur automatically.
- Identical valid arguments produce byte-identical output.
- Each call uses only local state. It returns one complete string or throws; there are no external mutations, partial results, or transactions.
- Work is bounded: four unit calculations and at most four output fragments.

## Boundary examples

Expected compact output:

| Milliseconds | Output |
|---:|---|
| `0`, `1`, `499` | `0s` |
| `500`, `999`, `1000`, `1499` | `1s` |
| `1500` | `2s` |
| `59499` | `59s` |
| `59500`, `60000` | `1m` |
| `3599499` | `59m 59s` |
| `3599500`, `3600000` | `1h` |
| `86399499` | `23h 59m 59s` |
| `86399500`, `86400000` | `1d` |
| `86400500` | `1d 1s` |
| `90061000` | `1d 1h 1m 1s` |
| `9007199254740499` | `104249991d 8h 59m` |
| `9007199254740500` | `104249991d 8h 59m 1s` |
| `9007199254740991` — maximum safe integer | `104249991d 8h 59m 1s` |

Expanded examples:
- `0` → `0 seconds`
- `1500` → `2 seconds`
- `86400500` → `1 day, 1 second`
- Maximum input → `104249991 days, 8 hours, 59 minutes, 1 second`

The adjacent large-input examples specifically guard against unsafe rounding arithmetic.

## Measurable acceptance checks

A conforming implementation must pass all of these proposed checks:

1. **Exact examples:** Every table entry and expanded example matches exactly.
2. **Independent arithmetic oracle:** Compare results against integer arithmetic:
   ```text
   rounded = (BigInt(milliseconds) + 500n) / 1000n
   ```
   Use independent `BigInt` decomposition and expected-string construction.
3. **Boundary coverage:** Check every millisecond from `0` through `120000`, plus all remainders `0…999` around whole-second values `3599`, `3600`, `86399`, `86400`, and the maximum-input quotient and its predecessor. Exclude generated values outside the valid range.
4. **Invalid inputs:** Verify the specified exception classes for strings, booleans, `null`, omitted input, `bigint`, negatives, fractions, `NaN`, both infinities, unsafe integers, and invalid modes. Verify `-0` succeeds.
5. **Formatting:** Test singular/plural forms, omitted intermediate zero units, unit ordering, exact separators, and zero output.
6. **Purity and determinism:** Repeated calls and runs under different locales/time zones produce identical results. No locale, date, clock, or external-state APIs participate.

These are acceptance criteria, not claims of executed tests or observed passes.

## Alternatives, evidence, and next action

- **BigInt internally:** Also correct, but unnecessary for this bounded Number contract. Supporting larger inputs would require a separate explicit contract.
- **Fixed-width clock notation:** Useful elsewhere, but less explicit about days and changes the proposed UI grammar.
- **Localized words, limited unit counts, or fractional seconds:** Deliberately excluded because they weaken deterministic formatting or discard requested precision.

**Basis and confidence:** This is an independent design derived from the supplied requirements and arithmetic, with high confidence in the specification. No source implementation or test results were supplied; integration conventions and actual conformance remain unverified.

**Next action:** Approve the output grammar and error contract, then implement the utility and run the acceptance checks above.

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

A provides a more directly implementable and verifiable contract at the maximum safe integer boundary. This is a weak, forced preference between substantially equivalent designs, not an established material quality gap; an independent review could reasonably weigh B's adequate alternative and checks differently.

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