# UPBS review: what caused the dry/rain result

**Conclusion:** the earlier figures were the existing simulator replay's results, not the complete distances returned by UPBS. I should have made that distinction explicit. The review found a replay integration omission and a calibration-transition problem. It does not establish that the underlying mechanics or the wider validation work are unsound.

## Exact reproduction from the current live calculator

Same setup throughout: 80 km/h, 205/55R16, new 9 mm tread, EU wet grade A, summer touring tyre, 32 PSI, 20°C, 1,500 kg sedan, ABS, level asphalt, no wind or trailer. Only the water setting changes.

| Setting | Water | UPBS returned distance | Existing replay distance |
|---|---:|---:|---:|
| Dry | 0.0 mm | 29.0 m | 25.061 m |
| Rain preset | 0.7 mm | 27.5 m | 23.534 m |
| Custom 1.0 mm | 1.0 mm | 31.0 m | 27.098 m |

The current public physics file was downloaded again and its SHA-256 hash still matches the preview's engine. The live `calculate` call was intercepted only in a temporary browser session to capture its actual inputs and return value. Neither server code nor any source coefficient was changed.

## 1. The existing replay leaves out UPBS's brake build-up allowance

UPBS calculates its full braking distance as ideal braking distance plus its existing 0.17-second brake build-up correction. The simulator's `startBraking()` instead takes `decelerationMs2` from the result and starts applying that deceleration immediately. Its update loop never applies the engine's build-up allowance. The discrete time steps and 0.5 km/h completion threshold produce an additional small difference.

That explains why the replay shows about 25.1 m when the same UPBS call returned 29.0 m for dry conditions. A byte-for-byte engine match did not prove that every part of the engine result was being used by the replay. The previous 24-case verification correctly demonstrated parity with the live replay; its scope needed to be clearer.

The new 1.5-second approach is separate from this issue. It occurs before braking, is excluded from the braking distance, and does not substitute for brake build-up.

Code locations in the unchanged source snapshots:

- `full-preview-assets/original/js-physics.mjs:746–764`: engine build-up allowance.
- `full-preview-assets/original/js-game.js:4527–4540`: app reads the UPBS result and takes its deceleration.
- `full-preview-assets/original/js-game.js:4822–4865`: app applies immediate deceleration and advances position.

## 2. The remaining wet/dry reversal comes from the calibration transition

The underlying weather penalty behaves in the expected direction: its grip multiplier falls from 1.00 when dry to 0.69 at the Rain preset's 0.7 mm. Before calibration, the combined effective grip is approximately 0.827 dry and 0.538 at 0.7 mm.

The calibration layer changes that ordering. At 80 km/h its final multiplier is about **1.206 dry** and **1.971 wet**. It switches to the wet branch as soon as water exceeds **0.3 mm**, while the other wet/dry factors use a blend across 0–0.5 mm. The Rain button supplies 0.7 mm. The code's wet-calibration explanation uses 1 mm as its reference, and the inspected local wet benchmark examples also use 1 mm.

The exact boundary is reproducible with every other input fixed:

| Water | Weather multiplier | Calibration multiplier | UPBS braking distance |
|---|---:|---:|---:|
| 0.30 mm | 0.850 | 1.206 | 34.4 m |
| 0.31 mm | 0.845 | 1.971 | 22.6 m |
| 0.70 mm | 0.690 | 1.971 | 27.5 m |
| 1.00 mm | 0.600 | 1.971 | 31.0 m |

The step between 0.30 and 0.31 mm localises the problem to the calibration transition. At 1 mm the same setup already gives the expected ordering: 31.0 m wet versus 29.0 m dry. Changing only the Rain button's preset would leave the discontinuity available through custom water depth.

Code locations:

- `full-preview-assets/original/js-physics.mjs:483–521`: water preset resolution and wetness blending.
- `full-preview-assets/original/js-physics.mjs:960–995`: decreasing water/grip multiplier.
- `full-preview-assets/original/js-physics.mjs:2922`: wet calibration begins above 0.3 mm.
- `full-preview-assets/original/js-physics.mjs:2999–3118`: wet/dry calibration curves and residual correction.

## Supporting research confirmed

The existing validation material is present. `Documents/UBPS SIMULATOR RECORDS/source files/PHYSICS UPDATE FILES/UBPS_v3.7_Complete_Report.md` documents **849 of 871 testable entries within 15% tolerance (97.5%)**, with an exclusion audit and category breakdown. That is a documented prior validation result, not a new rerun of the whole corpus in this task.

The local `Downloads/tyre-simulator-worker/test/validation/benchmarks.json` also contains the benchmark inputs. The first inspected wet rows explicitly identify 1 mm of water and distinguish partial-stop tests. Those distinctions must be retained during a repair and its validation.

## Recommended bounded repair

1. Define one authoritative UPBS result-and-trajectory contract so the app includes the model's full brake build-up treatment and reports a distance consistent with it. Check input passthrough while repairing this connection.
2. Review the water-depth calibration transition against the existing calibration references, preserving validated wet reference points and continuity through custom depths. The approach should be continuous and water-depth-aware.
3. Run the existing benchmark suite with its original tolerances and partial-stop treatment, alongside targeted 0.29/0.30/0.31/0.50/0.70/1.00 mm sweeps at multiple speeds and tyre grades.
4. Check the displayed distance, playback endpoint, brake-on speed, elapsed time and any build-up phase against the same result before changing production.

No physics coefficients, Workers or production files were edited in this task. Preview 08 adds the approach and retains the previous braking traces, so its numerical results have not been silently retuned. The build-up omission remains a documented repair item.

## Reproduction evidence

- [Captured live engine call and replay](live-connection-audit.json)
- [Direct UPBS water-depth and factor sweep](wet-dry-factor-audit.json)
- [Approach timing and line-crossing checks](approach-validation.json)
- [Existing UPBS validation report](<C:/Users/TyreA/Documents/UBPS SIMULATOR RECORDS/source files/PHYSICS UPDATE FILES/UBPS_v3.7_Complete_Report.md>)
