fix: explain incomplete flash probe captures #1418

Merged
JooaoPedro15 merged 1 commit from fix/probe-incomplete-capture into main 2026-11-10 04:26:45 +00:00
JooaoPedro15 commented 2026-11-10 01:19:14 +00:00 (Migrated from github.com)

A flash capture with only two frames currently ends in a tuple-unpacking traceback. A truncated row can also fail later in the decoder without identifying where the capture ended.

Check that the capture contains exactly three frames and report the line number of a short row. Blank lines are ignored. Complete captures keep the same brightness report.

The CLI tests cover zero, one, two and four frames, a short row and a valid capture with a real brightness jump. The invalid cases reproduce failures on the old code. The probe and profile suites passed locally on macOS, and the full Windows and Ubuntu workflow passed in the fork.

AI assistance from OpenAI Codex is recorded in the commit trailers.

A flash capture with only two frames currently ends in a tuple-unpacking traceback. A truncated row can also fail later in the decoder without identifying where the capture ended. Check that the capture contains exactly three frames and report the line number of a short row. Blank lines are ignored. Complete captures keep the same brightness report. The CLI tests cover zero, one, two and four frames, a short row and a valid capture with a real brightness jump. The invalid cases reproduce failures on the old code. The probe and profile suites passed locally on macOS, and the [full Windows and Ubuntu workflow passed in the fork](https://github.com/JooaoPedro15/Hookshot/actions/runs/42734396690). AI assistance from OpenAI Codex is recorded in the commit trailers.
NotRexed commented 2026-11-10 03:50:12 +00:00 (Migrated from github.com)

This landed in the v2.0.12 branch (merged there for testing; it reaches main with that release), so closing. Thanks!

This landed in the v2.0.12 branch (merged there for testing; it reaches `main` with that release), so closing. Thanks!
NotRexed commented 2026-11-10 03:55:27 +00:00 (Migrated from github.com)

Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.

Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.
hckrman101 (Migrated from github.com) approved these changes 2026-11-10 04:18:42 +00:00
hckrman101 (Migrated from github.com) left a comment

Looks good. The new checks match scripts/probe.py's own needs: the 11-field minimum is exactly what the later r[7:11] slice in val() requires, blank lines are skipped, and the frame count is checked before the a, b, c = ... unpack that used to traceback. The tests cover 0/1/2/4 frames, a truncated row with the right line number, and the existing NaN case (with blank lines now mixed in). test_probe_half_nan.py is already picked up by tests/run_all.py's tests/test_*.py discovery, so no registration is needed.

Nits, not blocking: a non-numeric field (e.g. the format column) in a row that has 11+ columns will still traceback in val(); and the message says 'Capture a new probe_*.txt' even when the real cause is a corrupted row, which is fine but a bit terse.

Overlap: #1467 also touches flash tooling, but in scripts/framelog.py and tests/test_framelog_integrity.py, so there is no file overlap with this PR. They are independent. CI: Python source checks (windows) and the Windows/AppImage builds pass; a few jobs (ubuntu Python checks, actionlint) were still pending when I looked.

Looks good. The new checks match scripts/probe.py's own needs: the 11-field minimum is exactly what the later `r[7:11]` slice in `val()` requires, blank lines are skipped, and the frame count is checked before the `a, b, c = ...` unpack that used to traceback. The tests cover 0/1/2/4 frames, a truncated row with the right line number, and the existing NaN case (with blank lines now mixed in). test_probe_half_nan.py is already picked up by tests/run_all.py's tests/test_*.py discovery, so no registration is needed. Nits, not blocking: a non-numeric field (e.g. the format column) in a row that has 11+ columns will still traceback in `val()`; and the message says 'Capture a new probe_*.txt' even when the real cause is a corrupted row, which is fine but a bit terse. Overlap: #1467 also touches flash tooling, but in scripts/framelog.py and tests/test_framelog_integrity.py, so there is no file overlap with this PR. They are independent. CI: Python source checks (windows) and the Windows/AppImage builds pass; a few jobs (ubuntu Python checks, actionlint) were still pending when I looked.
Commenting is not possible because the repository is archived.
No description provided.