Repository navigation
Description
Context
PR #3038 (closed phase 2 of #3022) landed the integer-only IEEE 754 codec in src/fl/stl/ieee754_string.{h,cpp.hpp} — fl::ieee754_parse_decimal(...) and fl::ieee754_format_decimal(...). The codec is verified on host x86 by tests/fl/stl/ieee754_string.cpp (10 doctest cases, all green incl. ASAN/LSAN/UBSAN), but the whole point of the codec is to behave correctly on no-FPU embedded targets (LPC845, Cortex-M0+) where libgcc soft-FP would otherwise be reachable. That side of the contract is currently unverified at runtime — we have a link-symbol check for criterion #6 of #3022, but no on-device assertion that the parser / serializer actually produce the right bit patterns under the platform's integer ABI.
The natural home is the AutoResearch harness (examples/AutoResearch/AutoResearch.ino plus its sibling AutoResearch*.h modules — Simd, Parlio, Wave8Expand, etc.). Per CLAUDE.md:
On-device / hardware tests go through
examples/AutoResearch/AutoResearch.ino— prefer reusing or augmenting its existing test harness (e.g.AutoResearchSimd.h, run viabash autoresearch <board> --simd/--parlio/etc.) rather than creating a new.inoinexamples/.
So this is purely additive inside examples/AutoResearch/, no new .ino.
Proposal
- Add
examples/AutoResearch/AutoResearchIeee754.hfollowing the pattern ofAutoResearchSimd.h/AutoResearchWave8Expand.h:- Static test vectors with
(input_text, expected_bits)pairs covering:0,-0,1,-1,0.5,2.5, pi-ish (3.14159), e-ish (2.71828),100,1000, very-large (1e30), very-small (1e-30), denormal threshold (1e-40clamps to 0),1e40clamps to+inf,-1e40clamps to-inf, NaN parse rejection. - Round-trip table: feed each
u32bit pattern throughieee754_format_decimalthen back throughieee754_parse_decimal, assert ±1 ULP. - For the ±1 ULP reference, embed a known-good host-strtof'd table as
static constexpr u32 kReferenceBits[]— the device never needs to run strtof.
- Static test vectors with
- Wire a
--ieee754flag intoAutoResearch.inomirroring the existing--parlio/--simd/--lpuartdispatch. - Results return through the existing AutoResearch RPC / JSON plumbing so
bash autoresearch <board> --ieee754reports pass/fail counts + first-failing test name in structured JSON. - Add the link-symbol check to the harness's reporting path: after the on-device test passes, the build script (or a follow-up CI step) greps the resulting ELF for
__aeabi_d*/__aeabi_f*and asserts empty output. This mechanizes acceptance criterion WS2801 Timing issue - Calling FastLED.show() too quickly does not update the LEDs. #6 from fl::json: custom 64-bit packed tagged-number type (replaces variant<i64, float, double> in #3002) #3022. - Update
agents/docs/hardware-autoresearch.mdwith the new flag.
Acceptance criteria
-
examples/AutoResearch/AutoResearchIeee754.hexists and is included fromAutoResearch.inounder a#ifdef FL_AUTORESEARCH_IEEE754(or analogous) gate consistent with the other modules. -
bash autoresearch lpc845brk --ieee754runs on LPC845-BRK hardware and reports all test vectors passing. - The harness emits the result through the existing JSON RPC channel —
result.tests_run,result.tests_failed,result.first_failurekeys (or whatever the project's existing schema is). - At least one no-FPU board (LPC845-BRK) and one FPU board (Teensy 4.x or ESP32-S3) covered, so the codec is exercised on both ABIs.
- CI (or the harness's own reporting) asserts
arm-none-eabi-nm -C firmware.elf | grep -E '(aeabi_d|aeabi_f|f2iz|d2iz|__l2f|__floatdisf)'is empty when--ieee754is the active workload. -
agents/docs/hardware-autoresearch.mdlists--ieee754alongside the other research workloads.
Decisions
- Priority: P2. Codec is already shipping (PR feat(json): integer-only IEEE 754 codec replaces soft-FP cascade (refs #3022) #3038 merged); host tests guard correctness for the dominant CI path. On-device coverage closes a real gap but doesn't block shipping work. Upgrade if a real LPC845 bug appears.
- Flag name
--ieee754. Matches the--parlio/--simd/--lpuartlower-kebab convention; tracks the module name directly. Triage can rename to--codec-floatif a broader codec workload is planned. - File
AutoResearchIeee754.h(header-only). MirrorsAutoResearchSimd.h/AutoResearchWave8Expand.h. Keeps test vectors inline so the build pulls them in via the existing.inotranslation unit without a new.cppfile. - ±1 ULP tolerance. Same target as the host test (
tests/fl/stl/ieee754_string.cpp). Embedded-grade precision was the chosen contract for fl::json: custom 64-bit packed tagged-number type (replaces variant<i64, float, double> in #3002) #3022 phase 2; tightening to bit-exact would require the Eisel-Lemire / Ryu upgrade tracked separately. - Reference vector source: host strtof. Generated offline by a helper script (similar to
ci/tools/gen_pow10_table.py) and committed as a header. The device never runs strtof, so the soft-FP-free property is preserved. - No new
.ino. Project policy (CLAUDE.md → "Examples Policy") plus theprotect_example_ino.pyPreToolUsehook block new.ino. The hook can be overridden but should not be here — augmentingAutoResearch.inois the right pattern. - Boards: LPC845-BRK + one of (Teensy 4.x, ESP32-S3). LPC845 is the canonical no-FPU target this codec was built for; one FPU board confirms the codec doesn't accidentally rely on absent soft-FP helpers on richer targets.
Related
- fl::json: custom 64-bit packed tagged-number type (replaces variant<i64, float, double> in #3002) #3022 — parent meta issue (acceptance criterion WS2801 Timing issue - Calling FastLED.show() too quickly does not update the LEDs. #6 is the link-symbol check this issue mechanizes).
- feat(json): integer-only IEEE 754 codec replaces soft-FP cascade (refs #3022) #3038 — merged PR that landed the codec; this issue is the on-device follow-up to its "LPC845 link check" Test plan item that was left unchecked.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Add LPC IEEE754 AutoResearch codec mode
zackees commentedon Jun 18, 2026
Fixed by merged PR #3213.
Validation run on LPC845-BRK:
bash autoresearch lpc845brk --ieee754 --upload-port COM10 --skip-lint --skip-schemasuccess=true,tests_run=35,tests_failed=0,first_failure=""Upgrade guidance: use FastLED at or after merge commit
9684ad8from PR #3213, or the next FastLED release containing it. No sketch/API migration is required. To run the new coverage locally, usebash autoresearch lpc845brk --ieee754.Note: this closes the on-device codec verification gap. The broader soft-FP symbol burn-down remains tracked by #3002 / #3022.