ChronoSheaf-Input-Lag / docs /DATA_DICTIONARY.md
PureOne's picture
Add CHRONO-SHEAF III input latency research dataset
987b273 verified
|
Raw History Blame Contribute Delete
7.94 kB
# Dataset tables and measurement contract
Two sweeps exercised a real SDL2 software renderer on Linux with the dummy video driver. Each contains eight paced matched-condition runs and two unpaced control runs. The tables preserve the consumed synthetic input events and all frame timings in those sweeps. The archived [first evaluation trace](../results/sdl_raw.csv.gz) and [repeat trace](../results/repeat/sdl_raw.csv.gz) are the table sources. The earlier [development pilot](../results/pilot/sdl_raw.csv.gz) remains outside the viewer.
The measured event interval begins immediately before the fixture calls `SDL_PushEvent` and ends inside the adapter, as the underlying `SDL_RenderPresent` returns for the first frame that processed that event. The fixture encodes the latest consumed event ID in a pixel patch and validates the software-rendered pixels before presenting. The source timestamps come from a monotonic clock. Use elapsed intervals within each run. The absolute clock values cannot align devices or independent sweeps. No physical switch closure or light emission was measured.
| Config | Split | File | Rows | Scored rows |
| --- | --- | --- | ---: | ---: |
| `runs` (default) | `observed` | [runs.jsonl](../data/runs.jsonl) | 20 | 20 run summaries |
| `input_events` | `paced` | [input_events_paced.jsonl](../data/input_events_paced.jsonl) | 11,483 | 7,781 |
| `input_events` | `unpaced` | [input_events_unpaced.jsonl](../data/input_events_unpaced.jsonl) | 236 | 160 |
| `frame_timings` | `paced` | [frame_timings_paced.jsonl](../data/frame_timings_paced.jsonl) | 2,640 | 1,776 |
| `frame_timings` | `unpaced` | [frame_timings_unpaced.jsonl](../data/frame_timings_unpaced.jsonl) | 660 | 444 |
Each file is UTF-8 newline-delimited JSON with one JSON object per row. There are no train, validation, or test labels. The splits identify fixture pacing conditions. Use `sweep` to select the first experiment or its repeat. The [data manifest](../DATA_MANIFEST.json) records the table paths, checksums, row counts, source checksums, and reproduced sweep-level metrics.
## Keys and common fields
| Field | Type | Meaning |
| --- | --- | --- |
| `sweep` | string | `initial` or `repeat`. Both include all paced and unpaced runs. |
| `run_key` | string | Unique run key, for example `initial:00`. |
| `run_index` | integer | Zero-based execution order within a sweep. The paced order is `BAABABBA`, followed by unpaced `BA`. |
| `condition` | string | `baseline` maps to source mode B. `hook` maps to source mode A. |
| `paced` | boolean | Whether fixture presentation pacing was enabled. |
`runs` has one row per `run_key`. For frame joins, use `(run_key, frame_index)`. Multiple events can join to one frame. The event primary key is `(run_key, event_id)`. Event IDs restart in every run. A matching event ID across conditions does not guarantee an aligned event timestamp or an independently sampled matched event. Match the conditions by `(sweep, matched_pair)`, then summarize each run.
## `input_events`
| Field | Type | Meaning |
| --- | --- | --- |
| `event_id` | integer | Positive, sequential fixture event identifier within a run. |
| `frame_index` | integer | Zero-based frame in which the event was consumed. |
| `scored` | boolean | Whether the consuming frame falls in the scored interval, frames 54 through 164 inclusive. Warm-up events remain available. |
| `event_created_us` | integer | Timestamp immediately before the synthetic event was pushed to the SDL queue. |
| `present_return_us` | integer | Timestamp of underlying present return on the consuming frame. |
| `latency_us` | integer | `present_return_us - event_created_us`. |
An input generated in the warm-up can qualify if it is consumed in a scored frame under the original scoring rule. Input rows cover observed consumption. The number of queued events still unconsumed when each run ended is available as a run-level count. Those trailing events have no published event timestamps or latency values.
## `frame_timings`
| Field | Type | Meaning |
| --- | --- | --- |
| `frame_index` | integer | Zero-based index, 0–164. |
| `scored` | boolean | Whether the frame index is at least 54. |
| `events_consumed_total` | integer | Cumulative count of events consumed through this frame. |
| `events_consumed_this_frame` | integer | Increment of this frame’s cumulative count. |
| `previous_present_return_us` | integer or null | Underlying return of the previous frame. The raw CSV uses a zero sentinel on frame 0, represented here as null. |
| `present_return_us` | integer | Underlying presentation boundary measured by the inner observer. |
| `application_return_us` | integer | Timestamp after presentation returns to the fixture caller. |
| `present_return_interval_us` | integer or null | Difference between the current and previous underlying return timestamps. Frame 0 has no interval. |
| `post_present_return_us` | integer | Caller-observed return minus underlying return. This includes wrapper work, scheduler effects, and any deliberate wait. |
## `runs`
| Field | Type | Meaning |
| --- | --- | --- |
| `matched_pair` | integer | Pairs 1–4 are paced. Pair 5 is the unpaced control. Pair numbers are local to a sweep. |
| `seed` | integer | Seed of the synthetic fixture event generator. Both conditions use the same seed and workload in each pair. |
| `base_work_us` | integer | Nominal per-frame fixture delay before the call, with a deterministic variation added by the fixture. |
| `video_driver` | string | SDL video driver, `dummy` in all runs. |
| `warmup_frames`, `total_frames` | integer | The 54-frame warm-up and all 165 frames per run. |
| `events_consumed_total`, `events_trailing_unconsumed` | integer | Counts of consumed events and produced events still unconsumed at run shutdown. |
| `scored_frames`, `scored_events` | integer | Number of frame and event rows marked `scored` in this run. |
| `mean_event_to_present_return_ms` | number | Mean scored event latency in milliseconds. |
| `p50_event_to_present_return_ms`, `p95_event_to_present_return_ms`, `p99_event_to_present_return_ms` | number | Nearest-rank quantiles of scored event latency, in milliseconds. |
| `mean_present_return_interval_ms` | number | Mean interval between underlying returns for scored frames. |
| `scored_frames_post_present_over_500us` | integer | Scored frames strictly exceeding 500 µs between the underlying and caller-observed return. |
| `p50_post_present_return_ms` | number | Nearest-rank median of the post-present interval for scored frames, in milliseconds. |
## Reproduce the published metrics
1. Select `input_events` split `paced` and filter to `scored == true`. Group by `run_key`, then compute the mean of `latency_us / 1000` in every run.
2. Within each sweep, average the four baseline run means and the four hook run means separately. Subtract the hook result from the baseline result. Expect **3.04750 ms** in `initial` and **4.10933 ms** in `repeat`.
3. For the run p95, sort scored event latencies and take the entry at one-based index `ceil(0.95 * count)`. For the first experiment’s third matched pair, p95 changed from **30.932 ms** to **31.101 ms** even though mean latency fell by about 0.31 ms.
4. Use the run or the matched pair as the unit of comparison. Input observations within a run share frame cadence and scheduler behavior. The unpaced controls and the repeat are distinct comparisons.
The [viewer data builder](../tools/build_viewer_data.py) recomputes these metrics from the archived gzip CSVs and compares every run and group with the [first evaluation summary](../results/sdl_summary.json) and the [repeat summary](../results/repeat/sdl_summary.json). From the repository root, run:
```sh
python tools/build_viewer_data.py --results results --output . --verify
```
This uses the Python standard library. Omitting `--verify` regenerates the table files and data manifest.