<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/test, branch hil-report</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/test?h=hil-report</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/test?h=hil-report'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-08-21T15:25:13Z</updated>
<entry>
<title>hil_ci: upload the sidecar so a remote --accumulate has a merge base</title>
<updated>2026-08-21T15:25:13Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T15:16:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=d0b76fe8b91408d22e86b731b72a9a19a9676b7c'/>
<id>urn:sha1:d0b76fe8b91408d22e86b731b72a9a19a9676b7c</id>
<content type='text'>
hil_ci.sh rm -rf's REMOTE_DIR at the start of every run, and accumulate_report
merges onto the sidecar in the run's cwd -- so a remote retry found nothing,
silently started fresh, and its one-row table REPLACED the full-fleet one it was
meant to extend. The copy-back at the end of the script has always existed; this
is the other half of it.

Verified on the rig end to end, which is the only place this shows up: a fresh
run of stm32f407disco, then a retry spelled `-av`, and the merged sidecar holds
all three rows where it previously held only nanoch32v203's two.

Gated on --accumulate rather than unconditional: a fresh run unlinks the sidecar
anyway. argparse decides whether the flag is present rather than a case arm --
hil_test.py declares `-a, --accumulate`, so `-av`, `-va`, `--accum` and `--acc`
all mean it, and hil-validate.js tells operators to retry "adding -v". A missing
merge base warns loudly instead of failing silently, since the run succeeds
either way and a mistyped retry quietly shrinking the published table is the
actual damage. The upload also checks provenance: hil_report.json is not
namespaced by CONFIG or REMOTE, so a run against another rig leaves a sidecar
behind that would otherwise merge in, publishing boards that never ran here.

The copy-back fetches both halves to temps and commits them as a pair, or
neither. It used to delete both before scps that are allowed to fail silently,
so an ssh drop at the end of a 60-minute run destroyed the report and the next
retry's merge base; copying them independently was no better, since a markdown
that arrived beside a sidecar that did not left the local pair failing the
rendering invariant.

&lt;config&gt;.failed is not uploaded: hil_test.py only ever writes it, never reads
it. The retry spec already reaches the rig as the -b/-bt arguments the caller
expanded from it.
</content>
</entry>
<entry>
<title>hil_report: one module owns hil_report.json and hil_report.md</title>
<updated>2026-08-21T15:25:13Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T15:16:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=018fd75693ba9dc99173312909c3c055c8010574'/>
<id>urn:sha1:018fd75693ba9dc99173312909c3c055c8010574</id>
<content type='text'>
The markdown IS a rendering of the sidecar now: every writer goes through
render_report(), so a table can never contain something the JSON does not. Four
writers previously composed it independently and three wrote no JSON at all --
and those three are exactly the paths where the run died, so a JSON consumer saw
nothing on the runs that mattered most. The per-board verdicts an agent hands
back reported the whole fleet as "no report row" while a human reading the
markdown saw the real story.

The document gains the two fields the markdown carried but the JSON did not:
`scope` (a three-board PR run and a full run that lost 24 boards were
indistinguishable) and `caveat` (how the run ENDED -- abandoned, aborted, no
boards). `banner` keeps its existing meaning: the rig-health conditions the
cells were collected under. The distinction is load-bearing, because banner
carries across an --accumulate retry and caveat must not; conflating them made a
clean retry publish an abandonment that never happened, and let a stale notice
from an earlier attempt silence a genuinely new one.

Consolidating into helper/hil_report.py is what makes that complete. The
renderer, the writers, the merge and the fold to per-board verdicts live in one
module that hil_test.py and hil_health.py both import. That dissolves the import
cycle which forced write_timeout_report to compose its own markdown -- the
pool-guard fallback renders like everyone else, so all five writers are
byte-identical -- and removes the second copy of the cell classifier, which
hil_summary.py's docstring described as "the EXACT classifier hil_test.py's own
tally uses". Two copies of one rule, kept in sync by hand against re-typed emoji
literals: change REPORT_CELL and the human's table and the agent's verdict
silently disagree.

hil_summary.py is deleted; its CLI moves here and the two harness docs that
invoke it by name follow. `caveat` gates the workflow verdict and is required by
its schema, because on the abandon path every row can legitimately pass while
hil_test.py exits non-zero, and an operator omitting the field would silently
disable the gate.

NOT purely code motion, and worth reading as new code: measured against master,
hil_test.py held only render_matrix and accumulate_report. render_report,
write_report, mark_report_abandoned, mark_report_no_boards, _load, cell_state
and the scope/caveat plumbing are new, and three rounds of review found their
defects there. Each was reproduced before being fixed and is pinned by a test: a
stuck board that already had a row got no pool-timeout cell and summarized as a
pass; a stale board-locked cell masked it, so a board that wedged the rig was
published as LOCKED and re-run; mark_report_abandoned republished the markdown
even when it declined to stamp, inspected the wrong field, gave up on a missing
or torn sidecar, and called the table "partial" against SKILL.md's contract that
it IS this run's; write_report swallowed OSError, making two layers of fallback
dead code, and committed the JSON before rendering; a sidecar with a null banner
or a non-list rows killed a fully successful run with no artifact at all; an
unhashable cell value raised on the normal accumulate path; the no-boards exit
republished a previous run's rows, and its guard blocked even a fresh run.

_load is the trust boundary for all of it, since hil_ci.sh uploads a sidecar as
the --accumulate merge base and it is therefore untrusted input. A corrupt cell
drops rather than being coerced to str, which would classify it as a pass.

Verified on the rig: a 25-board fleet run, ten randomized passes mixing fresh
and --accumulate over different board sets, and every containment path exercised
against the module actually staged there.
</content>
</entry>
<entry>
<title>test/hil: stop a machine-wide pgrep matching an unrelated sleep</title>
<updated>2026-08-21T15:14:19Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T15:14:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=0737834ecb6886f9add99b5d007646f8f99d289c'/>
<id>urn:sha1:0737834ecb6886f9add99b5d007646f8f99d289c</id>
<content type='text'>
test_the_child_is_reaped_even_when_work_raises asserted that no 'sleep 20'
survives, but pgrep -f searches every process on the host -- another agent
session's retry loop was sleeping 20s between attempts, so the test failed 3/3
in isolation while that ran. It is a pre-commit hook, so it blocked every
commit. A distinctive duration scopes it back to our own child.

Unrelated to the report work.
</content>
</entry>
<entry>
<title>ci_set_matrix: fall open when no selected family builds anywhere</title>
<updated>2026-08-21T09:08:25Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T09:08:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=f17be6770b601a32bdfcc1459e8851becf7fea84'/>
<id>urn:sha1:f17be6770b601a32bdfcc1459e8851becf7fea84</id>
<content type='text'>
family_list maps a family to the toolchains that build it, and seven hw/bsp
families are in neither: cxd56, efm32, espressif, f1c100s, pic32mz, py32f0,
same7x. Scoping to one of them intersected to nothing, so every toolchain key was
[], every cmake leg skipped on `if: inputs.build-args != '[]'`, code-metrics took
its no-metrics branch, and the PR went green from a build job that ran no
compiler. The only signal was a stderr line nothing greps for.

Not a coverage regression - master gave the same diff no compile coverage either,
since none of the other families compiles same7x's board.h. What is new is that
the gap used to be masked by the full matrix and is now the whole answer, and
that green now means "ran no compiler" rather than "compiled 64 families".

A selection whose families ALL miss is now unusable rather than empty: it prints
UNSCOPED, which build.yml and .circleci/config.yml already grep to drop the build
extras with it, and emits the full matrix. The two neighbouring cases keep their
own answers - an explicit families: [] is still a legitimate nothing-selected, and
a partial miss still scopes to the families that do build, noting the rest.

The contract test pinned an exact count of fall-open markers, which this would
have broken; it now pins the invariant (every message that emits the full matrix
carries the marker) and was checked to still fail when a marker is removed.

Also corrects the drift guard's note about espressif: hil-build-esp builds its
boards by name, but that job is gated on repository_owner, so on a fork an
espressif-only PR builds nowhere.
</content>
</entry>
<entry>
<title>hil: express a board's always-on defines as a variant, dropping build.args</title>
<updated>2026-08-21T07:23:40Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T07:23:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a408a8e9af4a043202f79a2b8e20d229093148e5'/>
<id>urn:sha1:a408a8e9af4a043202f79a2b8e20d229093148e5</id>
<content type='text'>
The roster had two ways to pass a cmake -D to a board's build: `build.args`,
applied to every variant, and `variant[].defines`, applied to one. They did the
same thing, and only metro_m4_express used the first - for MAX3421_HOST=1, which
is what makes it the one rig board that compiles hcd_max3421.c.

A board whose define is always on now carries a single variant named after itself,
which is exactly the shape `board.get('variant') or [{'name': name, 'flags': ''}]`
already synthesises everywhere - so the build dir, the HIL report row and the
variant-boundary handling are unchanged. raspberry_pi_pico has used that shape
for its flags all along.

Removes the BuildCfg type and the parallel code path from all four consumers:
hil_test.build_board, hil_pool_check's two builders, hil_ci_set_matrix and
ci_select.board_options.

Verified: the hil-build matrix entry is byte-identical
(`-b metro_m4_express -DMAX3421_HOST=1`), hil_test's build command is unchanged,
ci_select still selects the board for a max3421 diff with MAX3421_HOST in its
options, and a real build of dual/host_info_to_device_cdc and host/cdc_msc_hid on
that board still compiles hcd_max3421.c.
</content>
</entry>
<entry>
<title>ci: fix nine ways the selection under-selected or mismatched</title>
<updated>2026-08-21T05:41:47Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T05:41:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=e13eff8d4e757ebe7709a58fce44017b8be5a84d'/>
<id>urn:sha1:e13eff8d4e757ebe7709a58fce44017b8be5a84d</id>
<content type='text'>
Every one of these dropped coverage silently - the worst failure mode here,
because the PR still goes green. Found by review, each reproduced first.

Selection rules:

* class_macros derived the config macro from the class DIRECTORY, so a change to
  src/class/midi/midi2_device.c selected the midi_test examples (which do not
  compile it) and never examples/device/midi2_device (the only one that enables
  CFG_TUD_MIDI2, and the only one that does). The file's own macro is unioned in
  where it differs - union, never replace: over-selecting costs a build,
  under-selecting merges a break.
* the ${FAMILY_MCUS} fallback added for espressif fired on any family whose
  _family_mcus came back empty, and _cmake_sets is if()-blind and keeps the FIRST
  definition - so mcx/frdm_mcxn947 answered MCXA15, a token six examples' skip.txt
  names, dropping 12 firmware images CMake builds. Limited now to families that
  never spell set(FAMILY_MCUS ...) at all.
* lib_examples read only an example's top-level CMakeLists.txt/Makefile;
  host/msc_file_explorer_freertos names lib/embedded-cli in src/CMakeLists.txt and
  survived by luck. The whole example tree is scanned. (SEGGER_RTT and rt-thread
  still resolve to nothing: all three references sit inside a LOGGER=rtt guard no
  CI build sets - the documented ruling, not a miss.)
* get_family_boards applied ci_skip_boards/ci_preferred_boards only under
  GITHUB_ACTIONS/CIRCLECI, so the selector answered differently on a laptop than
  on a runner; _prune_buildable forces CI semantics. Its one-board pick also
  abandoned the whole preferred list when entry one could not build the -e set,
  and asked skip_example without the build's -D tokens.
* _config_enables and lib_examples still read with the locale encoding - under
  LC_ALL=C the selector tracebacked on three tracked tusb_config.h files. The
  whole selector and its suite run clean there now.

Workflows:

* the Membrowse Upload step omitted $EX_ARGS, but --one-first now picks the board
  from the -e set, so it configured a different, empty build dir and uploaded
  --identical for a board never compiled. It takes $EX_ARGS for the BOARD; the
  target stays the aggregate, which has no DEPENDS and still records every example.
* blanking FAM_REGEX reset only build_filtered, leaving the build scoped while
  code-metrics took the UNSCOPED branch and diffed a 1-family run against the full
  averaged baseline. All three drop together now, as CircleCI's fall-open does.
* CircleCI's EX_ARGS had no character screen and is used unquoted, and its
  code-metrics job still exit 1'd on an empty metrics set - which a scoped build
  makes a legitimate outcome.
* a `ci-full` PR label now turns the scoping off for one PR. A selector bug
  under-selects silently, and without a label the only ways back to a full matrix
  are accidental.

Performance, since the selector gates every other job: family.cmake texts are read
once rather than per changed directory (a 6,000-file dep bump re-read 84 files
99,892 times) and _scrape_mcu is cached: 2.2s -&gt; 0.29s there, 0.8s -&gt; 0.33s on a
class diff.

Tests: a drift guard for hw/bsp families absent from ci_set_matrix.family_list
(they select zero legs now, where they used to ride the full matrix); the rule-4
port test asserted a SUBSET, which set() satisfies, so it could not fail on the
empty selection it exists to catch; the GITHUB_ENV guard test counted a SUM of two
guards. Drops metrics.py's --only-examples, which nothing called, and applies the
TOTAL scrub to the by-example branch that skipped it.
</content>
</entry>
<entry>
<title>ci: scope the build matrix and the HIL run to what a PR affects</title>
<updated>2026-08-21T04:07:27Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-21T04:07:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=04d0f71984117b8c72349f4584bd9e26a37b129c'/>
<id>urn:sha1:04d0f71984117b8c72349f4584bd9e26a37b129c</id>
<content type='text'>
Every PR built all 74 legs (2494 example builds on GHA cmake alone) and flashed
all 30 rig boards, whatever it touched. One classifier now walks the PR diff twice
and answers three questions: which families to build, which examples per family,
and which boards run which tests. Fail-open throughout - anything no rule
classifies, any exception, any unusable output falls back to the full matrix, and
a master push always builds everything.

test/hil/helper/hil_select.py moves to tools/ci_select.py: it is no longer HIL-only,
and tools/ is where the build side can import it. test_hil_select.py follows it as
test_ci_select.py.

Rules (docs/superpowers/specs/2026-08-19-ci-build-family-filter-design.md holds the
full table): a port selects the families whose family.cmake references it, and its
role - a dcd change skips host examples and vice versa; a class selects only the
examples whose tusb_config.h enables its CFG_TU[DH]_ macro, following cross-class
includes; an example selects itself; hw/bsp selects its family or board; hw/mcu and
lib select whoever references them. CMake is the reference for all of it - make
follows whatever cmake decides, family.mk is never scanned.

Empty means empty (maintainer ruling): a rule that classifies a path to nothing
selects nothing. Ports no family references, classes no config enables, libs no
example builds and hw/mcu paths that resolve nowhere are all real - nothing
compiles them, so nothing can validate them, and the master-push build is the net.
Structural tests pin each such case with an explicit allowlist, so the day one
stops being empty it fails pre-commit instead of silently narrowing CI.

Per-example builds: build.py grows a repeatable -e, resolved against the targets
CMake actually registered and batched into one `cmake --build --target a b c`.
build_utils mirrors CMake's family_filter (the whole FAMILY_MCUS list, ${...} and
string(TOUPPER ...) resolved) for the cmake side, while the make side keeps
master's algorithm verbatim - the two build systems answer differently and a shared
answer breaks lpc54's make link. hil-build gains this even on a full selection:
1702 example builds become 515.

Transport: the selection travels as a file, never an argv or env var - a mass-sweep
diff selects 261 KB against a 128 KiB exec limit, and E2BIG would fail the step
before its own fallback could run. CircleCI carries the example map inside the
generated config (pipeline parameters cap at 512 chars), swapped into the parameter
defaults by sentinel match, and drops the scoping wholesale if that rewrite fails.
Every PR-derived value written to $GITHUB_ENV/$GITHUB_OUTPUT is character-screened.

Code metrics follow the scoping: metrics.py emits per-example totals, and
metrics_pair_compare compares the (board, example) pairs present on both sides
instead of a scoped run against a full-matrix average.

The selector's own suite gates it in both providers: a selector that exits 0 with
valid-but-wrong JSON is the one failure fail-open cannot catch, so a red suite
means the full matrix.
</content>
</entry>
<entry>
<title>hil: address Copilot review — loud extraction markers, exit-visible variant warnings</title>
<updated>2026-08-20T11:30:45Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-20T11:30:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=0fa0ece024fecae0847459b5949c66f40fcc6e11'/>
<id>urn:sha1:0fa0ece024fecae0847459b5949c66f40fcc6e11</id>
<content type='text'>
The workflow-logic harness slices hil-validate.js between marker strings (the body is not
a module; the runtime wraps it, so markers are the only handle). A renamed marker used to
produce a garbage slice and a confusing ReferenceError; it now fails naming the missing
marker, proven by mutating the marker and watching the message.

The variant-warning loop in hil_ci.sh read variant_names through a process substitution --
the exact exit-status blindness the comment in resolve_build_dirs warns about, two
functions earlier in the same file. A plain command-substitution assignment is visible to
set -e, so a malformed roster now aborts instead of silently skipping the warnings.
</content>
</entry>
<entry>
<title>hil, docs: reference toolchains by their official env vars, not one rig's paths</title>
<updated>2026-08-20T10:43:44Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-20T10:43:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=21d7332d5884e0abbf9e3f3762deefa589564783'/>
<id>urn:sha1:21d7332d5884e0abbf9e3f3762deefa589564783</id>
<content type='text'>
~/code/pico/pico-sdk and $HOME/code/esp-idf/export.sh are the ci rig's private layout;
written into instructions they silently stop being true on tusb, a dev PC, or any
future rig. The docs now use the variables the vendors define -- PICO_SDK_PATH for the
Pico SDK and IDF_PATH for ESP-IDF, activated explicitly as `. "$IDF_PATH/export.sh"` --
and leave where the checkouts live to each host's profile.

The variables are only useful if the shells that agents actually get can see them, and
`ssh &lt;rig&gt; 'cmd'` is non-interactive AND non-login: it reads no profile, and Debian's
sshd-sourced ~/.bashrc returns at the interactive guard before most of the file. The ci
rig already keeps its exports in the section ABOVE that early-return; IDF_PATH now sits
there beside PICO_SDK_PATH, and the whole chain is verified from a plain non-interactive
ssh: both variables visible, `. "$IDF_PATH/export.sh"` activates ESP-IDF v5.5.3 with
idf.py on PATH -- no login shell, no alias, no hard-coded path. hil-pool-check documents
that placement so the next rig is set up the same way.
</content>
</entry>
<entry>
<title>hil-pool-check: document the probe power-cycle escalation; name the env script directly</title>
<updated>2026-08-20T09:45:32Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-20T09:45:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=be86281b81b70adc1ce3746d620c912bf032fac2'/>
<id>urn:sha1:be86281b81b70adc1ce3746d620c912bf032fac2</id>
<content type='text'>
A probe whose firmware has wedged reports flash-failed with the probe present and
"probe toggle unconfirmed". The tool's own recovery cannot fix that: an authorized
toggle re-enumerates but never removes power, and hil_pool_check.py:304 already notes
that ST-Link, WCH-Link, CP210x and picoprobe keep their sysfs kobject across one. So
the check correctly gives up, and the operator was left to invent the next rung.

Write it down, as what this rig's hardware actually does rather than what uhubctl
advertises: the Renesas cards list their root hubs as ppps-capable but do not
implement it (owner-confirmed - VBUS never drops, only D+/D-), so a root-port cycle
is a harder forced re-enumeration that a wedged probe can ride out, worth exactly one
attempt; and the AMD 0000:02:00.0, where the WCH-Links live, has no port-power
switching at all - nothing to cycle, straight to a physical replug. Which card a
probe hangs off decides which case applies, so the procedure starts from readlink.

The ordering rules encode the shared-rig protocol: let the full run finish (a bounce
re-enumerates siblings and corrupts checks still in flight), hold --all with this
host's --config before the cycle (hil_lock.py hold validates nothing against the
roster and nothing maps a sysfs busport to a board name, so a narrower hand-listed
hold reserves nothing while reporting success - and --all defaults to tinyusb.json,
which on the tusb rig would reserve 27 boards that do not exist there), release
BEFORE the re-check (hil_pool_check.py self-locks every board it checks, so a hold
still in place makes the verification report locked against your own hold and verify
nothing), and drive the cycle through usb_recover.sh root-cycle by its full in-repo
path - it is on no PATH and sudo's secure_path excludes the checkout. Never a bare
`uhubctl -a cycle`: without -S it writes sysfs disable, whose disable_store takes the
root hub's lock uninterruptibly and then usb_disconnect()s the wedged child - the one
input that turns a probe wedge into a bus-wide wedge. Give the script the wedged
probe's own busport, not the hub path: the serial guard and the success check both
read the path you pass, and the hub's inode always changes when its own port cycles.

Reporting asks for both passes: a final table showing every board healthy hides that
a probe needed power-cycling to get there, which is the signal that it will recur.

Also: the ESP-IDF env hints name `. $HOME/code/esp-idf/export.sh` instead of the
`get-idf` alias, which lives only in interactive shells and fails from scripts.
</content>
</entry>
</feed>
