diff --git a/RIOv4_2-ANALYSIS.md b/RIOv4_2-ANALYSIS.md index ae6d5b2a..5be36897 100644 --- a/RIOv4_2-ANALYSIS.md +++ b/RIOv4_2-ANALYSIS.md @@ -341,3 +341,36 @@ Host-side NAK-driven retransmit (the protocol's intended use of ACK/NAK; RioSerialLink currently fire-and-forgets outbound) would make 62500 lamp-solid (1 retry -> ~0.4% residual, 2 -> ~0.03%) and is good robustness at any rate. Until then, 31250 v2 is the honest FastRIO. + +### 62500 final verdict (2026-07-19) — SHELVED. Chord-driven RX overrun. + +Three rounds of host-side hardening at 62500 (evidence in `testlogs/`, +implementations in RioJoy.Core RioSerialLink): +1. **NAK-race resend** — resends tracked NAKs 1:1 (321/321) yet lamps + still glitched: under bursts the NAK arrives after a newer command is + already "latest", so the wrong packet was resent; total shreds never + NAK at all. +2. **Stop-and-wait** (one command in flight; ACK/NAK/50ms-timeout; + retransmit the SAME packet, limit 2) — still glitched: reply + resolution was type-blind, so an analog reply in USB transit from the + previous poll falsely confirmed the next lamp command. +3. **Typed resolution** (a reply only resolves its matching request; + ACK/NAK safe type-blind because the board's TX ISR prioritizes them + ahead of reply data; 10ms settle after budget-exhausted drops) — + improved, but **chorded presses still glitch even at slow press + rates**. + +The chord observation closes the case: a chord makes the board scan, +queue and transmit N button events at once — worst-case ISR latency — +exactly when our 4-byte lamp replies arrive at 160us/byte into a 2-byte +RX buffer. Corruption at 62500 is chord-shaped, not rate-shaped; no +host-side protocol can prevent the board losing bytes it never latched, +and retries can land in the same busy window. Fixing it for real means +firmware ISR restructuring (or sequence numbers) — out of scope. + +**Final ladder verdict: 31250 v2 is the FastRIO standard** (3.3x stock, +clean without any host-side compensation — NAK 5 in 192s of mash). +The stop-and-wait + typed-resolution machinery stays enabled at every +rate as delivery insurance (it hardens 9600 production cabinets against +ordinary electrical noise, and its retries are near-zero on clean links). +62500 images remain in the repo for future firmware work. diff --git a/testlogs/riomash-patched-62500-sw-20260719-133628.log b/testlogs/riomash-patched-62500-sw-20260719-133628.log new file mode 100644 index 00000000..9ce20db4 --- /dev/null +++ b/testlogs/riomash-patched-62500-sw-20260719-133628.log @@ -0,0 +1,27 @@ +== RIO mash test :: COM1 @ 62500 8N1, 300s, chip label 'patched-62500-sw' == + lamp echo ON (drives reply/lamp collisions), wedge threshold 2.0s, app auto-recovery DISABLED + log: C:\VWE\riojoy\riomash-patched-62500-sw-20260719-133628.log + firmware: 4.2 + counters before: RestartCount=0 AbandonCount=0 FullBufferCount=0 [board/lamp faults reported!] + +>>> MASH NOW: two hands, 8 lamp buttons, as fast as you can. <<< +>>> Test runs 300s. A wedge alarm will beep + banner. <<< +>>> Ctrl+C ends the run early and still prints the summary. <<< + +[ 31.90s] progress: presses=72 (72/min) analog=497 maxGap=0.21s wedges=0 +[ 58.27s] operator stop (Ctrl+C) — ending run, snapshotting counters... + +== MASH SUMMARY [patched-62500-sw] == +run : 58s on COM1, lamps on, wedge threshold 2.0s +firmware : 4.2 +presses/releases : 123 / 123 (124 presses/min) +analog replies : 931 (~1054 poll slots; 88.3%), sentinels 0 +framing / NAK : 7 / 20 (command resends NAK/timeout: 34) +gap histogram : <100ms:921 100-250ms:9 250-500ms:0 0.5-1s:0 1-2s:0 2-5s:0 >5s:0 +longest gaps : 0.22s@58.3s, 0.21s@0.6s, 0.14s@41.9s, 0.14s@26.8s, 0.13s@23.6s, 0.11s@12.4s, 0.11s@24.4s, 0.10s@54.1s, 0.10s@53.4s, 0.10s@16.5s +wedge events : 0 +counters before : RestartCount=0 AbandonCount=0 FullBufferCount=0 [board/lamp faults reported!] +counters after : RestartCount=0 AbandonCount=0 FullBufferCount=0 [board/lamp faults reported!] +counter delta : RestartCount=+0 AbandonCount=+0 FullBufferCount=+0 +verdict : PASS — no wedge; compare gap histogram + counter delta to baseline +log file : C:\VWE\riojoy\riomash-patched-62500-sw-20260719-133628.log