fix(v7): store WaveformConfig on self; add set_waveform parity; fix magic 32

- Move WaveformConfig() from per-frame local in _run_host_dsp to
  self._waveform in __init__, mirroring ReplayWorker pattern.
- Add set_waveform() to RadarDataWorker for injection symmetry with
  ReplayWorker.set_waveform() — live path is now configurable.
- Replace hardcoded fallback 32 with self._waveform.n_doppler_bins.
- Update AST contract tests: WaveformConfig() check moves to __init__
  parse; attribute chains updated from ("wf", ...) to
  ("self", "_waveform", ...) to match renamed accessor.
This commit is contained in:
Jason
2026-04-21 02:35:53 +05:45
parent f895c0244c
commit ebd96c90ce
2 changed files with 21 additions and 15 deletions
+12 -9
View File
@@ -672,16 +672,19 @@ class TestLiveReplayPhysicalUnitsParity(unittest.TestCase):
return False
def test_live_path_uses_waveform_config(self):
"""_run_host_dsp must call WaveformConfig() and read
wf.range_resolution_m / wf.velocity_resolution_mps — not
self._settings.range_resolution / velocity_resolution."""
"""RadarDataWorker.__init__ must instantiate WaveformConfig() into
self._waveform; _run_host_dsp must read self._waveform.range_resolution_m
/ velocity_resolution_mps — not self._settings equivalents."""
init = self._parse_method("RadarDataWorker", "__init__")
self.assertTrue(self._has_call_to(init, "WaveformConfig"),
"RadarDataWorker.__init__ must instantiate WaveformConfig() into self._waveform.")
method = self._parse_method("RadarDataWorker", "_run_host_dsp")
self.assertTrue(self._has_call_to(method, "WaveformConfig"),
"Live path must instantiate WaveformConfig().")
self.assertTrue(self._has_attribute_chain(method, ("wf", "range_resolution_m")),
"Live path must read wf.range_resolution_m.")
self.assertTrue(self._has_attribute_chain(method, ("wf", "velocity_resolution_mps")),
"Live path must read wf.velocity_resolution_mps. "
self.assertTrue(
self._has_attribute_chain(method, ("self", "_waveform", "range_resolution_m")),
"Live path must read self._waveform.range_resolution_m.")
self.assertTrue(
self._has_attribute_chain(method, ("self", "_waveform", "velocity_resolution_mps")),
"Live path must read self._waveform.velocity_resolution_mps. "
"RadarSettings.velocity_resolution default 1.0 caused ~5.34x "
"underreport vs replay (test_v7.py:449 pins ~5.343).")
self.assertFalse(self._has_attribute_chain(