<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/tools/metrics_compare_base.py, branch claude/usbh-enum-timeout</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/tools/metrics_compare_base.py?h=claude%2Fusbh-enum-timeout</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/tools/metrics_compare_base.py?h=claude%2Fusbh-enum-timeout'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-08-18T05:19:09Z</updated>
<entry>
<title>test/hil, ci: contain a wedged USB stack instead of stranding the runner</title>
<updated>2026-08-18T05:19:09Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-13T18:08:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=3963a1b70a572132aced1c1a0033e1c8249a0c7e'/>
<id>urn:sha1:3963a1b70a572132aced1c1a0033e1c8249a0c7e</id>
<content type='text'>
A wedged USB device used to take the whole HIL run with it. Every worker that
touched the poisoned node blocked uninterruptibly, the pool could not be joined,
map_async discarded every board's result, and the job ran to the GitHub ceiling
with no report at all -- while the self-hosted runner's single job slot stayed
occupied and every queued job waited behind it.

Bound the calls a worker makes itself. read_sysfs, bounded_open and run_cmd all
answer within a wall clock; read_sysfs distinguishes "absent" from "unknown",
because a blocked read is not evidence of absence, and caps stranded readers at
four (each costs a thread and an fd for the life of the process) after which the
worker declares itself blind. mtype, the gio unmount, the libmtp session and the
arecord/iperf reaps go through those bounds; the MTP session runs in a disposable
subprocess, since libmtp's ctypes calls block unkillably in D state.

Bound the run. A pool guard (HIL_POOL_TIMEOUT, 60 min) fires before any job
ceiling and still writes a report. When the pool will not shut down, the sweep
kills what the workers spawned -- descendants, not just direct children, since
flashers run in their own session -- confirms each kill actually landed, and
exits early so the runner is freed. Whatever survived is named in the report.

Deliberately shallow past that point. We do not re-scan process groups, prove
pid ownership, or escalate through sudo: a root-owned survivor is reported, not
force-killed, because signalling a pid we cannot prove is ours is the worse
failure, and the job ceiling backstops whatever this misses. A D-state holder
was never killable anyway.

Recover instead of reporting a wedge. A HUNG usbtest case reflashes its own DUT
through its roster flasher, but only where the flasher can reach its probe past
a poisoned node -- openocd pinned to a validated vid_pid, or esptool. Where it
cannot, the run says so rather than reserving budget for a path that cannot fire.

Raise the CI ceilings above the pool guard so the guard fires first and still
writes its report, and pin --retry 1 on every HIL leg: the guard is a flat
constant and does not scale with max_retry, so argparse's default of 3 would
triple the serialized usbtest tail against an unchanged guard.

Split the module: execution in hil_test/hil_flash/usbtest, infrastructure in
helper/ (locking, health, selection, shared bounded IO), and the two matrix
generators into .github/scripts/ -- ci_set_matrix.py sat in workflows/, where
GitHub treats every file as a workflow definition. 193 tests cover the bounded
paths, the kill ladder, the guard and the selector against synthetic /proc trees
and PATH-injected fakes; a real wedge cannot be manufactured on demand.
</content>
</entry>
<entry>
<title>metrics_compare_base: use git worktree add --detach</title>
<updated>2026-04-29T05:59:40Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-29T05:59:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=17572a960a53e27ffa07d7d7fda3486bfcc95a2d'/>
<id>urn:sha1:17572a960a53e27ffa07d7d7fda3486bfcc95a2d</id>
<content type='text'>
`git worktree add &lt;path&gt; &lt;branch&gt;` fails if &lt;branch&gt; is already checked out
elsewhere (main repo, another worktree). --detach checks out the ref at a
detached HEAD instead of claiming the branch, making the script work
regardless of what is currently checked out.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>metrics_compare_base: catch TimeoutExpired; fix code-size skill docs</title>
<updated>2026-04-29T05:45:55Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-29T05:45:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=6ba8aeff1603ae54e0fcf2309b0f19e335a16cdc'/>
<id>urn:sha1:6ba8aeff1603ae54e0fcf2309b0f19e335a16cdc</id>
<content type='text'>
- run() now catches subprocess.TimeoutExpired (only triggered by `cmake --build`'s
  timeout=600) and returns CompletedProcess(rc=124) so the caller falls through to
  error reporting and worktree cleanup instead of crashing with a traceback.
- code-size SKILL.md: document the actual default filter (per-side absolute
  &lt;checkout&gt;/src/ path, not the old `tinyusb/src` substring) and adjust the
  reporting guidance to match what the report rows actually contain.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Improve remote execution in `hil_ci.sh`</title>
<updated>2026-04-29T05:32:25Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-29T04:56:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=f5d6c6ba91e7176ddf5965608c361ccf5d515bde'/>
<id>urn:sha1:f5d6c6ba91e7176ddf5965608c361ccf5d515bde</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add `code-size` skill and integrate `metrics_compare_base.py` tool</title>
<updated>2026-04-29T04:46:34Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-29T04:46:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=fd715afcc52b27127de4e7a6a89a7782fdef5676'/>
<id>urn:sha1:fd715afcc52b27127de4e7a6a89a7782fdef5676</id>
<content type='text'>
- Introduced a `code-size` skill under `.claude/skills` for evaluating TinyUSB code size changes between the base branch and current branch.
- Added `metrics_compare_base.py`, automating code size comparison with granular options for examples, boards, and CI-wide runs.
- Updated `AGENTS.md` to include quick references and usage guidance for the new feature.
</content>
</entry>
</feed>
