Turn reproduced bugs and size limits into CI checks

Open
#4,456 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

Start by reading the existing unit tests under test/unit-test, fuzz corpus tooling such as tools/pcapng_to_corpus.py, and the size reporting script tools/code_size.py. The issue calls for several separate CI checks, including ISR call analysis and a pinned board, example, toolchain, and configuration; those checks depend on choosing reference build budgets. Done means the specified checks have passing and failing cases, document their coverage gaps, and preserve broader code size reporting.

Written by the indexing model from the issue text.

Description

Feature 💡 Prio 📌

Every reproduced bug should leave a check behind, and size limits should fail the build rather than only report. Each step lands in pre-commit or CI with a failing and a passing case and states what it cannot cover.

Steps

  1. Regression test per reproduced bug. Add a unit test (test/unit-test) and keep the minimized replayable input: a fuzz seed (test/fuzz, e.g. via tools/pcapng_to_corpus.py) or a replayed setup/event sequence, next to the HIL reproducer. Lint only for recurring, mechanically recognizable defect classes. A hardware-dependent fix still needs hardware validation; replay does not prove it.
    → verify: the test fails before the fix and passes after; the seed replays.
  2. ISR-context check. On one configured build, flag forbidden blocking osal_* calls reachable from dcd_int_handler/hcd_int_handler. No general call-graph framework.
    → verify: allowed and forbidden paths in tests; the report states gaps (function pointers/callbacks, assembly, other configurations and ports).
  3. Size gate. One pinned board/example/toolchain/config with separate flash and RAM budgets via tools/code_size.py; an increase needs a justified budget bump in the PR. Keep the broader code-size reporting.
    → verify: threshold boundary tests; repeatable measurements.

Later: per-board throughput/latency baselines on the HIL boards, and one small formal model (usbd control stages or usbh enumeration) once its invariants are stated.

Human decisions

The reference build and its flash/RAM budgets (recommend measuring baselines first).

Dominant language
C
Stars
7.3k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
67

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hathach/tinyusb

All issues in hathach/tinyusb

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.