Validating with timeslips
How close is TorkeKit to the track’s timer? torke-validate answers with your own runs: it analyzes each recording again and compares it, mark by mark, with its timeslip. With several runs it gives the bias, the typical error and the worst case of each mark, and whether it meets the accuracy targets.
Collecting the data
Section titled “Collecting the data”- Time runs at the track with TorkeKit and save each one with
session.recording()(the.torkerun.jsonfile). - Keep the timeslip of that same run: a photo is enough to copy the numbers later.
- Put both together in a
torke.validationfile (format below), or pass the timeslip straight to the command.
In code
Section titled “In code”let slip = Timeslip(sixtyFeet: 2.12, quarterMile: 12.91, quarterMileSpeed: 114.2, speedUnit: .mph)
// One run: measured, timeslip and error per marklet comparison = run.compare(with: slip)
// Many runs: statistics per marklet report = ValidationReport([("Run 1", run.analyze(), slip), ("Run 2", other.analyze(), slip2)])for s in report.summaries { print(s.mark, s.bias, s.rms, s.worst, s.passed)}report.passed // every mark within its targetval slip = Timeslip(sixtyFeet = 2.12, quarterMile = 12.91, quarterMileSpeed = 114.2, speedUnit = SpeedUnit.mph)
// One run: measured, timeslip and error per markval comparison = run.compare(slip)
// Many runs: statistics per markval report = ValidationReport.of(listOf( ValidationInput("Run 1", run.analyze(), slip), ValidationInput("Run 2", other.analyze(), slip2),))report.summaries.forEach { println("${it.mark} ${it.bias} ${it.rms} ${it.worst} ${it.passed}") }report.passed // every mark within its target| Per mark | Meaning |
|---|---|
bias |
The mean error, signed: whether TorkeKit always reads a bit slow or fast. |
meanAbsolute |
The mean error, unsigned. |
rms |
The typical error. It’s the one checked against the target. |
worst |
The worst error, signed. |
passed |
rms within the target. |
The error is TorkeKit minus the timeslip: for times, positive means TorkeKit read slower; for speeds, faster.
From the terminal
Section titled “From the terminal”On a Mac with Xcode, from the torke-kit-ios folder:
swift run torke-validate my-runs.json --runsswift run torke-validate run.torkerun.json --60ft 2.12 --1/4 12.91 --1/4-speed 114.2 --mphOn any computer with Java 17, from the torke-kit-android folder:
./gradlew :torke-validate:installDisttorke-validate/build/install/torke-validate/bin/torke-validate my-runs.json --runsTorkeKit validation · 1 run
Mark Runs Bias Mean |e| RMS Worst Target60 ft 1 -0.006 0.006 0.006 -0.006 ±0.100 ok330 ft 1 +0.027 0.027 0.027 +0.027 ±0.120 ok1/8 mile 1 +0.039 0.039 0.039 +0.039 ±0.120 ok1/8 speed 1 +0.06 0.06 0.06 +0.06 ±3.00 ok1000 ft 1 +0.027 0.027 0.027 +0.027 ±0.150 ok1/4 mile 1 +0.022 0.022 0.022 +0.022 ±0.150 ok1/4 speed 1 +0.27 0.27 0.27 +0.27 ±3.00 ok
PASS: every mark is within its target.| Option | What it does |
|---|---|
--60ft, --330ft, --1/8, --1000ft, --1/4 |
Timeslip times, for a single run. |
--1/8-speed, --1/4-speed |
Timeslip speeds; in km/h, or mph with --mph. |
--runs |
Shows every run, mark by mark. |
--json |
The report as JSON, for scripts. |
--stored |
Uses the saved result instead of analyzing again. |
It exits with 0 when every mark passes, 1 when not and 2 when something is missing. It fits in CI: if a change to the engine makes the times worse, the check fails.
The validation file
Section titled “The validation file”{ "format": "torke.validation", "version": 1, "runs": [ { "run": "runs/first.torkerun.json", "label": "Run 1", "timeslip": { "sixtyFeet": 2.12, "eighthMile": 8.55, "eighthMileSpeed": 89.9, "quarterMile": 12.91, "quarterMileSpeed": 114.2, "speedUnit": "mph" } } ]}| Field | What it is |
|---|---|
runs[].run |
The recording, relative to the validation file. |
timeslip |
Whatever the slip has: sixtyFeet, threeThirtyFeet, eighthMile, eighthMileSpeed, thousandFeet, quarterMile, quarterMileSpeed. |
speedUnit |
"kmh" (default) or "mph". |
reactionTime, notes |
For your notes: not compared. |
targets |
Optional: your own targets per mark. |
The default targets are TorkeKit’s: 60 ft ±0.10 s, 330 ft and 1/8 ±0.12 s, 1000 ft and 1/4 ±0.15 s, speeds ±3 km/h.