Repository navigation
Description
Context
Two investigation rounds at 94dab9c for #5024. Source inventory and tests were read; no tests/builds were run in this discovery task. tests/platforms/shared/spi_bitbang/bitbang_pin.cpp:8-64 exercises writeBitSetClear and phase arithmetic only. Repository-wide rg -n 'GenericSoftwareSPI|SoftwareSPIOutput|BitbangPin' tests finds no production SPI template caller. Existing hardware/channel tests are not evidence that generic per-bit/bulk software branches execute correctly. Root dispatch lives in src/platforms/{fastpin.h,spi_output_template.h} and src/fastspi.h; the generic implementation is src/platforms/shared/spi_bitbang/generic_software_spi.h.
Proposal
Land this first as the shared prerequisite for the platform children: behavioral tests invoking actual production software SPI templates plus an exhaustive, fail-closed backend coverage gate. The discovery universe must start from all git-tracked src/platforms source files plus root src/fastspi and src/fastpin**, not the filenames returned by an SPI keyword query. Generate semantic candidates from declarations, stores/MMIO access, loops, GPIO toggles, templates and transitive dispatch/include edges; retain explicit dispositions for every source entry (candidate, hardware-only, clockless, alias/wrapper, unrelated, unknown). Preserve paths and symbols/implementation identity in an auditable ledger.
Acceptance criteria
- RED -> GREEN tests call production GenericSoftwareSPIOutput, SoftwareSPIOutput and each independent software implementation, not a copied writer. Trace real GPIO write hooks: all 256 byte values/all bit indices, scalar/bulk/repeated values/pixels, adjustment callbacks, start bits, empty/one-byte/consecutive transfers, first/last edges, clock idle, distinct/same port and separate banks, GPIO16/other exceptions, unrelated GPIO interference and timing boundary/slow rates.
- Inventory generation discovers every tracked platform source independent of search matches. A new or renamed backend, dispatch branch, pin family, register implementation or helper must cause an unknown/unclassified failure until source evidence and behavioral/configuration coverage are supplied. Remove a search token, rename writeBit or move a loop to a helper as negative mutations: denominator cannot shrink and gate cannot silently turn green. Wrapper aliases point at the canonical implementation and verify dispatch; hardware-only and clockless exclusions include code evidence.
- Each optimization child supplies a focused failing pre-change signal; after GREEN, restoring its actual old implementation must make its own test/code-generation assertion fail, then GREEN after restoration. Mutation records include exact commit, production symbol and command/result. Changing kAtomicWrite/kTwoWriteStream, manually marking covered, removing a ledger row, selecting an unused backend, or editing regexes alone must fail validation. Derive execution coverage from actual traces and generated code, not self-reported flags.
- Real board/configuration compilation is independently recorded for the selected implementation, including pin/bank maps, force-software modes, architecture/clock variants and error cases; native fake-MMIO traces cannot stand in for vendor core builds or physical timing. Include disassembly where branch elimination, MMIO count or tiny-delay inlining is claimed. Any physical speedup needs measured board evidence with interrupt/timing constraints recorded.
- No new workflow file is needed; integrate into an existing repository validation entry point and report the exact gate command. Save generated inventory, classification evidence, production trace results and mutation outcomes as artifacts tied to the audited SHA. Test the gate with a synthetic new backend and with a newly routed existing backend; both must fail before classification/evidence is added.
Decisions
- First serial prerequisite, separate from platform performance changes: helper-unit success currently cannot establish production-template behavior.
- Unknown classification fails closed, while explicit evidence-backed negative dispositions keep hardware DMA/SPI, clockless engines and browser/stub capture from being mistaken for software GPIO opportunities.
- Duplicate search metadata
software SPI coverage; screened querysoftware SPI coverage label:sanitizedreturned perf: audit and accelerate software SPI across all platforms #5024/perf(avr): opt hardware pins into generic software-SPI streaming #5025/perf(teensy4): adopt generic software-SPI full-port and atomic pin policies #5026, the coordinating/platform work rather than this dedicated gate. No unscreened issue prose was read.
Open questions
Choose the lightest code-generation/AST tooling compatible with repository test infrastructure. Semantic discovery is not assumed perfect: cross-check all tracked-source/dispatch changes against the evidence ledger and require unknown disposition rather than treating a query miss as absence. Next step is the RED production-template coverage test and failing new-backend fixture.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
test(spi): run the SoftwareSPIOutput wrapper on a fake GPIO port (Fas…