fix(viewer): make recorded layers deterministic

This commit is contained in:
DCCONSTRUCTIONS
2026-07-23 11:42:19 +03:00
parent 3a64f54dea
commit ee15160862
6 changed files with 222 additions and 34 deletions
@@ -309,6 +309,39 @@ test("recorded blueprint fetch is bounded, strict and sends only display setting
show_cuboids_3d: true,
});
await fetchRecordedBlueprintRrd(
"http://127.0.0.1:5174/api/v1/observation-sessions/session-1/blueprint.rrd",
{
accumulationSeconds: 0,
showGrid: true,
showPoints: true,
showTrajectory: true,
pointSize: 2.5,
palette: "turbo",
customColor: "#ffffff",
},
{ applicationId: "nodedc_mission_core_recorded", recordingId: "recording-001" },
{
origin: "http://127.0.0.1:5174",
blueprintSessionId: "b".repeat(32),
perceptionLayers: {
enabled: true,
detections2d: false,
segmentation: false,
cuboids3d: true,
},
fetcher: async (input, init) => {
calls.push({ input: String(input), init, body: JSON.parse(String(init.body)) });
return new Response(payload, {
status: 200,
headers: { "Content-Type": "application/vnd.rerun.rrd" },
});
},
},
);
assert.equal(calls[1].body.unified_perception, false);
assert.equal(calls[1].body.show_cuboids_3d, true);
await assert.rejects(
fetchRecordedBlueprintRrd(
"https://outside.invalid/api/v1/observation-sessions/session-1/blueprint.rrd",
@@ -128,6 +128,51 @@ test("recorded autoplay waits for the full range and then runs exactly once", ()
assert.equal(gate.attempted(), true);
});
test("recorded autoplay starts at the first presentable camera frame without shrinking the range", () => {
const gate = createRecordedAutoplayGate();
const seeks = [];
const range = { min: 0, max: 535_717_620_042 };
assert.equal(gate.attempt(
true,
true,
true,
range,
(value) => seeks.push(value),
() => {},
35_421_857_292,
), true);
assert.deepEqual(seeks, [35_421_857_292]);
assert.deepEqual(range, { min: 0, max: 535_717_620_042 });
});
test("recorded autoplay clamps an invalid presentation start to the admitted archive", () => {
const before = createRecordedAutoplayGate();
const after = createRecordedAutoplayGate();
const seeks = [];
const range = { min: 5, max: 10 };
assert.equal(before.attempt(
true,
true,
true,
range,
(value) => seeks.push(value),
() => {},
-50,
), true);
assert.equal(after.attempt(
true,
true,
true,
range,
(value) => seeks.push(value),
() => {},
50,
), true);
assert.deepEqual(seeks, [5, 10]);
});
test("a failed vendor autoplay attempt is consumed instead of rewinding later", () => {
const gate = createRecordedAutoplayGate();
let seeks = 0;