Skip to content

vehicle-dynamics-7: search damping and flip stop for the closest-point search - #85

Merged
lamb2k merged 2 commits into
mainfrom
claude/vd-locate-walk
Nov 23, 2026
Merged

lamb2k merged 2 commits into
mainfrom
claude/vd-locate-walk

Conversation

@lamb2k

@lamb2k lamb2k commented Nov 23, 2026

Copy link
Copy Markdown
Owner

vehicle-dynamics-7: search damping and flip stop

Two build-time changes to the closest-point search of sh2z_vd_step / sh2z_vd_step2, both off by default (the objects of the three vehicle units are identical to main, cmp with the CI flags):

  • SH2Z_VD_LOCATE_DAMP (passes): after that many passes the secant step through the last two passes replaces the pass's step when it is not longer (same sign). Fixes the swing of a body near the centre of curvature (step about twice the Newton step, residual closing by 0.94 a pass).
  • SH2Z_VD_LOCATE_FLIP (flips): ends a search that flips between two nodes, back to the same parameter every second pass, on the parity the 99th pass has.

Approximation: a changed search ends within the bounds in the validation record of the 99-pass end state. Approved class.

Evidence (HOST; see saturn/validation/vehicle-dynamics-7.md)

  • tests/test_vehicle_locate7.c: 506,265 checks, GCC and Clang strict, ASan/UBSan. 120,000 searches against the 99-pass library as oracle: 112,514 untouched and word for word equal; where the library converged within 700 units and a change acted, the changed search converged within 0.853 units in 339 of 340 (one 12.5 units off); every damped step not longer than the step it replaces; flip stops on the right parity.
  • tests/mutate_vehicle_locate7.sh: 12 of 12 controls caught.
  • Caller (HOST, 325 driver settings on a road with a gap): finishers 134 to 135 (lost 1, gained 2; noise controls lose 3 to 9, gain 5 to 6), finishes within 0.10%, ticks over 12 passes 15,376 to 1,521, longest search 99 to 83 passes; stick-noise runs with a 99-pass search 56 and 54 of 60 to 0 and 0.
  • Not done: console run, the third kind of long search (residual rising past the centre of curvature).
  • Re-capture: the changed sources compile to identical default objects, so the model ELF and results.json are unchanged (skip rule); the CI model job should confirm.

Upstream-style: checked against sh4zam conventions of the neighbouring vehicle-dynamics-6 files (hook macros, build-time guards, *_experimental.h contract-tag section, validation record, test and mutation-script layout).

🤖 Generated with Claude Code

lamb2k and others added 2 commits November 23, 2026 12:56
…for the closest-point search (build-time, off by default; proposal, no tests or capture yet)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-point search (SH2Z_VD_LOCATE_DAMP, SH2Z_VD_LOCATE_FLIP)

Build-time, off by default (objects of the three vehicle units unchanged). Host test with the 99-pass search as oracle,
12 mutation controls, guide section and validation record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lamb2k
lamb2k merged commit c8e2869 into main Nov 23, 2026
14 checks passed
@lamb2k
lamb2k deleted the claude/vd-locate-walk branch November 23, 2026 19:24
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.

1 participant