fix(replay): stream sealed perception overlays
This commit is contained in:
@@ -14,6 +14,8 @@ import k1link.compute.results as result_module
|
||||
from k1link.compute import (
|
||||
RecordedCalibratedFusionStore,
|
||||
RecordedPerceptionEpochStore,
|
||||
RecordedPerceptionOverlayArtifact,
|
||||
RecordedPerceptionOverlayMux,
|
||||
RecordedPerceptionOverlayStore,
|
||||
prepare_camera_compute_job,
|
||||
validate_recorded_calibrated_fusion,
|
||||
@@ -500,6 +502,56 @@ def test_calibrated_fusion_is_bound_to_full_epoch_and_reuses_render_cache(
|
||||
assert calls == 1
|
||||
|
||||
|
||||
def test_perception_mux_preserves_file_backed_artifact(tmp_path: Path) -> None:
|
||||
payload = b"RRF2sealed"
|
||||
overlay = tmp_path / "sealed.rrd"
|
||||
overlay.write_bytes(payload)
|
||||
artifact = RecordedPerceptionOverlayArtifact(
|
||||
path=overlay,
|
||||
byte_length=len(payload),
|
||||
sha256=hashlib.sha256(payload).hexdigest(),
|
||||
)
|
||||
|
||||
class Primary:
|
||||
def materialize(
|
||||
self,
|
||||
_session_id: str,
|
||||
*,
|
||||
application_id: str,
|
||||
recording_id: str,
|
||||
) -> RecordedPerceptionOverlayArtifact:
|
||||
assert application_id == "nodedc_mission_core_recorded"
|
||||
assert recording_id == "recording-1"
|
||||
return artifact
|
||||
|
||||
def render(
|
||||
self,
|
||||
_session_id: str,
|
||||
*,
|
||||
application_id: str,
|
||||
recording_id: str,
|
||||
) -> bytes:
|
||||
raise AssertionError(f"byte rendering must not run: {application_id}/{recording_id}")
|
||||
|
||||
mux = RecordedPerceptionOverlayMux(Primary(), None)
|
||||
assert (
|
||||
mux.materialize(
|
||||
"session-1",
|
||||
application_id="nodedc_mission_core_recorded",
|
||||
recording_id="recording-1",
|
||||
)
|
||||
== artifact
|
||||
)
|
||||
assert (
|
||||
mux.render(
|
||||
"session-1",
|
||||
application_id="nodedc_mission_core_recorded",
|
||||
recording_id="recording-1",
|
||||
)
|
||||
== payload
|
||||
)
|
||||
|
||||
|
||||
def test_calibrated_fusion_rejects_changed_array_artifact(tmp_path: Path) -> None:
|
||||
job = _job(tmp_path)
|
||||
perception_root = _epoch_result(tmp_path, job)
|
||||
|
||||
Reference in New Issue
Block a user