Repository navigation
StopRxLoop: state the contract on IRadio, promote the stop-during-Init probe to tests/ - #505
Conversation
…t probe to tests/ The StopRxLoop note on IRadio.h named a race "window" and what was out of scope; it now states what the call does: a stop issued while Init() is still bringing the chip up ends Init without a loop, and a stop issued before Init() or a standalone StartRxLoop() is stale and cleared by them, which includes the InitWrite + StartRxLoop-on-a-thread shape. The signal-flag check at the entry of every start_rx_loop gets its reason: it skips the bring-up-side setup for a loop whose own predicate would exit on its first pass. tests/stop_during_init_probe.cpp (build/StopDuringInitProbe) and tests/stop_during_init.sh carry the reproducer that validated #503: Init on a thread, a stop at 100/400/1000/2500 ms, a standalone restart after a stop, and a stale stop before Init. --no-reset / NO_RESET=1 for Kestrel, whose running firmware re-enumerates on a USB reset. Passed 18/18 at this commit on an 8822BU (ch6), an 8812EU and an 8832CU (ch36); the 8812AU, RTL8733B and MT7612U carry the same guard and were not on the bench. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR Summary by QodoDocument StopRxLoop semantics and add an Init-stop bench probe
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo
1.
|
…iver after an honoured stop The script is documented as a sudo run, so its log directory is a fresh mktemp -d rather than a predictable /tmp path a local user could seed with a symlink for root's stderr redirection to follow; the trap kills the child it started by pid, since the probe's comm is truncated to 15 characters and a name match cannot find it. initstop now rejects a run where Init returned on its own before the scheduled stop (a failed bring-up returns normally on Kestrel), and after the honoured stop runs a standalone StartRxLoop for --rx-ms that must see frames, so the verdict rests on the chip the stop interrupted being a working receiver. The README references the contract on IRadio.h instead of restating it, and every documented command uses `sudo env` because sudo scrubs the environment the script reads. 18/18 on 8822BU ch6, 8812EU ch36, 8832CU ch36 with the stricter verdict. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…#506) Closes the last item on #504: the stop-during-Init matrix on the three backends the first round could not reach. - `--fw-dir` on the probe (`FW_DIR` on the script, `DEVOURER_MT7612U_FW_DIR` env) names the decompressed `mt7662.bin` + `mt7662_rom_patch.bin` for an MT7612U, whose firmware is not embedded. - A bring-up that throws out of `Init` is caught on the Init thread and reported as `INIT_THREW` with its message. Before this it escaped the thread and dumped core with no RESULT line, which is how every MT7612U cell first read. - README: the MT7612U command, and why its reported Init-return time is near zero (the stop call blocks on the lock bring-up holds, so it returns when bring-up ends and Init leaves right behind it). Measured through the script at this commit, ch6, no kernel driver on the DUT: | backend | Init returns after a stop at 100 / 400 / 1000 / 2500 ms | restart after stop | stale stop before Init | |---|---|---|---| | 8812AU (Jaguar1) | 1801 / 1469 / 895 / 30 ms | OK, 290 frames | OK, 240 frames | | RTL8733B | 2033 / 1579 / 965 / 40 ms | OK, 253 frames | OK, 264 frames | | MT7612U | ~0 ms, see above | OK, 178 frames | OK, 282 frames | 18/18 on each; the verify loop after every honoured stop saw 158 to 1392 frames. With #505 that is all six backends. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Follow-ups from #504 (left open by #503).
src/IRadio.h: theStopRxLoopnote stated a race "window" and what was out of scope; it now states the contract. A stop issued whileInit()is still bringing the chip up ends Init without a loop. A stop issued beforeInit()or before a standaloneStartRxLoop()is stale and cleared by them, which includes a stop that lands betweenInitWrite()and aStartRxLoop()on another thread.start_rx_loopgets its reason: it skips the bring-up-side setup for a loop whose own predicate would exit on its first pass.tests/stop_during_init_probe.cpp(targetStopDuringInitProbe,--no-resetfor Kestrel) andtests/stop_during_init.sh(VID/PID/CHANNEL/NO_RESET, one verdict line, exit code), plus atests/README.mdentry.Validation through the promoted script at this commit, no kernel driver bound:
The 8812AU, RTL8733B and MT7612U carry the same guard and were not on the bench; that item stays open on #504.
🤖 Generated with Claude Code