Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f53c6ae
ci: collect Windows code-size evidence
hathach Oct 2, 2026
207be94
code_size: run report and diff on Windows
hathach Oct 2, 2026
faccbae
code_size: shorten Windows compiler error paths, skip POSIX-only test…
hathach Oct 2, 2026
965e130
code_size: normalize Windows filters once at entry, trim the Windows …
hathach Oct 2, 2026
bd03114
test_code_size: stop a real Windows grandchild on timeout
hathach Oct 2, 2026
a10770f
ci: run the Windows code-size job on master pushes and PRs only
hathach Oct 2, 2026
846f40d
code-size skill: document running on Windows
hathach Oct 2, 2026
0b86154
code_size: match filters case-insensitively on Windows
hathach Oct 3, 2026
030f5bf
code_size: name a Windows compiler without .exe
hathach Oct 3, 2026
39b9896
code_size: fail on a CMake-shortened object path on Windows
hathach Oct 3, 2026
ebad350
code_size: accept a backslash example on Windows
hathach Oct 3, 2026
7aa7241
test_ci_select: assert the Windows code-size workflow is metadata
hathach Oct 3, 2026
8fdedad
code_size: resolve a CMake-shortened object's source through build.ninja
hathach Oct 3, 2026
44563dc
code_size: fail an elf whose build.ninja cannot be read as UTF-8
hathach Oct 3, 2026
d2f623b
code_size: name the ninja >= 1.11 remedy for a non-UTF-8 build.ninja
hathach Oct 3, 2026
e538050
code_size: key a shortened object by its source and sharpen its build…
hathach Oct 3, 2026
197f63c
ci: check code_size.py in build-os's Windows leg instead of its own w…
hathach Oct 5, 2026
e000182
ci: drop the Windows code-size check from build-os
hathach Oct 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .claude/skills/code-size/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: Use when sizing TinyUSB examples per file, section or symbol (repor
| all examples, CI-pinned, combined | `python3 tools/code_size.py diff --ci` |
| one tree, no diff | `python3 tools/code_size.py report -b BOARD -e device/cdc_msc` |

By default the base comes from the master snapshots CI stored for `--base-branch`'s commit (`--baseline-repo`, default `hathach/tinyusb`, through your `gh` login; cached per master run in `${XDG_CACHE_HOME:-~/.cache}/tinyusb/code-size-baseline/`, shared by every checkout), else its nearest first-parent ancestor's; the `Base:` line names the commit used and how far back it is, and master changes after it count as yours. `--base-branch` means its tip; pass a merge-base SHA to diff against that. When the CI base cannot be had (no `gh` or login, no stored run within 30 commits, a base off master, a failed download) or `-f`, `--bloaty` or another `--engine` needs an elf, the base is built locally in a temporary worktree and the report's `Base:` line says why; `--base-source ci` fails instead, `--base-source local` always builds and makes no GitHub call. Against a CI base, a board whose compiler or membrowse version differs from yours, or is unknown, is still compared with a warning naming both. A local diff never builds CI's `-DMA` variants; DMA-path changes are measured only by the PR's CI comment. A local base worktree symlinks this checkout's fetched dependencies, so a `tools/get_deps.py` pin bump's own size change is not in its diff, while a CI base was built with CI's. A local `report` or `diff` cannot size a `-D` variant build.
By default the base comes from the master snapshots CI stored for `--base-branch`'s commit (`--baseline-repo`, default `hathach/tinyusb`, through your `gh` login; cached per master run in `${XDG_CACHE_HOME:-~/.cache}/tinyusb/code-size-baseline/` (`%LOCALAPPDATA%` on Windows), shared by every checkout), else its nearest first-parent ancestor's; the `Base:` line names the commit used and how far back it is, and master changes after it count as yours. `--base-branch` means its tip; pass a merge-base SHA to diff against that. When the CI base cannot be had (no `gh` or login, no stored run within 30 commits, a base off master, a failed download) or `-f`, `--bloaty` or another `--engine` needs an elf, the base is built locally in a temporary worktree and the report's `Base:` line says why; `--base-source ci` fails instead, `--base-source local` always builds and makes no GitHub call. Against a CI base, a board whose compiler or membrowse version differs from yours, or is unknown, is still compared with a warning naming both. A local diff never builds CI's `-DMA` variants; DMA-path changes are measured only by the PR's CI comment. A local base worktree symlinks this checkout's fetched dependencies, so a `tools/get_deps.py` pin bump's own size change is not in its diff, while a CI base was built with CI's. A local `report` or `diff` cannot size a `-D` variant build.

## Setup and choices

Expand All @@ -25,6 +25,7 @@ Flags and syntax: `python3 tools/code_size.py <command> --help`. The choices:
- `--symbols` when Flash/RAM cancel: a pair counts as changed when its sections or symbols moved.
- `--ci` for "all boards" / "CI"; it needs the arm, riscv, msp430 and ft9xx toolchains, and ESP-IDF or docker.
- An espressif board builds each example `tools/build.py` picks as its own ESP-IDF project: with the exported ESP-IDF (`. "$IDF_PATH/export.sh"`), else in CI's image through docker, as your user (once: `docker pull espressif/idf:v5.5.3 && docker tag espressif/idf:v5.5.3 espressif/idf:tinyusb`, about 8.4 GB).
- Windows: run `python -X utf8 tools/code_size.py …` (or set `PYTHONUTF8=1`), else redirected output fails on `Δ`. `report` and `diff` work for paths without spaces, and a non-ASCII checkout, CMake or toolchain path needs ninja >= 1.11 whose `ninja -t wincodepage` reports UTF-8; espressif boards are refused. A local base, including the fallback, symlinks its dependencies: enable Developer Mode unless running elevated.

## Results

Expand Down
Loading
Loading