Skip to content

fix(autoresearch): exercise both ObjectFLED and FlexIO on Teensy 4.x - #3005

Merged
zackees merged 1 commit into
masterfrom
fix/autoresearch-flexio-objectfled-driver-names
Jun 14, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/autoresearch-flexio-objectfled-driver-names

Conversation

@zackees

@zackees zackees commented Jun 13, 2026 •

Copy link
Copy Markdown
Member

Summary

The Python orchestrator (ci/autoresearch/phases.py) 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 (examples/AutoResearch/AutoResearchRemote.cpp:340). There was also no --flex-io flag, and --all excluded FLEX_IO entirely, so the FlexIO TX engine was never reached from AutoResearch either.

Changes

  • ci/autoresearch/args.py — add --flex-io flag mirroring --object-fled; add the flex_io: bool field to the Args dataclass.
  • ci/autoresearch/phases.py — rename "OBJECTFLED" → "OBJECT_FLED" in the --all set and --object-fled mapping; append FLEX_IO for --flex-io and to --all. The FLEX_IO command sets pinTx: 6 (a FlexIO2-capable pin per src/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 previous Bus::AUTO run on Teensy 4.x quietly preferred ObjectFLED.
  • ci/tests/test_autoresearch_phases.py — update the --all driver-set expectation, add the flex_io field to the _make_args helper, and supply the three tight_timing* fields that fix(esp32-s3): verify and finish #2420 FastLED.show() timing regression #2991 added to Args without backfilling the test fixture (the fixture was already broken on master).

Test plan

  • uv run pytest ci/tests/test_autoresearch_phases.py — 48 passed
  • Programmatic check: --all now emits OBJECT_FLED + FLEX_IO RPC commands; the FLEX_IO command carries pinTx: 6 and OBJECT_FLED uses the global TX pin
  • Hardware: bash autoresearch teensy40 --all should now reach both clockless engines (FLEX_IO on pin 6, OBJECT_FLED on pin 1)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for a new Flex IO driver option in autoresearch, including command-line selection and “all drivers” runs.
    • When no transmit pin is provided, Flex IO tests now use a consistent fallback pin for routing.
  • Bug Fixes

    • Corrected a driver name spelling issue in driver selection.
    • Updated the “all” option to include the new Flex IO driver.

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]>
@coderabbitai

coderabbitai Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a --flex-io CLI flag and flex_io: bool field to the Args dataclass. In phases.py, corrects the OBJECT_FLED driver identifier typo, adds FLEX_IO to both the --all and explicit driver selection branches, and injects a fallback TX pin (6) into per-test configs for FLEX_IO when none is specified. Tests are updated to match the new flag defaults and corrected driver names.

Changes

FLEX_IO driver support and OBJECT_FLED fix

Layer / File(s) Summary
Args dataclass and CLI flag for --flex-io
ci/autoresearch/args.py
Adds flex_io: bool to the Args dataclass, registers --flex-io in the driver selection argument group with updated --all help text, and wires parsed.flex_io into the returned Args.
Driver selection: OBJECT_FLED fix and FLEX_IO inclusion
ci/autoresearch/phases.py
Corrects OBJECTFLED to OBJECT_FLED and adds FLEX_IO to both the --all default driver set and the explicit args.flex_io conditional branch.
FLEX_IO test config: fallback TX pin injection
ci/autoresearch/phases.py
Introduces flex_io_tx_pin = 6 as a known-good FlexIO2 pin and injects pinTx into each FLEX_IO test config when --tx-pin is absent. Reformats tightTimingIterations assignment.
Test fixture and expectation updates
ci/tests/test_autoresearch_phases.py
Adds flex_io=False and tight-timing defaults to _make_args, and updates test_all_drivers expected driver set to OBJECT_FLED and FLEX_IO.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • FastLED/FastLED#2769: Adds flexioObjectFledTest and test_flexio_rx_objectfled.py for end-to-end ObjectFLED→FlexIO RX verification, directly related to the OBJECT_FLED and FLEX_IO driver plumbing introduced here.

Poem

🐇 A hop through the flags, a fix for a name,
OBJECTFLED had a typo — oh what a shame!
Now FLEX_IO joins in, with pin six in tow,
The autoresearch pipeline puts on quite a show.
With tests all updated and drivers aligned,
This rabbit's quite pleased with the code you've refined! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: AutoResearch now exercises ObjectFLED and FlexIO on Teensy 4.x.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/autoresearch-flexio-objectfled-driver-names

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Parallel mode missing FLEX_IO pin 6 override—FLEX_IO will fallback to ObjectFLED on Teensy.

Lines 488–507 (parallel path) do not inject pinTx for FLEX_IO drivers, while lines 513–530 (non-parallel path) correctly set pinTx: 6. The runtime (runParallelTestImpl) supports per-driver pinTx overrides (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 --parallel mode will encounter the same silent fallback to ObjectFLED described in the comment. The parallel path should inject pinTx: 6 for 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 win

Add direct regression tests for FLEX_IO pinTx generation behavior.

The updated test_all_drivers assertion covers driver names, but it does not lock in the new FLEX_IO routing contract. Please add tests that assert:

  1. with flex_io=True and no tx_pin, generated runSingleTest params include pinTx == 6;
  2. with explicit tx_pin, no fallback pinTx is 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

📥 Commits

Reviewing files that changed from the base of the PR and between fcb8244 and 39d6e28.

📒 Files selected for processing (3)
  • ci/autoresearch/args.py
  • ci/autoresearch/phases.py
  • ci/tests/test_autoresearch_phases.py

Comment thread ci/autoresearch/args.py
Comment on lines +236 to +239
"--flex-io",
action="store_true",
help="Test only FlexIO clockless driver (Teensy 4.x only; requires --tx-pin in {6-13,32})",
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

--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.

Suggested change
"--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.

@zackees
zackees merged commit 3acd440 into master Jun 14, 2026
9 of 10 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 14, 2026
zackees added a commit that referenced this pull request Jun 14, 2026
…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]>
@zackees
zackees deleted the fix/autoresearch-flexio-objectfled-driver-names branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant