Track speed limit state independently of lookahead - #103
Merged
Merged
Conversation
FrogAi
force-pushed
the
codex/track-speed-limit-state
branch
2 times, most recently
from
August 10, 2026 03:09
5838f3a to
87e3cf2
Compare
FrogAi
force-pushed
the
codex/track-speed-limit-state
branch
from
August 10, 2026 03:21
87e3cf2 to
65ff1b1
Compare
FrogAi
force-pushed
the
codex/track-speed-limit-state
branch
from
September 4, 2026 21:28
65ff1b1 to
f666308
Compare
FrogAi
added a commit
to FrogAi/mapd
that referenced
this pull request
Sep 4, 2026
Retain the original PR commits and the tested rewrite. The resulting file tree is identical to f666308.
Replace the earlier implementation with the simplified version.
FrogAi
force-pushed
the
codex/track-speed-limit-state
branch
from
September 4, 2026 21:50
9cde270 to
ce6ef71
Compare
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream updates the current-limit tracker only when a lookahead limit is present. This change tracks the selected current speed limit on every update, including when there is no lookahead. This preserves the last valid observation across missing data and lets upcoming limits be classified against that held value, with the configured source priority and offset.
Keep observation and acceptance timing separate. The raw
Limittracker describes the selected current source;Suggestiondescribes the value currently offered for acceptance, which can change because of lookahead or an offset while the raw current limit stays constant. Use the suggestion event for both the acceptance timeout and cruise-adjustment freshness.This belongs in the existing acceptance owner. It adds no tracker or state machine, and preserves source selection, held observations, offsets, accepted-limit retention and gas override policy.
Event ordering and complete real-path validation
State.UpdateCarStateupdates the car, scans upcoming ways, then updates speed-limit state. Acceptance is evaluated before the suggestion is recalculated. When a newly calculated suggestion changes, it resets acceptance and the remembered confirmation speed. Keeping that order discards first-detection input. On following updates, only a cruise timestamp later than the pending suggestion is fresh; timeout measures elapsed time since that same event. Gas remains the existing level-based input.Tested source and validation scope
7201c6b4b4ec1b0b9ea21daa8c05b80fdd7e01ee.20e7c25, tree9fa74d269b8f25dd4d09a009d1f0a887bedf4e4b.Checks described here used Go 1.25.1 on Linux amd64 with isolated fixtures and networking disabled during behavior tests. Existing repository tests remain unchanged; the extra reproductions below are deliberately outside the committed source. These are local execution results, not physical-device validation. The PR's Checks tab provides the published workflow result.
The tests below cover lower/higher lookahead with zero/10-second timeouts, stale/fresh/same-tick cruise changes, repeated updates, gas acceptance/override, offsets, first detection and held loss/reacquisition. The actual car message/upcoming/state path executes; the cruise timestamp is not fabricated in stale-confirmation cases. Timeout fixtures explicitly age trackers to model elapsed time without a minute-long sleep. The generic expired-offer fixture ages both observation and suggestion so it models the pending offer's timeout.
In the higher-limit test, cruise remains 36 m/s when a 40 m/s limit is offered. Without a fresh cruise adjustment, accepted limit and final suggestion remain 30 m/s. This is state/output behavior, not measured vehicle actuation. Ordinary tests, race checks, vet and Linux amd64 build passed.
Use an exact checkout with Linux Go 1.25.1 and its pinned
go.moddependencies already cached. To populate a separate module cache, create a temporary directory, setGOMODCACHEto amodulessubdirectory there, and rungo mod downloadfrom that checkout. The commands below then run offline, archive source into another temporary directory, and write no tests into the source checkout. They invoke tests, not the daemon.Combined validation: exact source tree
a4c306906627db3ac7a8ab768651c8628d55465acombines #1019d61f06a1288ec4ea6f74f7d56a3057444316a13, #10320e7c25b054b6399360676a7f539a39b4fbf855c, #105bfcfe77be066634e36054327b20cfa6541063b54, #1078e5e677d1196838069e9665d4e9d962bcc1e116b, #1166fd5bbd6cf617c24a7fefd5e302fd36688a1a63b, #13630e8ce98ea7a4c8401dbb5bfc62120c84fc689e4. The only overlapping file issettings/download.go; the resolution retains #136's selected-row loop and #107's progress publication inside it.Combined Linux amd64 tests (including the scratch regression fixtures), race checks, vet and build passed. Under ARM64 emulation, the existing Makefile build stage (
make GO_CAPNP_PATH=/usr/local/go-capnp/std), committed repository tests, vet and both CLI help commands passed with Go1.25.1;go.mod/go.sumstayed unchanged and the resulting executable is AArch64. The ARM64 run does not include the extra amd64 scratch tests. It used an isolated retained build image, not a new dependency-install/image rebuild or physical device. No archive payload or live params were accessed. #105 still requires runtime-first rollout before regenerated tiles are distributed.