Skip to content

Capture guided results from free driving, keep the samples behind them, and guard against a slow sample rate - #143

Merged
Milky28 merged 9 commits into
mainfrom
claude/project-thread-eyfim2
Nov 14, 2026
Merged

Milky28 merged 9 commits into
mainfrom
claude/project-thread-eyfim2

Conversation

@Milky28

@Milky28 Milky28 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Requested by Jason · project thread

Before you merge

  • Live-tested on two cars in one simulator. Each build (simhub\build.ps1, 14,166 assertions at the head) passed on the maintainer's PC and was installed there. In Project Motor Racing 2.3.0.3 a Toyota TS050 (paddles) and a March GTP (H-pattern) both completed the drive from free driving and saved drafts. No other simulator has been driven. The last commit (limiter in neutral) was built and tested but not yet driven.
  • Three shifts is my choice of threshold. FreeDriveShiftsToSettle decides how many like shifts stand in for a scripted test.
  • Behaviour change for slow telemetry. Below 20 samples a second, an unseen blip is unknown where it used to be no.
  • Drafts from this build need this schema. They carry a telemetry block that the schema on main rejects at intake, so [Observation]: Project Motor Racing - TS050 #145 and [Observation]: Project Motor Racing - March GTP #148 only go through once this is merged and the reviewing checkout is updated.

What changed

Free driving. The second step (formerly "Forward gears") asks the driver to drive normally up to top gear, and watches every shift on the way with the scripted detector's own thresholds:

  • three or more clutchless full-throttle upshifts settle the upshift test, and a torque collapse on all of them is a cut
  • three or more clutchless off-throttle downshifts that take drive settle the downshift test, with or without a throttle spike on all of them
  • the scripted tests it settled are skipped, so a car that takes both finishes after this step
  • the overlay shows the counts as they register, and the result line says which tests remain

It only sees what the gearbox accepted, so it never records that a lift, a blip or the clutch is required. Lifted upshifts are counted but settle nothing. Downshifts that disagree about a spike settle nothing and the scripted test runs.

Recorded telemetry. A draft stores, under an optional telemetry block, the samples behind each accepted result (up to six seconds or 300 samples, plus half a second after), the resting throttle and clutch, the sample rate, and the free-driving counts, including shifts that matched no test.

Sample rate. Below 20 samples a second the absence of a blip is unknown, and the cut and blip method text says why. A spike that was sampled still counts.

Fixes from the live drives

  • PMR clutch channel. It reads 100% at rest and through every downshift, as the car works its own clutch. Those shifts are counted when the channel already read above 20% at rest, with the scripted test's caution attached.
  • PMR throttle dip. The published throttle dips just before the gear index changes, so the driver's throttle is read from before the last 150 ms.
  • PMR resting throttle. A measured resting throttle now wins over the fixed 15% PMR offset, which stays only as the fallback when none was measured.
  • Quick shifts. A gear held 300 ms before the next shift is counted (600 ms otherwise), reading only what happened before the next shift; in a run of downshifts the throttle only has to have closed again after the previous blip.
  • Unloaded engine is not a cut. A flat clutchless upshift on an H-pattern box lets the engine run up to the limiter while its torque falls. Free driving read that as an automatic cut. A collapse while engine speed climbed, or while the box passed through neutral and the engine held its speed, is now counted as engine_ran_free and leaves the cut unknown.
  • Downshift baseline (existing scripted tests). The coast and manual-blip tests took the ratio of the gear being left from its first sample, which after a set-up upshift still showed the engine falling from the gear below, so a downshift that took drive went unconfirmed. The baseline is now the lowest ratio seen in the gear.

Noticed, not changed

  • The scripted full-throttle test can still read torque decaying at the rev limiter as a cut.
  • Game stutter leaves stretches of repeated values at a healthy sample rate; nothing yet marks a shift that lands in one.

Not included

  • No tool yet to re-run the detector over stored drafts in bulk.
  • No CHANGELOG entry, version bump, README or screenshot update.
  • The importer does not read the telemetry block. A Python test holds it to staging exactly what it staged before.

Checks

  • python -m as_driven_db validate: passed
  • python -m unittest discover -s tests: passed, 2 skipped
  • CI green on 6d87c3c, including the Windows core build and tests
  • git diff --check: clean

🤖 Generated with Claude Code

https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5

…te recording a no

A draft held only the verdict of each guided test and a sentence about it.
When the automatic-blip detector turned out to read the driver's carried
throttle as a blip, nothing in the drafts could be re-read, so 84 records
were flagged for a second drive. The drive now keeps the last six seconds
(at most 300 samples) behind every result the driver accepts, with the
channels as SimHub published them and the resting throttle and clutch, and
the draft stores them under an optional `telemetry` block, one sample to a
line. A stored trace fed back through the detector reproduces its answer,
which the .NET tests assert. The gear count has no trace, and retried or
skipped attempts are not kept. The importer stages exactly what it did
before; a Python test holds it to that.

The detector also never asked how fast samples were arriving. An automatic
blip or an ignition cut lasts about a tenth of a second, so at ten samples a
second one can pass between two samples, and its absence was still recorded
as "no automatic blip". The drive now measures the median rate per attempt
and for the whole drive. Below 20 samples a second an unseen blip is
`unknown` rather than `no`, and the cut and blip method text says why. A
spike that was sampled still counts at any rate, and a rate is only reported
from eight or more intervals.

The plugin adapter change is four lines carrying the telemetry from the
guided results into the saved draft. It was not compiled here: that needs
the SimHub SDK. The core and its tests were built with Mono as C# 5.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
@Milky28 Milky28 self-assigned this Nov 13, 2026
…it settles

Every flat upshift and every off-throttle downshift in ordinary driving is
already one of the scripted tests, taken without being asked. The gear-count
step now asks the driver to drive normally up to top gear and watches each
shift on the way, using the scripted detector's own thresholds. Three or more
like shifts stand in for the scripted test, so a car that takes flat upshifts
and off-throttle downshifts finishes the drive after this step instead of
four more, on several shifts' evidence rather than one. The overlay shows the
counts as they register and the result line says which tests remain.

Free driving can only see what the gearbox accepted; a refusal looks the same
as a shift never tried. So it never records that a lift, a blip or the clutch
is required, and the scripted two-stage test still runs for anything it did
not settle. A shift with clutch input is set aside. A lifted upshift is
counted but settles nothing. Flat upshifts without a torque collapse leave
the cut unknown, never no. Downshifts that disagree about a throttle spike
settle nothing, because a driver who blipped on some looks the same. A lower
gear that never took drive is not counted. The slow-sample-rate rule applies
here as it does to the scripted test.

The counts are stored under telemetry.free_drive and the trace kept for a
test settled this way is the most recent shift that counted.

Also drops the sentence telling the driver a licensed SimHub is fast enough.
It rested on an unlicensed update rate nobody here can observe.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
@Milky28 Milky28 changed the title Keep the samples behind each guided result, and stop a slow sample rate recording a no Capture guided results from free driving, keep the samples behind them, and guard against a slow sample rate Nov 13, 2026
The first live drive of free driving, a TS050 in Project Motor Racing 2.3.0.3,
settled nothing and fell through to the scripted tests. Its draft showed why:
six shifts set aside as clutched and none counted.

PMR's clutch channel reads 100% with the car stopped and 100% again through
every downshift, as the car works its own clutch, so every downshift was
filed as the driver's. The scripted test accepts such a shift with a caution;
free driving now does the same when the channel already read above 20% at
rest, stores how many counted shifts moved the channel, and attaches that
caution to the result.

The upshifts matched nothing at all. PMR's published throttle drops to 80%
for the last few samples before the gear index changes, which after the
simulator's resting offset fell under the 70% the detector required right up
to the change. The driver's throttle is now read from before the last 150 ms,
and those last moments only have to not be a lift. The downshift's engagement
baseline is taken from the same earlier point, before a blip raises it.

Shifts that are none of the tests are now counted as other_shifts, so a
draft says when shifts were seen and why they settled nothing.

A scripted trace ended on the sample that settled it, which for an upshift
is the gear change itself. It now runs up to half a second past it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
PMR's 15% idle offset was applied whenever the resting reading was not above
5%, which included a reading of zero. A TS050 in PMR 2.3.0.3 read 0% at rest
in four drafts, so full throttle read 85% and the channel was treated as not
following the pedal. Free driving then saw a throttle spike on 13 of 13
downshifts and recorded the blip as unknown.

A reading taken with the car stopped now always decides the offset. PMR's
15% remains the fallback only for a drive that never saw the car at rest,
which the existing rolling-start test still covers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
A gear had to hold 600 ms before its shift counted, and a shift that was
followed sooner was dropped outright, so a quick run down the gears
counted only its last step. A gear held 300 ms before the next shift
began is now judged on what it showed in that time, with the clutch,
torque and blip windows ending there so the next shift's blip is not
attributed to it. In a run of coast downshifts the throttle only has to
have closed again after the previous blip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
A flat clutchless upshift on an H-pattern box leaves the engine with no
gear driving it. It runs up to the limiter and its torque falls away,
then returns once the next gear takes drive. Free driving counted that
as an automatic cut on every upshift of a live March GTP drive. A
collapse during which engine speed climbed is now recorded as
engine_ran_free and measures nothing about a cut, so the cut stays
unknown.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
The coast and manual-blip tests confirm a downshift when the lower gear
holds the engine at a higher speed than the gear before it. When the
driver shifted up to set the test up, that baseline was taken from the
first sample in the higher gear, with the engine still falling from the
gear below, so it read as high as the gear the driver then went back
down to. A live drive had a downshift that plainly took drive go
unconfirmed and recorded as refused. The baseline is now the lowest
ratio seen in the gear, which is the one it actually holds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
Shifted at the limiter, an unloaded engine has nowhere left to climb, so
the rising-speed check missed it and a live H-pattern drive still showed
two upshifts with a torque cut. A collapse while the box passed through
neutral and the engine held its speed is now set aside the same way.
The method text also says when too few upshifts were measured, rather
than that a collapse on all of them does not establish a cut.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114SHKuGF14miYjDXrsrGx5
@Milky28
Milky28 merged commit 952b61f into main Nov 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants