# Recorded CS:GO surf comparison

**Both complete continuous routes stay within one Source unit. Exact parity is
not certified.** The current game is `csgo-surf66-v7`, using the observed 66 Hz
Cybershoke profile. The original strict tolerance remains **0.01 units position
and 0.01 units/s velocity**; residual float/contact errors still fail it.

This page covers the two original detailed fixtures. The separate
[current all-map report](routes-current.json) records completion coverage. V5 added
stage teleport fixes, Lux BSP ordering, Reprise CS:GO brushes and legal ground
approaches. These changes do not certify all-map or bit-for-bit parity.

## Results

All **6,718 adjacent steps** are included, including the post-finish return.
Continuous playback is initialized once at frame zero and then receives only
recorded commands. No later native positions, velocities or frame-specific
corrections are fed into the simulation.

| Recording | Continuous maximum position error before → now | Current median / p95 position error | Current maximum velocity error | Strict one-step passes before → now |
| --- | ---: | ---: | ---: | ---: |
| Boreas | 36,435.6 → **0.14367** | 0.05857 / 0.13615 | 0.04730 | 2,454 → 2,547 / 2,907 |
| Utopia NJV | 21,671.3 → **0.69043** | 0.08989 / 0.53612 | 0.16788 | 3,711 → 3,715 / 3,811 |

Combined strict one-step agreement is **6,262 / 6,718**. All one-step positions
are within 0.005 units; the remaining failures concern velocity. All 72 ground
steps pass. Utopia passes all 84 crouch button edges; Boreas passes 49/50.
Continuous strict passes are only 134/2,907 and 400/3,811: sub-unit route alignment
must not be confused with meeting the 0.01 tolerance on every tick.

The before report used v3 movement-only playback with reference overrides,
including 66 Hz. The current report uses the complete production `Session.step`
and its actual per-map configuration. The large previous Utopia error included
an unmodeled teleport; the improvements are **not all ramp collision fixes**.

- [Frozen previous report](csgo-before-v4.json)
- [Current report and engine fingerprint](csgo-current.json)
- [Production profile and implementation](../physics.md)

## What changed

V7 fixes two contact boundary cases: positive BSP trace fractions below
float32(0.0001) retain the previous collision planes, and wall normals with a
vertical component smaller than that threshold are clipped as vertical walls.
Regression tests cover acute seams, both sides of the strict cutoff and
preservation of positive progress through imported VPhysics contacts.
The latter use an approximate double-precision sweep, so applying the native
fraction cutoff to props remains deferred: it stalls optimized Boreas.
The detailed native comparison still has **456 failures** at the original
tolerance. This is an edge-case fix, not a claim that the remaining native
velocity residuals have been solved.
Utopia's continuous strict passes increase from 262 to 400, while its median
position drift rises from 0.07615 to 0.08989 units. Maximum drift is unchanged.

V6 fixes the repeated-crouch delay in Legends by combining the same-tick
recovery additions before float32 rounding. Its route drift falls from about
9 units to below 0.054. It also normalizes winning prop contact normals in
float32, allowing the native-start Nyx run to finish instead of resetting.
Nyx still drifts by about 22 units, so completion does not certify parity.
The current all-map report records coverage for this engine.

Relative to v5, strict one-step failures fall from 466 to **456**, all on
contacts. This is an overall improvement, not a per-tick guarantee: Boreas
frame 127 now has a roughly 1/32 units/s residual error and fails the unchanged
strict tolerance. Boreas continuous strict passes fall from 303 to 134 even
though maximum position drift improves from 0.23595 to 0.14367. These residual
tradeoffs remain visible in the tests and reports.

Earlier changes retained in v7:

- **Ramp sweeps preserve displacement:** committing a float32 endpoint before
  a double-precision prop sweep slightly rotated tangent rays into the same
  face. Keeping the sweep delta intact removes repeated zero-distance contacts
  and speed loss. Committed player positions still use float32.
- **World collision precedes props:** prop tests use the ray already shortened
  by a world-brush impact. A padded prop plane cannot win when its actual convex
  intersection lies beyond that shortened ray. Boreas's prop-to-brush seam at
  frame 858 no longer clips both faces; accumulated drift no longer delays the
  airborne uncrouch at frame 1651. Tests revert this rule as a negative control.
- **Centered BSP hull math:** world-plane distances and impact endpoints use
  float32 centered box coordinates. Imported VPhysics convexes keep their own
  double-precision sweep path. Thin walls, corners, displacement seams, step
  clearance and endpoint occupancy remain covered by tests.
- **Actual production settings:** float32(1/66), max wish speed 260, acceleration
  10, friction 4.8, stop speed 80, air acceleration 150, gravity 800; per-map
  maximum component velocities remain 5000/3500. Comparison now asserts those
  settings instead of secretly replacing the production profile.
- **Map/server events:** the game retains airborne momentum at linear start
  exits, applies Boreas's authored 0.9999 movement-time modifier, resolves
  Utopia return destinations from BSP entities, preserves return velocity,
  and caps speed on landing in the main start zone. The recorded landing cap
  is 260; ground prestrafes are not continuously capped.

## Important server-rule uncertainty

The start landing rule is inferred from the Utopia return, not recovered from
a server configuration. There is also an explicit **Utopia compatibility
hypothesis**: the upper return pair, Hammer IDs **761046 and 761051** (models
24 and 86), is inactive. The native recording crosses that pair without a
teleport. Keeping them active causes a 13,324-unit discrepancy at frame 557.
The compatibility override is applied to the actual game and verifier, not
just the scorer, and is included in each report's `serverCompatibility` field.

A separately downloaded [2016 public CS:GO Utopia port](https://steamcommunity.com/sharedfiles/filedetails/?id=663573430)
has byte-identical planes, nodes, leaves, models, leafbrushes, brushes and
brushsides to the imported CSS BSP. It retains both triggers. Its hashes and
lump audit are recorded in `tests/fixtures/csgo/utopia-map-audit.json`.
**It is not proven to be the recorded server's BSP**, and the native reason
for those inactive triggers remains unknown. This is a compatibility fit to
one recorded route, not independent certification of all trigger behavior.

## Independent recordings and method

The [PMArkive Cybershoke archive](https://github.com/PMArkive/SurfReplays/tree/58b2c59d4a842fb15310d87a115134798c17f6d9)
was archived on **22 March 2022**, before CS2. We pin its `66tick` recordings
of Boreas (2,908 frames) and Utopia NJV (3,812 frames), including byte lengths,
SHA-256 hashes and source revision. They contain native positions, velocities,
commands, buttons and angles; they are not videos or generated expectations.

Their 80-byte Cybershoke layout extends
[ckSurf's BotMimic format](https://github.com/nikooo777/ckSurf/blob/12e172d8d147740a260feed4c0c2e484dab0d2e9/csgo/addons/sourcemod/scripting/ckSurf/replay.sp).
Two position vectors agree in every frame. The narrow decoder rejects unknown
layouts, extensions, invalid commands and changed fixture bytes. Frame `i`
contains the state before command `i`; frame `i+1` is its expected output.
The earlier header position is not used as the initial state.

Tick interval is supported by the archive directory and ballistic samples.
Ground parameters were inferred from Boreas frames 0–8 and held fixed for both
recordings. Utopia was not used to select those ground values. No executable
build, complete cvar dump, plugin versions, native BSP checksum, ground flag,
duck amount or duck fatigue accompanies either recording.

One-step diagnostics re-anchor only observed position and velocity and retain
predicted hidden state. Continuous playback never re-anchors. Both now run the
production session on shipped geometry, including triggers. Error is 3D
Euclidean distance. Predicted air/ground/contact categories and overlapping
crouch categories do not establish the unrecorded native flags.

## Reproduce and regression checks

```sh
npm run fetch:csgo                      # Optional; verifies pinned originals
npm run validate:csgo                   # Fresh engine + current JSON report
npm run validate:csgo -- --strict        # Intentionally exits 1 for residual errors
node scripts/compare-csgo.mjs --frames --output /tmp/csgo-all-frames.json
npm run build
npm run check
npm test
```

`--frames` includes every error, simulated event and continuous/reference
position. `compareRecording(..., {mode:'movement'})` is available for isolating
movement from session events; it is not the default full-run claim.

Regression checks keep the strict failures visible while requiring each full
continuous route to remain within one unit. Negative controls remove GO's
1/32 residual separation, undo world-first prop clipping, or force a wrong
64 Hz interval. Native evidence is supplemented with independent synthetic
crouch, thin-wall, step, corner and seam tests, full-vs-tiled collision checks,
and browser/verifier agreement. These do not certify unobserved water, ladder,
moving-platform, weapon or server-plugin cases.

Small float32/normalization differences still change which ticks apply GO's
1/32 units/s outward residual correction. The first continuous strict failures
remain Boreas 110→111 and Utopia 148→149. The JSON remains `not-certified`, and
strict validation continues to fail rather than relaxing the original limits.
