Skip to content

Commit 8534b25

Browse files
committed
changelog partial update
1 parent 499beec commit 8534b25

1 file changed

Lines changed: 58 additions & 10 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,35 @@ release.
7474
- The generated sample-data README now annotates each IQ file as a
7575
*(noise-floor reference)* or *(burst captured)*.
7676
- `.gitignore`: `tests/fm_testdata/` (deterministic, regenerable output).
77+
- `tests/test_interrupt_clean.py`: the clean-interrupt contract as a tested
78+
guarantee on BOTH platforms, replacing the "untested on Windows" caveat in
79+
`core.py`. The stub child now records WHICH signal it caught, so the tests
80+
distinguish the clean interrupt (SIGINT on POSIX; SIGBREAK from
81+
CTRL_BREAK_EVENT on Windows, traversing the `.bat` launcher layer like the
82+
real tools) from the `terminate()` escalation -- previously a broken
83+
CTRL_BREAK path could hide behind a working escalation. Also asserted:
84+
output written by the child's interrupt handler is drained into `stop()`'s
85+
result (the no-truncated-capture contract), and a child that ignores the
86+
interrupt is still reaped and reported unclean. The Windows CI leg proves
87+
the Windows path on the next push. (plan:#4, Phase 3a)
88+
- OS dead-man for handle-mode children (closes the long-standing
89+
`TODO(os-deadman)` in `core.py`): the atexit backstop never runs on
90+
SIGKILL / TerminateProcess, so a hard-killed parent could leave a
91+
transmitter on the air. Now the OS itself ends the child when the parent
92+
dies: Linux children set `PR_SET_PDEATHSIG` to SIGINT in preexec (the
93+
CLEAN interrupt -- the dead-man is the flush path, with a `getppid()`
94+
check closing the fork-window race), and Windows children are assigned to
95+
a Job Object with `KILL_ON_JOB_CLOSE` (terminating the whole
96+
`.bat` -> python tree; the job handle lives on the `_Process`). macOS has
97+
no equivalent primitive; the atexit backstop remains the net there,
98+
documented. Gated exactly like the atexit registry: TX always, RX unless
99+
`backstop_rx=False`. `tests/test_deadman.py` proves it with a real
100+
SIGKILL of an intermediate parent on POSIX -- the child dies AND its
101+
interrupt handler ran -- plus the opt-out gate; the Windows Job Object
102+
leg proves on the next CI push. (plan:#4, Phase 3b)
103+
- `hackrfpy.__version__`, resolved from installed package metadata
104+
(`importlib.metadata`), with a `0.0.0+unknown` fallback for uninstalled
105+
checkouts. (plan:#7)
77106
- `examples/fm_demod_to_wav.py`: the missing last mile -- demodulate a
78107
captured broadcast-FM IQ file to an audible mono 16-bit WAV using only
79108
numpy and the stdlib. Channelize (staged windowed-sinc decimation to
@@ -174,16 +203,35 @@ release.
174203
below 1e-9 (a few hundred taps at 200 kHz); a 2 s reference file demodulates
175204
in ~3 s end to end, with output identical to within 1 LSB. Stage timings are
176205
now printed so a future stall is self-locating.
177-
178-
<!--
179-
Roadmap for this branch (append entries above as each lands):
180-
- Added: type annotations across the public API; mypy promoted to a CI gate
181-
(makes the shipped py.typed marker accurate).
182-
- CI: --cov-fail-under=85; confirm the Windows leg exercises the CTRL_BREAK
183-
lifecycle path.
184-
- Docs: note that a single HackRF instance is not safe to share across
185-
threads (deferred pending broader testing).
186-
-->
206+
- `sweep()` / `sweep_to_file()` silently truncated the TOP of the requested
207+
band: both MHz edges were floored, so `sweep(433.9e6, 434.1e6)` ran
208+
`433:434` and never covered 434.0-434.1 MHz even while warning about the
209+
snap. Edges now snap OUTWARD (floor the low edge, ceil the high edge) so
210+
the swept range always contains the requested band; the warning text says
211+
so. (plan:#2)
212+
- `monitor_frequencies()` reported the MEAN dB of the whole covering sweep
213+
segment as the power "at" a frequency, diluting a narrowband carrier
214+
toward the noise floor (a -20 dB carrier in one bin of a 10-bin segment
215+
read as -74). It now reads the bin covering the frequency (max of that
216+
bin +/-1 for tuning slop). Behavior change for `examples/channel_monitor.py`
217+
and any monitor consumer: readings of narrowband signals rise to their
218+
true level. (plan:#3)
219+
- Handle-mode output was not visible to the parent until process exit unless
220+
the child flooded: the drain thread read pipes with `BufferedReader.read(N)`,
221+
which blocks until N bytes (64 KB) accumulate, so small periodic writes --
222+
e.g. hackrf_transfer's ~60-byte-per-second stats lines -- sat invisible for
223+
what would be ~18 minutes of real capture. Now `read1()`: bytes appear in
224+
the drain as soon as the child writes them. Found by the new clean-interrupt
225+
tests; also cut the test suite's wall time roughly in half by removing the
226+
same latency from every stubbed lifecycle test. (Phase 3a finding)
227+
- `_Process.stop()`'s escalation fired `terminate()` and returned without
228+
reaping: a child that ignored the interrupt could outlive `stop()`, and
229+
`result()` reported `returncode None`. The escalation is now a bounded,
230+
reaped ladder (interrupt -> terminate -> kill), so `stop()` always returns
231+
with the child dead and a real exit status. (Phase 3a finding)
232+
- `from_device()` guarded its parsed-info invariant with a bare `assert`,
233+
which `python -O` strips, letting raw text flow onward; it now raises
234+
`HackRFDeviceError`. (plan:#9)
187235

188236
## [1.0.0] - 2026-06-16
189237

0 commit comments

Comments
 (0)