Skip to content

Add LPC IEEE754 AutoResearch codec mode - #3213

Merged
zackees merged 1 commit into
masterfrom
codex/add-autoresearch-ieee754
Jun 18, 2026
Merged

zackees merged 1 commit into
masterfrom
codex/add-autoresearch-ieee754

Conversation

@zackees

@zackees zackees commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #3039

Validation

  • uv run pytest ci/tests/test_autoresearch_phases.py (50 passed)
  • bash test --cpp tests/fl/stl/ieee754_string.cpp (passed, cached on final run)
  • bash compile lpc845brk --examples AutoResearch --backend fbuild (default firmware 62.47KB / 64KB)
  • bash autoresearch lpc845brk --ieee754 --upload-port COM10 --skip-lint --skip-schema (hardware passed: 35 checks, 0 failures; IEEE754 firmware 59.36KB / 64KB)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --ieee754 execution mode to autoresearch for running on-device integer IEEE 754 decimal codec verification, including parsing, formatting, and round-trip testing. Supported on lpc845brk target.
  • Chores

    • Added new PlatformIO build environment configuration for IEEE754 testing support.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an --ieee754 on-device verification mode to the AutoResearch harness. A new AutoResearchIeee754.h header implements table-driven parse, format, roundtrip, and NaN-rejection tests via integer bit comparisons. A new lpc845brk_ieee754 PlatformIO environment enables the codec surface. The CI pipeline gains an --ieee754 flag, ieee754_test_mode context propagation, environment-selection logic, and a _run_ieee754_tests function that invokes the ieee754CodecTest RPC and validates structured JSON results.

Changes

IEEE 754 Codec On-Device Verification Mode

Layer / File(s) Summary
On-device codec test implementation
examples/AutoResearch/AutoResearchIeee754.h
Defines autoresearch::ieee754_check namespace with Result, ParseCase, FormatCase structs, ULP helpers (absDiff, withinOneUlp, recordCheck), and a table-driven run() covering parse/format/roundtrip/NaN-rejection cases.
PlatformIO build environment
platformio.ini
Adds env:lpc845brk_ieee754 extending env:lpc845brk with -DFL_AUTORESEARCH_IEEE754=1 to enable the IEEE754 firmware surface.
Firmware RPC registration and compile-time gating
examples/AutoResearch/AutoResearchLowMemory.h, examples/AutoResearch/AutoResearchRemoteMathMethods.cpp, examples/AutoResearch/AutoResearchRemotePinMethods.cpp
Defines FASTLED_AUTORESEARCH_IEEE754_MODE, gates LPC WS2812/SCT surfaces out of IEEE754 builds, registers ieee754CodecTest JSON-RPC handler, and adds help metadata describing the new RPC.
CI argument and context plumbing
ci/autoresearch/args.py, ci/autoresearch/context.py, ci/autoresearch/phases.py
Adds ieee754: bool to Args, ieee754_test_mode: bool to RunContext, LPC_IEEE754_BUILD_ENVS constant, and _build_environment_for_mode helper; _parse_args_and_build_commands propagates the flag with mutual-exclusivity validation.
CI build/deploy and schema/pin setup
ci/autoresearch/phases.py
_run_build_deploy selects the IEEE754 build environment for package install and flash paths; _run_schema_and_pin_setup skips pin discovery and GPIO precheck for ieee754_test_mode and sets use_pyserial from LPC_BRING_UP_ENVS.
CI test dispatch and _run_ieee754_tests
ci/autoresearch/phases.py
Inserts ieee754_test_mode short-circuit in the LPC bring-up path and main dispatcher; _run_ieee754_tests connects via RpcClient, calls ieee754CodecTest with retries, validates success/tests_failed/tests_run, and handles timeout and error cases.
CI tests
ci/tests/test_autoresearch_phases.py
Extends _make_args/_make_ctx factories with IEEE754 defaults; adds tests asserting lpc845brk_ieee754 environment selection in _run_build_deploy and use_pyserial=True in _run_schema_and_pin_setup.
Documentation
agents/docs/hardware-autoresearch.md
Documents the --ieee754 flag and adds an example command for lpc845brk.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(100, 149, 237, 0.5)
    Note over CI,phases.py: Build & Deploy
    CI->>phases.py: _run_build_deploy(ctx, ieee754_test_mode=True)
    phases.py->>phases.py: _build_environment_for_mode(ctx) → "lpc845brk_ieee754"
    phases.py->>PlatformIO: install packages for lpc845brk_ieee754
    phases.py->>nxplpc: flash(environment="lpc845brk_ieee754")
  end
  rect rgba(144, 238, 144, 0.5)
    Note over CI,Device: Test Execution
    CI->>phases.py: _run_ieee754_tests(ctx)
    phases.py->>RpcClient: connect via serial
    phases.py->>RpcClient: drain boot messages
    phases.py->>RpcClient: ieee754CodecTest (with retries)
    RpcClient->>Device: RPC call
    Device->>Device: autoresearch::ieee754_check::run()
    Device-->>RpcClient: {success, tests_run, tests_failed, first_failure, expected_bits, actual_bits}
    RpcClient-->>phases.py: JSON response
    phases.py->>phases.py: validate success && tests_failed==0 && tests_run>0
    phases.py-->>CI: exit code 0 or 1
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • FastLED/FastLED#3009: Modifies ci/autoresearch/phases.py LPC845 bring-up dispatch and nxplpc flash wiring, the same code paths this PR extends for IEEE754 mode.
  • FastLED/FastLED#3014: Adjusts _run_schema_and_pin_setup skip/short-circuit conditions for special LPC modes, directly adjacent to the pin-discovery and GPIO-precheck changes added here.

Poem

🐇 Bits and floats, a decimal dance,
On tiny LPC chips I take my chance—
Parse and format, roundtrip too,
NaN rejected, as it's due.
--ieee754, the flag is set,
No soft-FP helpers, no regret! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.67% 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 objective: adding an IEEE754 codec verification mode to the LPC AutoResearch harness.
Linked Issues check ✅ Passed The PR implementation comprehensively addresses all coding requirements from issue #3039: AutoResearchIeee754.h module with test vectors, --ieee754 flag integration, RPC/JSON results reporting, pyserial support, lpc845brk_ieee754 build environment, and documentation updates.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the IEEE754 codec verification mode as specified in issue #3039; no unrelated or extraneous modifications detected.

✏️ 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 codex/add-autoresearch-ieee754

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
agents/docs/hardware-autoresearch.md (1)

8-31: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify that --ieee754 is an exception to driver selection.

This section still says a driver is mandatory, but the new IEEE754 mode runs without LED driver loopback and the example uses bash autoresearch lpc845brk --ieee754. Please update the intro/error wording so users don’t think this flag is invalid.

Based on learnings: --ieee754 is a standalone on-device codec verification mode, and lpc845brk maps to a dedicated lpc845brk_ieee754 build path.

🤖 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 `@agents/docs/hardware-autoresearch.md` around lines 8 - 31, The "MANDATORY:
Driver Selection Required" section header and introductory text do not account
for the `--ieee754` flag as an exception to the driver requirement. Update the
section heading and opening statement to clarify that users must specify either
at least one LED driver flag (--parlio, --rmt, --spi, --uart, --i2s, --lcd-rgb,
--all, --parallel) OR use the `--ieee754` special mode for codec verification
without driver loopback. This will prevent users from thinking `--ieee754` is
invalid when used without an LED driver flag.
🤖 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.

Outside diff comments:
In `@agents/docs/hardware-autoresearch.md`:
- Around line 8-31: The "MANDATORY: Driver Selection Required" section header
and introductory text do not account for the `--ieee754` flag as an exception to
the driver requirement. Update the section heading and opening statement to
clarify that users must specify either at least one LED driver flag (--parlio,
--rmt, --spi, --uart, --i2s, --lcd-rgb, --all, --parallel) OR use the
`--ieee754` special mode for codec verification without driver loopback. This
will prevent users from thinking `--ieee754` is invalid when used without an LED
driver flag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7c07719c-41f4-4673-9fc8-a1421255e46b

📥 Commits

Reviewing files that changed from the base of the PR and between ec7dcc3 and 0b8504c.

📒 Files selected for processing (10)
  • agents/docs/hardware-autoresearch.md
  • ci/autoresearch/args.py
  • ci/autoresearch/context.py
  • ci/autoresearch/phases.py
  • ci/tests/test_autoresearch_phases.py
  • examples/AutoResearch/AutoResearchIeee754.h
  • examples/AutoResearch/AutoResearchLowMemory.h
  • examples/AutoResearch/AutoResearchRemoteMathMethods.cpp
  • examples/AutoResearch/AutoResearchRemotePinMethods.cpp
  • platformio.ini

@zackees
zackees merged commit 9684ad8 into master Jun 18, 2026
12 of 14 checks passed
@zackees
zackees deleted the codex/add-autoresearch-ieee754 branch June 18, 2026 02:34
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 18, 2026
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.

test(autoresearch): on-device verification of fl::ieee754_string codec (refs #3022, #3038)

1 participant