Repository navigation
fix(autoresearch): exercise both ObjectFLED and FlexIO on Teensy 4.x - #3005
Conversation
The Python orchestrator emitted driver name "OBJECTFLED" (no underscore), which never matched the firmware-side registry name "OBJECT_FLED" — every `bash autoresearch teensy4x --object-fled` (and `--all`) silently bounced off `UnknownDriver` in `runSingleTestImpl` (AutoResearchRemote.cpp:340). There was also no `--flex-io` flag at all, and `--all` excluded FLEX_IO, so the FlexIO engine was never wired into the AutoResearch execution path either as a TX driver. Changes: - `args.py`: add `--flex-io` flag mirroring `--object-fled`; include the new `flex_io` field in the `Args` dataclass. - `phases.py`: rename "OBJECTFLED" -> "OBJECT_FLED" in the `--all` set and in the `--object-fled` mapping; append FLEX_IO when `--flex-io` is passed and to the `--all` set. The FLEX_IO command pins `pinTx=6` (FlexIO2-capable per `channel_engine_flexio.h:37`) so the manager actually routes to the FlexIO engine instead of silently falling through to ObjectFLED on the default TX pin (1) which isn't FlexIO2-capable. - `test_autoresearch_phases.py`: update the `--all` set expectation, add the `flex_io` field to the test helper, and supply the three `tight_timing*` fields that #2991 added to `Args` without backfilling the test fixture. Net: `bash autoresearch teensy40 --all` (and `--object-fled` / `--flex-io` individually) now actually exercises the corresponding engine. All 48 `ci/tests/test_autoresearch_phases.py` cases pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughAdds a ChangesFLEX_IO driver support and OBJECT_FLED fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ci/autoresearch/phases.py (1)
513-530:⚠️ Potential issue | 🟠 MajorParallel mode missing FLEX_IO pin 6 override—FLEX_IO will fallback to ObjectFLED on Teensy.
Lines 488–507 (parallel path) do not inject
pinTxfor FLEX_IO drivers, while lines 513–530 (non-parallel path) correctly setpinTx: 6. The runtime (runParallelTestImpl) supports per-driverpinTxoverrides (AutoResearchRemote.cpp lines 891–894), but the Python code does not pass this field in parallel mode.Since Teensy's default TX pin (1) is not FlexIO2-capable, FLEX_IO tests in
--all --parallelmode will encounter the same silent fallback to ObjectFLED described in the comment. The parallel path should injectpinTx: 6for FLEX_IO driver entries, matching the non-parallel logic.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/autoresearch/phases.py` around lines 513 - 530, The parallel mode path (lines 488-507) is missing the FLEX_IO pin override logic that exists in the non-parallel path (lines 513-530). In the parallel path's test configuration creation loop, add the same conditional check: when the driver is "FLEX_IO" and args.tx_pin is None, set test_config["pinTx"] to flex_io_tx_pin (value 6). This ensures FLEX_IO tests in parallel mode use the FlexIO2-capable pin instead of falling back to ObjectFLED due to Teensy's incompatible default TX pin.
🧹 Nitpick comments (1)
ci/tests/test_autoresearch_phases.py (1)
191-205: ⚡ Quick winAdd direct regression tests for FLEX_IO
pinTxgeneration behavior.The updated
test_all_driversassertion covers driver names, but it does not lock in the new FLEX_IO routing contract. Please add tests that assert:
- with
flex_io=Trueand notx_pin, generatedrunSingleTestparams includepinTx == 6;- with explicit
tx_pin, no fallbackpinTxis injected in test config.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/tests/test_autoresearch_phases.py` around lines 191 - 205, The test_all_drivers method only validates that driver names are present, but does not test the FLEX_IO pinTx generation contract. Add two new test methods to directly verify FLEX_IO routing behavior: one that calls _make_args with flex_io=True and no tx_pin parameter, then passes the result to _parse_args_and_build_commands and asserts that the generated runSingleTest params include pinTx == 6; and another test that calls _make_args with flex_io=True and an explicit tx_pin value, then asserts that the runSingleTest params do not contain an injected fallback pinTx value. Both tests should follow the same pattern as test_all_drivers using the fake_project_dir fixture.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ci/autoresearch/args.py`:
- Around line 236-239: The --flex-io option help text in the argparse definition
is misleading because it says --tx-pin is required, but the runtime in
Autoresearch phases auto-fills pinTx=6 when it is omitted. Update the help
string in the --flex-io argument definition in args.py to match the actual
behavior and remove the “requires --tx-pin” wording while keeping the Teensy 4.x
and pin-range constraints accurate.
---
Outside diff comments:
In `@ci/autoresearch/phases.py`:
- Around line 513-530: The parallel mode path (lines 488-507) is missing the
FLEX_IO pin override logic that exists in the non-parallel path (lines 513-530).
In the parallel path's test configuration creation loop, add the same
conditional check: when the driver is "FLEX_IO" and args.tx_pin is None, set
test_config["pinTx"] to flex_io_tx_pin (value 6). This ensures FLEX_IO tests in
parallel mode use the FlexIO2-capable pin instead of falling back to ObjectFLED
due to Teensy's incompatible default TX pin.
---
Nitpick comments:
In `@ci/tests/test_autoresearch_phases.py`:
- Around line 191-205: The test_all_drivers method only validates that driver
names are present, but does not test the FLEX_IO pinTx generation contract. Add
two new test methods to directly verify FLEX_IO routing behavior: one that calls
_make_args with flex_io=True and no tx_pin parameter, then passes the result to
_parse_args_and_build_commands and asserts that the generated runSingleTest
params include pinTx == 6; and another test that calls _make_args with
flex_io=True and an explicit tx_pin value, then asserts that the runSingleTest
params do not contain an injected fallback pinTx value. Both tests should follow
the same pattern as test_all_drivers using the fake_project_dir fixture.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f392315f-1cbd-4cc9-9028-2c8f72227ebd
📒 Files selected for processing (3)
ci/autoresearch/args.pyci/autoresearch/phases.pyci/tests/test_autoresearch_phases.py
| "--flex-io", | ||
| action="store_true", | ||
| help="Test only FlexIO clockless driver (Teensy 4.x only; requires --tx-pin in {6-13,32})", | ||
| ) |
There was a problem hiding this comment.
--flex-io help text is inconsistent with actual behavior.
At Line 238, the help says --flex-io requires --tx-pin, but ci/autoresearch/phases.py Lines 529-530 auto-inject pinTx=6 when --tx-pin is omitted. Please align the help text with runtime behavior.
Suggested wording update
- help="Test only FlexIO clockless driver (Teensy 4.x only; requires --tx-pin in {6-13,32})",
+ help="Test only FlexIO clockless driver (Teensy 4.x only; defaults to tx pin 6 if --tx-pin is omitted; valid explicit pins: {6-13,32})",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "--flex-io", | |
| action="store_true", | |
| help="Test only FlexIO clockless driver (Teensy 4.x only; requires --tx-pin in {6-13,32})", | |
| ) | |
| "--flex-io", | |
| action="store_true", | |
| help="Test only FlexIO clockless driver (Teensy 4.x only; defaults to tx pin 6 if --tx-pin is omitted; valid explicit pins: {6-13,32})", | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ci/autoresearch/args.py` around lines 236 - 239, The --flex-io option help
text in the argparse definition is misleading because it says --tx-pin is
required, but the runtime in Autoresearch phases auto-fills pinTx=6 when it is
omitted. Update the help string in the --flex-io argument definition in args.py
to match the actual behavior and remove the “requires --tx-pin” wording while
keeping the Teensy 4.x and pin-range constraints accurate.
…3023) Phase 2 of workstream A: extends the AutoResearch orchestration so the upcoming Teensy 4 LPUART clockless driver can be exercised end-to-end the moment the engine TU lands. Mirrors the FLEX_IO wiring pattern shipped in #3005. Changes: - `examples/AutoResearch/AutoResearchRemote.cpp:944` Add `else if (n == "LPUART") opts.mBus = fl::Bus::LPUART;` to the driver-name → Bus mapping. Bus::LPUART itself was reserved in #3026. - `ci/autoresearch/args.py` New `lpuart: bool` field on `Args`, new `--lpuart` argparse flag with a help string documenting the iMXRT1062 LPUART TX pin set (`{1, 8, 14, 17, 20, 24, 29, 35, 47, 48}`), and the `--all` help text is updated to mention `--lpuart` alongside `--flex-io`. - `ci/autoresearch/phases.py` `LPUART` added to the `--all` driver list and to the per-flag mapping. Adds an `lpuart_tx_pin = 1` override (LPUART6_TX, Teensy 4's default Serial2 TX) so AutoResearch pins the LPUART tests to a known-good pin when the user doesn't supply `--tx-pin` — analogous to the existing `flex_io_tx_pin = 6` override. - `ci/tests/test_autoresearch_phases.py` Add `lpuart=False` to `_make_args` defaults and include `LPUART` in the `test_all_drivers` expected set. Also patches a pre-existing unrelated breakage in `_make_args` (was missing `pin_toggle_rx` and `ws2812_loopback` after recent additions to `Args` — the test file failed with `TypeError: missing 2 required positional arguments`). Test plan: - [x] `uv run pytest ci/tests/test_autoresearch_phases.py -x -q` passes: 48 passed in 7.58s. - [ ] `bash autoresearch teensy40 --lpuart` becomes runnable once the `lpuart_peripheral_real.cpp.hpp` + engine TU land (workstream A Phase 1 follow-up). Refs #3023 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
The Python orchestrator (
ci/autoresearch/phases.py) emitted driver name"OBJECTFLED"(no underscore), which never matched the firmware-side registry name"OBJECT_FLED"— everybash autoresearch teensy4x --object-fled(and--all) silently bounced offUnknownDriverinrunSingleTestImpl(examples/AutoResearch/AutoResearchRemote.cpp:340). There was also no--flex-ioflag, and--allexcludedFLEX_IOentirely, so the FlexIO TX engine was never reached from AutoResearch either.Changes
ci/autoresearch/args.py— add--flex-ioflag mirroring--object-fled; add theflex_io: boolfield to theArgsdataclass.ci/autoresearch/phases.py— rename"OBJECTFLED"→"OBJECT_FLED"in the--allset and--object-fledmapping; appendFLEX_IOfor--flex-ioand to--all. The FLEX_IO command setspinTx: 6(a FlexIO2-capable pin persrc/platforms/arm/teensy/teensy4_common/drivers/flexio/channel_engine_flexio.h:37) so the manager actually routes to the FlexIO engine instead of silently falling through to ObjectFLED on the default TX pin (1) — pin 1 is not FlexIO2-capable, which is why every previousBus::AUTOrun on Teensy 4.x quietly preferred ObjectFLED.ci/tests/test_autoresearch_phases.py— update the--alldriver-set expectation, add theflex_iofield to the_make_argshelper, and supply the threetight_timing*fields that fix(esp32-s3): verify and finish #2420 FastLED.show() timing regression #2991 added toArgswithout backfilling the test fixture (the fixture was already broken onmaster).Test plan
uv run pytest ci/tests/test_autoresearch_phases.py— 48 passed--allnow emitsOBJECT_FLED+FLEX_IORPC commands; the FLEX_IO command carriespinTx: 6and OBJECT_FLED uses the global TX pinbash autoresearch teensy40 --allshould now reach both clockless engines (FLEX_IO on pin 6, OBJECT_FLED on pin 1)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes