Skip to content

fix(autoresearch): report a declined driver as declined, not as zero capture (#3899) - #4310

Merged
zackees merged 1 commit into
masterfrom
fix/report-declined-driver-not-capture-failure
Sep 12, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/report-declined-driver-not-capture-failure

Conversation

@zackees

@zackees zackees commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

GPIO0 → GPIO1 on the Pico 2 W is UART0 TX/RX, so the UART route is physically wired. The RP UART backend still refuses WS2812B-V5 — the bit period needs a baud above its maximum — and it says so plainly in the response:

RP UART: attempted=False started=False encodedBytes=0 actualBaud=0
lastError='RP UART: chipset timing needs a baud above the UART backend maximum'

The harness reported that as:

TEST UART0 lanes=1 leds=100 FAIL 2017ms class=zero_capture
   Detail: RX produced no raw edges or decodable bytes

True, and useless. The driver never transmitted, so RX seeing nothing is the consequence; the cause was already sitting in the response and got dropped on the floor. Read from the summary line — which is what a bench operator or an agent actually reads — a declined capability is indistinguishable from a broken jumper or a dead capture path. I went looking for a wiring fault before noticing the driver had already explained itself.

#3899 requires every unreachable path to be listed with its exact wiring or peripheral constraint. The driver supplied that constraint; the harness discarded it.

Change

_classify_test_failure checks rpUartStartAttempted is False before any capture evidence — a driver that never transmitted makes that evidence meaningless — and surfaces the driver's own words rather than a paraphrase:

TEST UART0 lanes=1 leds=100 FAIL 2017ms class=driver_declined
   Detail: RP UART: chipset timing needs a baud above the UART backend maximum

Scope

  • The failure class is display-only — nothing in ci/ switches on it — so adding a value changes no control flow. Verified by grepping every use.
  • Exit status is unchanged. The criterion is still unmet and the run still exits 1. This makes the failure legible, it does not excuse it.
  • Only the RP UART backend carries attempt evidence today, so the check keys on the fields that exist rather than inventing a generic scheme the firmware does not populate.

Verification

Run on the attached RP2350 (2DCB876B587EA334), before and after, quoted above.

Three tests, using the verbatim response shape from that run:

test pins
test_driver_that_declined_is_not_a_capture_failure the decline classifies as driver_declined, and the driver's own text reaches the operator
test_driver_decline_without_a_reason_still_says_it_declined a missing rpUartLastError still reports the decline — falling back to zero_capture would be a wrong finding, not merely a vaguer one
test_driver_that_did_transmit_still_classifies_on_capture rpUartStartAttempted=True still classifies on capture, so the new branch cannot swallow a genuine capture failure

The first two were confirmed to fail with the new branch removed, so neither passes for the wrong reason. 21 passed in the module; bash lint clean.

Context

Found during a live HIL sweep of #3899, reported there along with the confirmed GPIO0 → GPIO1 bridge, PIO0/PIO1/PIO2 all passing, and a separate finding that Bus::BIT_BANG is never registered on RP — which I deliberately did not fix, because registering it exposes a ~4× timing shortfall and would turn a clear UnknownDriver error into silently wrong LED output.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51

Summary by CodeRabbit

  • Bug Fixes

    • Improved failure reporting for RP UART transmission attempts that were declined by the driver.
    • Preserves the driver-provided reason when available, or reports clearly when no reason is supplied.
    • Prevents declined transmissions from being incorrectly reported as capture failures.
  • Tests

    • Added coverage for driver-declined transmissions with and without error details.
    • Verified that transmissions that did occur continue to be classified based on capture results.

…capture

GPIO0 -> GPIO1 on the Pico 2 W is UART0 TX/RX, so the UART route is
physically wired. The RP UART backend still refuses WS2812B-V5, because
the bit period needs a baud above its maximum, and it says exactly that:

    RP UART: attempted=False started=False encodedBytes=0 actualBaud=0
    lastError='RP UART: chipset timing needs a baud above the UART backend maximum'

The harness classified that as:

    TEST UART0 lanes=1 leds=100 FAIL 2017ms class=zero_capture
       Detail: RX produced no raw edges or decodable bytes

which is true and useless. The driver never transmitted, so RX seeing
nothing is the consequence; the cause was already in the response and
got dropped. Read from the summary line, a declined capability is
indistinguishable from a broken jumper or a dead capture path -- and
#3899 asks for every unreachable path to be listed with its exact
constraint.

`_classify_test_failure` now checks `rpUartStartAttempted is False`
before any capture evidence, since a driver that never transmitted makes
that evidence meaningless, and surfaces the driver's own words:

    TEST UART0 lanes=1 leds=100 FAIL 2017ms class=driver_declined
       Detail: RP UART: chipset timing needs a baud above the UART backend maximum

The class is display-only -- nothing switches on it -- so adding one
changes no control flow. The exit status is unchanged: the criterion is
still unmet and the run still fails.

Verified on the attached RP2350. Three tests cover it: the decline, a
decline with the reason missing, and `rpUartStartAttempted=True` still
classifying on capture so the new branch cannot swallow a real capture
failure. The first and second were confirmed to fail with the branch
removed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4bc577bd-72e6-429f-9674-0eb74496602d

📥 Commits

Reviewing files that changed from the base of the PR and between da7dfc5 and 0dead82.

📒 Files selected for processing (2)
  • ci/autoresearch/phases.py
  • ci/tests/test_autoresearch_rpc_acceptance.py

Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The RP UART failure classifier now distinguishes driver-declined transmission from zero capture. Acceptance tests cover preserved error details, missing reasons, and drivers that attempted transmission.

Changes

RP UART classification

Layer / File(s) Summary
Classification logic and acceptance coverage
ci/autoresearch/phases.py, ci/tests/test_autoresearch_rpc_acceptance.py
When the RP UART driver does not attempt transmission, classification returns driver_declined with the driver error or a default reason. Tests confirm that attempted transmission still uses zero_capture.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 0dead

RP UART driver declines now show the correct classification and available reason, while attempted transmissions retain zero-capture behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: classify a declined driver as driver_declined instead of zero_capture.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
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.
✨ 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/report-declined-driver-not-capture-failure

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.

@zackees
zackees merged commit 129e4cd into master Sep 12, 2026
27 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 12, 2026
@zackees
zackees deleted the fix/report-declined-driver-not-capture-failure branch November 5, 2026 05:53
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