routedQErrArm: per-edge chi2 router for the TICC arm (flag, default off)#79
Open
bobvan wants to merge 1 commit into
Open
routedQErrArm: per-edge chi2 router for the TICC arm (flag, default off)#79bobvan wants to merge 1 commit into
bobvan wants to merge 1 commit into
Conversation
Each TICC edge routes (priority-ordered) to ONE of three candidates,
first to pass the chi2 gate wins:
external — z = ticc_diff + ext_qerr, h = -x[2], H=[0,0,-1,0],
R = R_base. Most informative: clean x[2]-only update,
no x[0] coupling. The receiver's TIM-TP sub-tick report
replaces the filter's qerr(x[0]) estimate.
internal — today's behavior: h = -x[2] - qerr(x[0]), coupled
H=[-1,0,-1,0], R = R_base + R_lin.
raw — h = -x[2], H=[0,0,-1,0], R = R_base + tick^2/12
(sawtooth variance, NOT the worst-case half-tick).
The always-accepted robust floor.
chi2 is the correlation-quality detector: a mis-correlated external
qErr is wrong by ~a tick = a conspicuous chi2 outlier vs the small
external R, so it falls through to raw. An F10T's uncorrelated qErr
always fails -> routes to raw, with no per-receiver flag.
Priority-ordered (not argmin-chi2): raw has the largest R so it would
always win a min-chi2 contest; instead external is tried first (most
informative) and accepted only if consistent.
The per-edge external qErr (qerr_for_ticc_pps_ns from the existing
recv_mono matching, qVIR=165x) is already computed at the servo
epoch; this just delivers it to Arm 4 behind --routed-qerr-arm.
COUPLING NOTE: tick discrimination needs the honest small Q (from
qFromCharPerActuator). With the 0.92 ns default, Q re-inflates
P[2,2] to sigma~0.93 ns each predict, where a full-tick (8 ns)
mismatch is only ~8.6sigma (chi2~74 < 100) and would be wrongly
accepted. The router operates in the char-Q regime.
last_ticc_route ('ext'/'int'/'raw') exposed for observability.
7 new tests, 1245 total pass. Default off — byte-identical when
--routed-qerr-arm absent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
Implements the agreed
routedQErrArmdesign. Each TICC edge routes (priority-ordered) to one of three candidates based on chi²; first to pass the gate wins:chi² is the correlation-quality detector: a mis-correlated external qErr is wrong by ~a tick = conspicuous outlier vs the small external R → falls through to raw. An F10T's uncorrelated qErr always fails → routes to raw, no per-receiver flag.
Design points (from the dayplan review)
qerr_for_ticc_pps_nsis already computed at the servo epoch; this just delivers it to Arm 4 (impl-flag-2).Coupling note
Tick discrimination needs the honest small Q from
qFromCharPerActuator. With the 0.92 ns default, Q re-inflates P[2,2] to σ≈0.93 ns each predict, where a full-tick (8 ns) mismatch is only ~8.6σ (χ²≈74 < 100) and would be wrongly accepted. The router operates in the char-Q regime — documented in the tests.Test coverage (7 new, 1245 total)
Test plan
🤖 Generated with Claude Code