Laboratory Instrumentation Telemetry Code Review
Review real-time data acquisition and device driver scripts used in experimental research laboratories for data integrity and error tolerance.
Use this template to audit custom lab software interfacing with sensors, spectrometers, or test rigs. It surfaces race conditions, buffer overflows, timestamp drift, and faulty failover logic before critical experimental runs.
Role: Lead Scientific Computing Systems Engineer with specialized expertise in embedded lab instrumentation, serial communications, and experimental data acquisition.
Context
- Research Facility: {{laboratory_name}}
- Device Hardware Interface: {{hardware_interface}}
- Acquisition Framework: {{acquisition_framework}}
- Required Sampling Frequency: {{sampling_rate}}
- Data Storage Destination: {{data_storage_target}}
- Instrumentation Source Code: {{raw_telemetry_code}}
Task
Deliver an engineering review report evaluating the laboratory data acquisition code in {{raw_telemetry_code}} to guarantee measurement fidelity, sensor communication resilience, and zero-loss streaming to {{data_storage_target}}.
Method
- Inspect serial, network, or bus polling routines across {{hardware_interface}} in {{raw_telemetry_code}} for blocking calls.
- Evaluate buffer sizing and memory management under the operational load imposed by {{sampling_rate}}.
- Verify timestamp synchronization, clock drift compensation, and microsecond-level telemetry tagging accuracy.
- Analyze connection recovery mechanisms to ensure automatic reconnects during hardware brownouts or signal drops at {{laboratory_name}}.
- Audit parsing and serialization logic converting raw byte streams into structured payloads for {{data_storage_target}}.
- Review exception handling around sensor calibration offsets, parity errors, and incomplete packet frames.
- Formulate a technical action plan highlighting critical hardware interface fixes and throughput optimizations.
Constraints
- Recommendations MUST NOT increase latency beyond the timing tolerances required by {{sampling_rate}}.
- MUST verify that data writes to {{data_storage_target}} utilize non-blocking, atomic, or journaled operations.
- Critiques MUST focus strictly on real-time acquisition reliability, concurrency bugs, and hardware interface robustness.
- Avoid recommending generic web development patterns unsuitable for hardware-coupled scientific software.
Output format
Generate the review report arranged in four labeled sections:
- Telemetry Pipeline Overview (concise operational diagram and summary, max 200 words)
- Concurrency and Buffer Integrity Assessment (detailed review of threading, locks, and buffers)
- Hardware Fault Tolerance Analysis (bulleted review of hardware disconnect and error handling)
- Hardening Recommendations and Refactored Examples (concrete code updates for {{raw_telemetry_code}})
Self-review
- Confirm that timing constraints matching {{sampling_rate}} are thoroughly verified.
- Ensure hardware-specific protocols over {{hardware_interface}} are accurately addressed.
- Check that persistent storage strategies for {{data_storage_target}} prevent data corruption during power loss.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.