Author: Erik Fehn (Bulkhead Tau) Status: Published (2026-06-10) Paper group: Sensor-to-Simulation Engineering Depends on: 1.27 (WHITE_PAPER_WEARABLE_SENSOR_CORPUS.md) — sensor corpus Depends on: 1.28 (WHITE_PAPER_LABWIRED_PLATFORM.md) — simulation platform Trilogy role: synthesis paper for 1.27 + 1.28 Platform review: Andrii Shylenko reviewed the LabWired platform boundary used here via the Paper 1.28 review, including the corrected STM32F401 fidelity claim: register state-machine behavior, reset values, and cycle cost are modeled; analog bus-edge timing is not claimed.
The gap between a working firmware simulation and a meaningful one is data. A simulation driven by synthetic cosine sweeps proves that a pipeline exists; a simulation driven by real recorded sensor data can test whether firmware behaves correctly under documented field conditions. This paper takes the sensor corpus characterized in 1.27 — bounded to event-driven sensors by the fidelity-boundary analysis there — and the LabWired peripheral-accurate simulation platform described in 1.28, and asks what end-to-end validations the combination enables. The combined pipeline supports a specific, narrow class of firmware validation: deterministic replay of documented sensor events through the shm_i2c bridge into register-accurate, cycle-costed I2C controller transactions on the STM32F401 demo target. In the PROX-HIL-003 run, Bulkhead Tau used that path to replay a documented physical proximity capture through the ProximityAgent HIL pipeline, closing the real-data evidence gate for this bounded case.
The two prior papers in the trilogy answer adjacent questions:
shm_i2c Path B), decoupled from the data source.1.29 asks what the combination produces. Given 1.27's corpus and 1.28's platform, what firmware validation becomes possible that bench testing alone cannot deliver? The headline answer: deterministic, replayable firmware behavior under recorded field conditions, bounded by LabWired's register-accurate, cycle-costed F401 model, with the Tempo trace as the evidence artifact. Bulkhead Tau is the public release line for this deterministic-substrate work: the model-facing and publication-facing layer, while correctness comes from local substrates, harnesses, and validation artifacts. In this instance, Bulkhead Tau uses LabWired to turn a physical proximity-sensor capture into a replayable HIL test for the ProximityAgent firmware. This paper documents that pipeline as built, identifies what it does not enable, and sets up the conditions under which it could extend.
The PROX-HIL-001 proof run (May 2026, documented at docs/domain_runs/PROX-HIL-001/report.md) ran the full HIL pipeline against synthetic distance data:
t = np.linspace(0, 2 * np.pi, samples)
distances = 200 + 100 * np.cos(t) # mm — cosine sweep, 300 mm peak to 100 mm trough
This proved:
shm_i2c register contract is correctly implemented by the LabWired-side device model (crates/core/src/peripherals/components/shm_i2c.rs) and by the firmware-side reader.shm_i2c shared-memory file → LabWired Machine → firmware I2C driver → register-accurate, cycle-costed read → STATUS-clear write executes end-to-end on the v0.14.0 F401 milestone (confirmed by commit 553700a).What it did not prove:
The PROX-HIL-001 evidence is therefore bounded: the plumbing is verified; the firmware-behavior-under-real-data claim is not. This paper's target contribution is the next step — replacing synthetic input with provenance-backed physical sensor data and producing the next layer of evidence.
To validate the proximity sensor's firmware under real-data conditions, the replay source must be a documented physical range-finder capture stored in domains/SensorAgents/ProximityAgent/data/proximity.db. This provenance bar is closed by the PROX-HIL-003 packet: Session 5 (Physical Capture: PROX-HIL-003 Hand/Arm motion) represents a documented physical sensor capture with 3,900 samples.
The completed data path is:
Physical Proximity Sensor (documented capture session 5)
→ proximity.db (session_id = 5, provenance recorded)
→ 3,900 distance readings (timestamp_ms, distance_mm)
→ shm_i2c register injection (STATUS = 0x02 = data_ready, DIST_H, DIST_L)
→ LabWired firmware execution (I2C transaction, STATUS-clear ACK)
→ Tempo span: attributes = {real_data: true, run_id: "PROX-HIL-003", session_id: 5}
The co-simulation pipeline reuses the entire PROX-HIL-001 mechanism. The Python harness (sensor_replay_hil.py) queries the raw distance recordings and streams them into the shared-memory file /tmp/labwired_proximity_imu backed by the shm_i2c virtual device model. The co-simulation steps the virtual machine in cycle-locked synchronization based on the data stream, ensuring the firmware driver processes each sample before the next one is written.
An alternative approach considered was mapping discrete tennis stroke events (from the Babolat POP sensor) to simulated distance profiles using a physics transform. While that synthesis represents a potential future expansion for testing sports wearables, it was rejected for Paper 1.29's core validation because:
Direct replay of a documented physical range-finder session would honor the "real sensor data" requirement and maintain domain coherence without requiring custom, uncalibrated transforms. Replay of an undocumented database session does not.
shm_i2c Bridge as Abstraction LayerThe architectural payoff of LabWired's Path B model (1.28 §5) is that the bridge is the abstraction layer for sensor-data injection. From the firmware's perspective:
shm_i2c register contract.#ifdef SIMULATION branches, no test-mode flags, no harness-aware logic.real_data vs synthetic, fixture name, session_id if recoverable from the source) so the trace itself documents what was being tested.From the harness's perspective:
shm_i2c device serves those bytes when the firmware reads.This is the architectural payoff over Path A (declarative register banks per 1.28 §4): Path A can only hold static values; Path B supports any data source that can write bytes at the harness side. For sensor-driven HIL, Path B is the only viable model.
This abstraction is further validated by Andrii Shylenko's upstream proximity lab example (feat/nrf52840-hcsr04-proximity-lab branch of labwired-core), which establishes a runnable nRF52840 co-simulation directly alongside the shared-memory sensor bridge. By demonstrating BLE wireless distance telemetry and GPIO status updates running against the same shm_i2c virtual interface, the lab example confirms that the bridge serves as a general-purpose, platform-agnostic boundary for hardware-in-the-loop co-simulation, decoupled from the underlying microarchitecture.
The May 15 (operator-side May 18 verification) v0.14.0 milestone closed the loop from synthetic firmware-side testing to cycle-costed, register-state-machine I2C transactions. Before v0.14.0, the I2C peripheral on the F401 target was a stub that handled the read/write contract but did not model the controller state with the same fidelity. After v0.14.0, the I2C transactions in the Tempo trace reflect the F401 register state machine, reset values, and cycle cost boundary described in 1.28 §6. They do not claim analog bus-edge timing fidelity.
For 1.29's purposes: with provenance-backed sensor data flowing through the bridge and register-accurate, cycle-costed I2C transactions on the firmware side, the resulting Tempo trace is evidence of what the firmware did under a documented physical replay to the precision of that LabWired F401 model. That is a stronger claim than either piece alone supports. The earlier PROX-HIL-002 packet did not supply provenance-backed physical input; PROX-HIL-003 does.
Bulkhead Tau verification of the milestone is documented in commits 553700a (milestone confirmation) and 821e8fd + dddbdda (the PROX-HIL-001 functional rerun cycle that confirmed v0.14.0 integration). Per 1.28 §9, the integration friction (PyO3 + maturin version drift, wheel-rebuild discipline) is now resolved; future Bulkhead Tau runs against v0.14.0 should not hit those issues.
The co-simulation was exercised using the following replay experiment:
session_id = 3) in proximity.db. The tracked repository does not document this session's physical-capture provenance. Its shape is a threshold-oriented profile: an initial $300\text{ mm}$ plateau, a short transition, and a long $10\text{ mm}$ plateau.sensor_replay_hil.py) to stream the readings into the shm_i2c shared-memory file, driving the virtual STM32F401 machine in cycle-locked synchronization.docs/domain_runs/PROX-HIL-002/report.md.This experiment validates the replay harness and firmware threshold path against a database-sourced profile. It does not close the Paper 1.29 real-sensor-data gate.
The physical co-simulation was executed to close the real-data validation gate:
docs/domain_runs/PROX-HIL-003/raw_capture.csv).proximity.db as Session 5.shm_i2c to drive the virtual STM32F401 machine.All sensor data used in HIL runs stays local. The Tempo trace exports span metadata only — no raw sensor values leave the machine. The shm_i2c path is explicitly local: the shared-memory file is in /tmp/, and the file's contents are not exported anywhere. This is consistent with the privacy doctrine established in 1.21 (PRIVACY_IS_WORTH_PAYING_FOR.md).
The Babolat POP log files themselves (~/Downloads/SensorDownload/Current/) are operator-controlled and stay on the operator's machine. The sensor-replay harness reads them locally; no upload path exists in the pipeline.
Three extensions that the current pipeline supports but the current evidence does not address:
Three claims, bounded by the prior trilogy:
PROX-HIL-003 results.shm_i2c Path B bridge is the architectural feature that makes this possible. Any future sensor-data source — recorded, live, multi-sensor — uses the same abstraction; only the harness changes.| Artifact | Status | Location / Reference |
|---|---|---|
PROX-HIL-001 Report | exists (synthetic-data baseline) | docs/domain_runs/PROX-HIL-001/report.md |
PROX-HIL-002 Report | exists (database replay; quarantined as real-data evidence) | docs/domain_runs/PROX-HIL-002/report.md |
PROX-HIL-003 Report | exists (physical replay; closes real-data gate) | docs/domain_runs/PROX-HIL-003/report.md |
| Sensor-Replay Harness | implemented (Python) | domains/SensorAgents/ProximityAgent/sensor_replay_hil.py |
| Execution Wrapper | implemented (Bash) | scripts/run_sensor_replay_otel.sh |
| Run Manifest | exists (metrics JSON) | docs/domain_runs/PROX-HIL-003/manifest.json |
Published 2026-06-10. Drafted from PROX-HIL-001 evidence, the 1.27 sensor corpus, and the 1.28 LabWired active draft. Closed by the PROX-HIL-003 physical capture co-simulation run.