From 7ec8c351bc288da36dd747474e209aaf3dab5739 Mon Sep 17 00:00:00 2001 From: LittleSam129 <1qwe432@gmail.com> Date: Fri, 18 Sep 2026 13:51:31 +0300 Subject: [PATCH] Fix RX targeted test scope --- docs/handoff/NEXT_RX_TASK.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/handoff/NEXT_RX_TASK.md b/docs/handoff/NEXT_RX_TASK.md index cda494f..771d45b 100644 --- a/docs/handoff/NEXT_RX_TASK.md +++ b/docs/handoff/NEXT_RX_TASK.md @@ -11,29 +11,35 @@ RX-ONLY HACKRF HARDWARE PREFLIGHT 1. GIT. In the laptop project named in RX_NODE_STATE.md, record the starting branch, HEAD, and `git status --short --untracked-files=no`. Stop if tracked files are modified or the branch is not `video-development`. Run `git pull origin video-development`. Require `git branch --show-current` = `video-development`, `git rev-parse HEAD` = `git rev-parse origin/video-development`, and a clean tracked checkout. Local ignored or untracked RF-001 results outside Git are not a conflict. -2. VIDEO FIXTURE. Check whether `data/raw/video001/udacity_project_video.mp4` exists, then record its size and `Get-FileHash -Algorithm SHA256`. The required file has 25268015 bytes and SHA256 `651949922042c223375d40bf8929def97dbb62c6ade651d1f5b08eea47127d5f`. A same-size file with SHA256 `bff9b28d0e1f5442cfdf9f2bd51251d66506ca518ad7dfe6074670859731a8fb` is not valid. If absent or mismatched, report VIDEO FIXTURE = NOT_READY and VIDEO GATE = NOT_RUN. This is NON-BLOCKING FOR RX-ONLY RF-001 HARDWARE PREFLIGHT. Do not download or substitute a file, change the expected SHA256, or weaken the VIDEO-001 check. If size and SHA256 both match, run the complete `python -B -X utf8 tools/video_gate.py` and report its result separately. VIDEO fixture and VIDEO GATE do not determine readiness at this RX-only stage. +2. VIDEO FIXTURE AND SEPARATE VIDEO TESTS. Check whether `data/raw/video001/udacity_project_video.mp4` exists, then record its size and `Get-FileHash -Algorithm SHA256`. The required file has 25268015 bytes and SHA256 `651949922042c223375d40bf8929def97dbb62c6ade651d1f5b08eea47127d5f`. A same-size file with SHA256 `bff9b28d0e1f5442cfdf9f2bd51251d66506ca518ad7dfe6074670859731a8fb` is not valid. If absent or mismatched, report VIDEO FIXTURE = NOT_READY, VIDEO FIXTURE TESTS = NOT_RUN / BLOCKED_BY_FIXTURE, and VIDEO GATE = NOT_RUN. This is NON-BLOCKING FOR RX-ONLY HARDWARE PREFLIGHT. Do not download or substitute a file, change the expected SHA256, weaken VIDEO-001 checks, or mark the two previously failing VIDEO-004 tests PASS. If the fixture is valid, run the complete `python -B -X utf8 tools/video_gate.py` and report the VIDEO fixture test and gate results separately; failures remain failures and do not become RF targeted test results. -3. MANDATORY SOFTWARE CHECKS. Run targeted VIDEO/RF pytest, targeted Ruff, Pyright, and `git diff --check` even if VIDEO FIXTURE = NOT_READY. The VIDEO-001 unit tests do not require the MP4 fixture. On PowerShell: +3. RF TARGETED PYTEST. Run the following explicit, fixture-independent RF/QPSK test scope. Do not expand the wildcard `test_video*.py` or add the entire VIDEO-004 suite to this mandatory command: + +```powershell +python -B -m pytest tests/test_packet.py tests/test_video003_modem.py tests/test_video005_iq.py tests/test_rf001_preparation.py tests/test_clock001.py tests/test_hackrf_process_check.py -q +``` + +This covers packet parsing and CRC, QPSK modulation/demodulation, FEC 2/3, VIDEO-005 raw IQ timing and carrier recovery, the RF-001 offline TX/IQ/RX tools, CLOCK-001, and hardware-independent HackRF process checks. The RF-001 receiver uses the VIDEO-004 Viterbi decoder, which the full RF-001 round-trip test exercises. Outer erasure FEC reconstructs video frames and is not in the RF-001 packet receiver path; it is not part of this RF-only gate. These six files require neither `data/raw/video001/udacity_project_video.mp4` nor `data/raw/lab064/tx_metadata.json`. Missing Numba or another required dependency is a failure, not a reason to skip the RF-001 round trip. + +Also run targeted Ruff, Pyright, and `git diff --check`: ```powershell -$videoTests = @(Get-ChildItem -LiteralPath tests -Filter 'test_video*.py' -File | Select-Object -ExpandProperty FullName) -python -B -m pytest $videoTests tests/test_packet.py tests/test_bpsk_radio.py tests/test_rf001_preparation.py tests/test_clock001.py -q python -B -c "import subprocess, sys; from tools.video_gate import STATIC_PATHS; sys.exit(subprocess.call([sys.executable, '-B', '-m', 'ruff', 'check', *STATIC_PATHS]))" python -B -m pyright --project pyrightconfig.json git diff --check ``` -Repeat the software-only offline RF-001 round trip from `docs/rf/RF_001.md` in new local output paths: 100 generated packets → IQ file → independent receiver. Require 100/100 CRC-valid and 100/100 exact packets; preserve stdout and the JSON report. Run `hackrf_info` and record its full output. Stop before hardware streaming if any mandatory software check, offline packet count, Git check, or `hackrf_info` fails. +Repeat the software-only offline RF-001 round trip from `docs/rf/RF_001.md` in new local output paths: 100 generated packets → IQ file → independent receiver. Require 100/100 CRC-valid and 100/100 exact packets; preserve stdout and the JSON report. Run `hackrf_info` and record its full output. Stop before hardware streaming if RF TARGETED PYTEST, Ruff, Pyright, `git diff --check`, the offline packet counts, the Git checks, or `hackrf_info` fails. -4. HISTORICAL LAB064. The missing `data/raw/lab064/tx_metadata.json` is not a blocker for this RF-001 RX-only stage. Do not create or simulate it. A full `python -B -m pytest tests/ -q` is optional; if run, classify only the verified failure caused by that missing file as HISTORICAL LAB064 FIXTURE MISSING. Any other new failure blocks readiness. +4. HISTORICAL LAB064. The missing `data/raw/lab064/tx_metadata.json` is not in RF TARGETED PYTEST and is NON-BLOCKING FOR RF-001 RX NODE. Do not create or simulate it. A full `python -B -m pytest tests/ -q` is optional; if run, classify only the verified failure caused by that missing file as HISTORICAL LAB064 FIXTURE MISSING. Any other new failure blocks readiness and stops the hardware stream test. -5. RX-ONLY HARDWARE PREFLIGHT. After step 3 passes, open the HackRF only as a receiver. Make one bounded raw IQ capture at 8,000,000 samples/s, center frequency 1,400,000,000 Hz, for about 5 seconds. Record the exact receive-only command and settings. A 5-second `cs8` capture contains 40,000,000 complex samples and 80,000,000 bytes if complete. Save the raw interleaved signed I/Q bytes in a new local file outside Git; do not overwrite prior captures. Preserve stdout/stderr, start and end times, the file size and SHA256, actual sample count and duration, elapsed wall time, and measured file write rate. Record every available RX overrun observation during the run and the final value, USB errors, and file write errors. Never convert an absent or incomplete counter into zero: report NOT_REPORTED and mark the stream test FAIL if capture integrity cannot be verified. Any nonzero overrun, USB error, file write error, truncated file, or capture failure is FAIL. Use a capture tool in receive-only mode; `hackrf_transfer` is permitted for this bounded RX capture only, never with a transmit option. No transmitter is used, and RF-001 packet decoding is not part of this test. +5. RX-ONLY HARDWARE PREFLIGHT. When all mandatory checks in step 3 pass, RX NODE READY FOR RX-ONLY HARDWARE TEST = YES even if VIDEO FIXTURE = NOT_READY and VIDEO GATE = NOT_RUN. Open the HackRF only as a receiver. Make one bounded raw IQ capture at 8,000,000 samples/s, center frequency 1,400,000,000 Hz, for about 5 seconds. Record the exact receive-only command and settings. A 5-second `cs8` capture contains 40,000,000 complex samples and 80,000,000 bytes if complete. Save raw interleaved signed I/Q bytes in a new local file outside Git; do not overwrite prior captures. Preserve stdout/stderr, start and end times, file size and SHA256, actual sample count and duration, elapsed wall time, and measured file write rate. Record every available RX overrun observation during the run and the final value, USB errors, and file write errors. Never convert an absent or incomplete counter into zero: report NOT_REPORTED and mark the stream test FAIL if capture integrity cannot be verified. Any nonzero overrun, USB error, file write error, truncated file, or capture failure is FAIL. Use a receive-only tool; `hackrf_transfer` is permitted for this bounded RX capture only, never with a transmit option. Do not decode RF-001 packets: the transmitter is off. -6. CLASSIFICATION. Set RX-ONLY IQ STREAM TEST = PASS only for a complete capture with clean, sufficiently observed counters. Set RX NODE READY FOR RF-001 OTA = YES only if the Git checks, targeted VIDEO/RF pytest, targeted Ruff, Pyright, `git diff --check`, offline RF-001 100/100, `hackrf_info`, and RX-only IQ stream test all pass. VIDEO fixture, VIDEO GATE, and the sole verified historical Lab064 fixture failure are separate findings and do not block this stage. Readiness does not authorize RF TX; that requires a separate explicit task. +6. CLASSIFICATION. Set RX-ONLY IQ STREAM TEST = PASS only for a complete capture with clean, sufficiently observed counters. Set RX NODE READY FOR RF-001 OTA = YES only if the Git checks, RF TARGETED PYTEST, targeted Ruff, Pyright, `git diff --check`, offline RF-001 100/100 CRC-valid and 100/100 exact packets, `hackrf_info`, and RX-only IQ stream test all pass. VIDEO fixture, VIDEO fixture tests, VIDEO GATE, and the sole verified historical Lab064 fixture failure are separate findings and do not block this RF-only stage. Readiness does not authorize RF TX; that requires a separate explicit task. 7. Do not perform RF TX, firmware or CPLD updates, `hackrf_spiflash`, Zadig, USB driver changes, commit, or push on the RX laptop. Do not add raw IQ or video files to Git. -8. Finish with the following report. Use PASS, FAIL, NOT_RUN, NOT_READY, or NOT_REPORTED as appropriate; state the cause of each failure. +8. Finish with the following report. Use PASS, FAIL, NOT_RUN, NOT_READY, BLOCKED_BY_FIXTURE, or NOT_REPORTED as appropriate; state the cause of each failure. TASK = RX-ONLY HACKRF HARDWARE PREFLIGHT @@ -42,20 +48,19 @@ BRANCH = HEAD = VIDEO FIXTURE = +VIDEO FIXTURE SHA256 = +VIDEO FIXTURE TESTS = VIDEO GATE = -TARGETED PYTEST = +RF TARGETED PYTEST = RUFF = PYRIGHT = GIT DIFF CHECK = OFFLINE RF-001 = - HACKRF INFO = RX-ONLY IQ STREAM TEST = -PASS / FAIL - SAMPLE RATE = CAPTURE DURATION = CAPTURE SIZE =