← Model losses

Head-to-head comparison

openai / gpt-6-astra / high / high 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-astra / high / high effort answer

## Recommended contract

Use a pure utility:

```ts
formatDuration(milliseconds: unknown, mode?: "compact" | "expanded"): string
```

**Input**
- Accept JavaScript numbers that are nonnegative safe integers, including `Number.MAX_SAFE_INTEGER`.
- Treat `-0` as zero.
- Reject strings, `bigint`, objects, `null`, and other non-number inputs with `TypeError`.
- Reject negative, fractional, nonfinite, or unsafe numbers with `RangeError`.
- Default omitted or `undefined` mode to `"compact"`; reject any other unsupported mode with `TypeError`.
- Validate milliseconds before mode, making errors deterministic when both are invalid.

**Semantics**
- Round the entire duration to the nearest second, with half-second ties upward.
- Use fixed elapsed-time units: minute = 60 seconds, hour = 3,600 seconds, day = 86,400 seconds.
- Days are unbounded within the input range. Never introduce weeks, months, years, dates, timezones, or daylight-saving adjustments.

**Formatting**
- Output units in descending order, omitting zero-valued units.
- Compact: ASCII suffixes `d`, `h`, `m`, `s`, separated by one ASCII space.
- Expanded: fixed English labels, singular only for value `1`, separated by `", "`.
- Zero renders as `"0s"` or `"0 seconds"`.
- Decimal integers use no grouping, padding, localized digits, or scientific notation.
- “Locale-neutral” means identical output regardless of host locale; expanded labels are deliberately fixed English.

Examples: `"2d 3h 4s"` and `"2 days, 3 hours, 4 seconds"`.

## Arithmetic and invariants

After validation, calculate:

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

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

This avoids adding `500` to milliseconds, which could produce an unsafe intermediate near the maximum input. Every intermediate above is an exactly representable safe integer.

Round **before** decomposing, so carries propagate naturally.

Required invariants:

```text
0 <= remainderMs <= 999
0 <= totalSeconds <= 9,007,199,254,741
days >= 0
0 <= hours < 24
0 <= minutes < 60
0 <= seconds < 60

totalSeconds = days*86400 + hours*3600 + minutes*60 + seconds
```

The rounding error is at most 500 milliseconds; at exactly a half-second, the rounded duration is greater than the input.

There is no persistent state or transaction machinery: validation, arithmetic, and rendering use local values only. Each call returns one complete string or throws; it neither mutates inputs nor reads clocks, locale settings, or external state.

## Boundary examples

These are derived expectations, **not executed test results**.

| Milliseconds | Compact | Expanded |
|---:|---|---|
| `0` | `0s` | `0 seconds` |
| `499` | `0s` | `0 seconds` |
| `500` | `1s` | `1 second` |
| `999` | `1s` | `1 second` |
| `1_000` | `1s` | `1 second` |
| `1_499` | `1s` | `1 second` |
| `1_500` | `2s` | `2 seconds` |
| `59_499` | `59s` | `59 seconds` |
| `59_500` | `1m` | `1 minute` |
| `60_000` | `1m` | `1 minute` |
| `3_599_499` | `59m 59s` | `59 minutes, 59 seconds` |
| `3_599_500` | `1h` | `1 hour` |
| `3_600_000` | `1h` | `1 hour` |
| `86_399_499` | `23h 59m 59s` | `23 hours, 59 minutes, 59 seconds` |
| `86_399_500` | `1d` | `1 day` |
| `86_400_000` | `1d` | `1 day` |
| `90_061_000` | `1d 1h 1m 1s` | `1 day, 1 hour, 1 minute, 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 all applicable checks succeed:

1. **Exact examples:** Every table row matches both strings exactly.
2. **Carry boundaries:** Test one millisecond below, at, and above each rounding threshold into a minute, hour, and day.
3. **Independent arithmetic oracle:** For valid inputs, compare decomposed seconds against:
   ```ts
   (BigInt(milliseconds) + 500n) / 1000n
   ```
   Check all 1,000 millisecond residues in selected blocks near zero, unit boundaries, and the maximum input, plus generated safe integers.
4. **Invariants:** Every tested decomposition satisfies the bounds and reconstruction equation above.
5. **Invalid inputs:** Verify the specified exception classes for `"1000"`, `1n`, `null`, `{}`, `NaN`, infinities, `-1`, `0.5`, and `Number.MAX_SAFE_INTEGER + 1`; verify invalid-mode rejection and validation order.
6. **Rendering:** Verify singular/plural rules, omitted zero units, exact separators, and zero output.
7. **Determinism:** Repeated calls and runs under different locale/timezone settings produce byte-identical strings.

## Alternatives and evidence limits

- **Fixed-width clock output** such as `1:02:03` can suit aligned displays, but needs additional field and day conventions. The proposed unit suffixes are explicit.
- **Returning a result object** instead of throwing is reasonable if that matches the application’s error-handling conventions. Do not silently convert invalid inputs to zero.
- **BigInt arithmetic throughout** is another exact implementation; it is unnecessary for the stated safe-number input range.
- **Localized formatting** would require a different contract.

This assessment was independent reasoning only; no sources were inspected or tests executed. Confidence is high in the arithmetic design; existing project API conventions remain unknown. The next useful action is to implement this contract and run the specified boundary and oracle checks.

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

Prefer A because implementers can follow a fully specified safe rounding path and check its maximum-range result without resolving B's arithmetic caveat themselves. This is a slight, forced preference for more complete assurance, not a proven material quality difference; an independent review could reasonably give greater weight to their substantial equivalence.

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