diff --git a/AGENTS.md b/AGENTS.md
index b4d25513..b6bfa5a3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -960,6 +960,12 @@ on three draws with false transitions at ownship's turns, one leg 27%); a turn d
turn: Debrief blind (31.9%), independent slices 1.4%, joined legs 3.1% (instant knot placed late);
held course: no false split. No splitter wins everywhere. Slides
`site/blog/2026-11-21-leg-splitters-slides.md`; next is the owner's choice.
+Follow-up 2026-11-22 (owner's review): arrowheads at track ends; an optional course & speed chart
+(both vessels, estimate dashed; true turns shaded, detected turns as edge strips: target orange
+right, ownship teal left, only Debrief detects ownship turns, `splitter_ownship_spans`); the error
+chart's quantity as a drop-down; the Preset drop-down shows the matching preset or "custom"; a
+waypoint drag keeps the adjacent legs' speeds (`moveWaypoint(..., "speed")`; the square keeps
+duration); ctrl-click deletes a waypoint. Schema 0.39.0.
## Stack (owner decisions, 2026-10-31)
diff --git a/conformance/onnx/demo_node.mjs b/conformance/onnx/demo_node.mjs
index c85574e0..529b1270 100644
--- a/conformance/onnx/demo_node.mjs
+++ b/conformance/onnx/demo_node.mjs
@@ -53,6 +53,21 @@ async function solveScenario(sc, name = sc.solver) {
}
// ---------- tracks ----------
+test("spec 036 follow-up: a waypoint drag that keeps speed changes the adjacent legs' durations, not their speeds", () => {
+ const tr = preset("good-geometry").ownship;
+ const W0 = T.waypoints(tr);
+ const moved = T.moveWaypoint(tr, 2, W0[2][0] + 1, W0[2][1] - 0.5, "speed");
+ const W1 = T.waypoints(moved);
+ for (const j of [0, 1, 3, 4]) assert.ok(Math.hypot(W1[j][0] - W0[j][0], W1[j][1] - W0[j][1]) < 1e-9, `waypoint ${j} stayed`);
+ for (const i of [1, 2]) {
+ assert.ok(Math.abs(moved.legs[i].speed_kt - tr.legs[i].speed_kt) < 1e-9, `leg ${i} kept its speed`);
+ const len = Math.hypot(W1[i + 1][0] - W1[i][0], W1[i + 1][1] - W1[i][1]);
+ assert.ok(Math.abs(moved.legs[i].duration_s - (len / tr.legs[i].speed_kt) * 3600) < 1e-6, `leg ${i} duration follows its length`);
+ }
+ assert.equal(moved.legs[0].duration_s, tr.legs[0].duration_s);
+ assert.equal(moved.legs[3].duration_s, tr.legs[3].duration_s);
+});
+
test("waypoint drag moves only the adjacent legs (FR-002)", () => {
const tr = preset("good-geometry").ownship;
const W0 = T.waypoints(tr);
@@ -298,6 +313,14 @@ test("held course: no arctan splitter states a manoeuvre (good geometry, endfire
}
});
+test("spec 036 follow-up: Debrief's splitter states the ownship turns it found, between its steady legs", async () => {
+ const sc = preset("two-target-turns");
+ const { r } = await split(sc, "arctan-debrief");
+ const own = T.manoeuvres(bearings(sc).paths.own);
+ assert.equal(r.ownship_spans.length, own.length);
+ r.ownship_spans.forEach((f, i) => assert.ok(Math.abs((f.start_s + f.end_s) / 2 - (own[i].t0 + own[i].t1) / 2) < 30, `ownship turn ${i}`));
+});
+
test("two target turns inside ownship legs: joined legs find both, Debrief one, independent slices land between", async () => {
const sc = preset("two-target-turns");
const j = await split(sc, "arctan-joined");
diff --git a/conformance/onnx/demo_page.mjs b/conformance/onnx/demo_page.mjs
index c66a4078..961b5cb2 100644
--- a/conformance/onnx/demo_page.mjs
+++ b/conformance/onnx/demo_page.mjs
@@ -95,6 +95,33 @@ try {
await page.waitForTimeout(50);
const und = await state();
check("Delete removes a waypoint and undo restores it (FR-004, FR-007)", del.sc.ownship.legs.length === after.sc.ownship.legs.length - 1 && JSON.stringify(und.sc.ownship) === JSON.stringify(after.sc.ownship));
+
+ // spec 036 follow-up: the waypoint drag kept the adjacent legs' speeds; ctrl-click deletes a waypoint
+ const keptSpeed = [1, 2].every((i) => Math.abs(after.sc.ownship.legs[i].speed_kt - before.legs[i].speed_kt) < 1e-6) && [1, 2].some((i) => Math.abs(after.sc.ownship.legs[i].duration_s - before.legs[i].duration_s) > 1);
+ check("a waypoint drag keeps the adjacent legs' speeds and changes their durations (spec 036 follow-up)", keptSpeed, [1, 2].map((i) => [before.legs[i].duration_s, after.sc.ownship.legs[i].duration_s]));
+ await page.locator("[data-testid=wp-ownship-2]").click({ modifiers: ["Control"] });
+ await page.waitForTimeout(50);
+ const cdel = await state();
+ check("ctrl-click deletes a waypoint (spec 036 follow-up)", cdel.sc.ownship.legs.length === und.sc.ownship.legs.length - 1);
+ await page.keyboard.press("Control+z");
+ await page.waitForTimeout(50);
+ await settled();
+
+ // spec 036 follow-up: arrows at the tracks' ends, the preset shown, the error quantity as a drop-down, course and speed
+ const arrows = await page.locator("[data-testid=arrow-ownship], [data-testid=arrow-target]").count();
+ const shownPreset = await page.locator("[data-testid=preset]").inputValue();
+ check("an arrowhead at each track's end; the preset drop-down shows custom after an edit (spec 036 follow-up)", arrows === 2 && shownPreset === "custom", { arrows, shownPreset });
+ await page.selectOption("[data-testid=preset]", "good-geometry");
+ await settled();
+ const shown2 = await page.locator("[data-testid=preset]").inputValue();
+ await page.selectOption("[data-testid=error-quantity]", "range");
+ const ylab = await page.locator("[data-testid=chart-error]").innerHTML();
+ let kin = await page.locator("[data-testid=chart-course]").count();
+ await page.selectOption("[data-testid=kinematics-quantity]", "speed");
+ kin += await page.locator("[data-testid=chart-speed]").count();
+ const hErr = (await page.locator("[data-testid=chart-error]").boundingBox()).height, hBrg = (await page.locator("[data-testid=chart-bearings]").boundingBox()).height;
+ check("preset shown; error quantity by drop-down with the chart as tall as its neighbours; course and speed charts (spec 036 follow-up)", shown2 === "good-geometry" && /range error/.test(ylab) && kin === 2 && Math.abs(hErr - hBrg) < 2, { shown2, kin, hErr, hBrg });
+
await settled();
// acceptance 5: the URL restores the exact scenario and solution
@@ -170,7 +197,12 @@ try {
const cmpRows = await page.locator("[data-testid=compare-table] tbody tr").count();
const cmpState = await page.evaluate(() => { const c = window.__demo.compare(); return { status: c.status, done: Object.keys(c.rows) }; });
check("compare runs each splitter through the layer and tabulates them", cmpState.status === "done" && cmpState.done.length === 5 && cmpRows === 5, cmpState);
- if (process.env.DEMO_SHOT) await page.screenshot({ path: process.env.DEMO_SHOT, fullPage: false });
+ if (process.env.DEMO_SHOT) {
+ await page.selectOption("[data-testid=splitter]", "arctan-debrief");
+ await page.waitForTimeout(50);
+ await settled();
+ await page.screenshot({ path: process.env.DEMO_SHOT, fullPage: false });
+ }
// the whole-period learned model in the browser, with its progress shown while it loads
await page.selectOption("[data-testid=preset]", "target-turn");
diff --git a/schema/tma.yaml b/schema/tma.yaml
index 9b6dfae3..a5984781 100644
--- a/schema/tma.yaml
+++ b/schema/tma.yaml
@@ -6,7 +6,7 @@ description: >-
principle I). Frame: local flat-earth Cartesian, x east, y north, metres, origin at ownship's
window-start position. Bearings and courses are true, clockwise from north, radians in [0, 2π).
Speeds in m/s. Times in seconds since window start. All stored floats are float32-rounded.
-version: 0.38.0
+version: 0.39.0
license: Apache-2.0
prefixes:
linkml: https://w3id.org/linkml/
@@ -2251,6 +2251,7 @@ classes:
manoeuvre_prob: { range: float, multivalued: true, description: "The solver's probability that a target manoeuvre is in progress at each of manoeuvre_t_s." }
splitter: { range: string, description: "Spec 036: the leg splitter whose spans the solver used." }
splitter_spans: { range: DemoSpan, multivalued: true, inlined_as_list: true, description: "Spec 036: the manoeuvre spans the leg splitter stated, in the problem's time." }
+ splitter_ownship_spans: { range: DemoSpan, multivalued: true, inlined_as_list: true, description: "Spec 036 follow-up: ownship turns the leg splitter detected, in the problem's time (only a splitter that detects them, as Debrief's slicing)." }
splitter_runtime_ms: { range: float }
splitter_message: { range: string }
@@ -2262,6 +2263,8 @@ classes:
label: { range: string }
assumptions: { range: string, required: true, description: "Its method, in words." }
told_truth: { range: boolean, required: true, description: "It is told the true manoeuvre spans (an oracle)." }
+ detects_target: { range: boolean, description: "Spec 036 follow-up: it states target manoeuvres." }
+ detects_ownship: { range: boolean, description: "Spec 036 follow-up: it states ownship turns it detected." }
DemoSolverInfo:
description: "Spec 035 FR-024: what a solver plug-in declares."
diff --git a/site/blog/2026-11-21-leg-splitters-kickoff.md b/site/blog/2026-11-21-leg-splitters-kickoff.md
index faa52bff..4eafe53d 100644
--- a/site/blog/2026-11-21-leg-splitters-kickoff.md
+++ b/site/blog/2026-11-21-leg-splitters-kickoff.md
@@ -52,3 +52,27 @@ This is spec 036.
- A track plot of the two-turn preset with each splitter's track and knots.
- Data: `scripts/research/demo_splitters.mjs` on the page's own presets, recorded in
`experiments/20261121-demo-splitters/`.
+
+## Updates
+
+- 2026-11-22: from the owner's review of the merged demo:
+ - An arrowhead at the end of each track shows which way it is heading.
+ - A fourth optional chart, "course & speed", shows both vessels' course or speed (a drop-down:
+ course, speed or both) with the estimate dashed. True turns are shaded (blue ownship, red
+ target); turns a splitter detected are solid strips: orange target turns on the right edge,
+ teal ownship turns on the left. Only Debrief's slicing detects ownship turns, so only it
+ draws the teal strips.
+ - The error chart's quantity is a drop-down, so the chart is as tall as its neighbours and
+ their time axes line up.
+ - The Preset drop-down shows the preset the scenario matches, or "custom" once edited.
+ - Dragging a waypoint (circle) now keeps the adjacent legs' speeds, so their durations change.
+ Dragging a leg's square keeps its duration, so its speed changes.
+ - Ctrl-click (⌘-click) deletes a waypoint.
+ - Each leg's speed label sits on the leg's north side (west for a north–south leg), clear of
+ the square handle and the cursor that drags it. The read-out during a drag sits above and
+ to the left of the cursor. It says what is kept and what changes: "Keeping time: speed
+ changes" for a square (the leg's minutes, its old and new speed and course), "Keeping speed:
+ leg times change" for a circle (each adjacent leg's speed, its old and new minutes). The
+ hover tooltips on squares and circles say the same.
+ - Schema 0.39.0: `TmaSolution.splitter_ownship_spans`, and the `DemoSplitterInfo` flags
+ `detects_target` and `detects_ownship`.
diff --git a/site/src/pages/demo.js b/site/src/pages/demo.js
index e75fabfc..0b287178 100644
--- a/site/src/pages/demo.js
+++ b/site/src/pages/demo.js
@@ -105,7 +105,12 @@ function Chart({ title, xDomain, yLabel, series, bands = [], marks = [], height
{yLabel}{yLabel.length * 5.5 > width - PADL ? yLabel.slice(0, Math.max(4, Math.floor((width - PADL) / 5.5) - 1)) + "…" : yLabel}
{marks.map((m, i) => (
-
+ // m[3]: "left" or "right" draws a solid strip at that edge (a detection) instead of shading
+ m[3] ? (
+
+ ) : (
+
+ )
))}
{v0 < 0 && v1 > 0 && }
{bands.map((b, i) => {
@@ -193,7 +198,8 @@ function Demo() {
const [now, setNow] = useState(0);
const [nonce, setNonce] = useState(0); // "solve again" after a cancel
const [quantity, setQuantity] = useState("position");
- const [showCharts, setShowCharts] = useState({ error: true, bearings: true, residuals: true });
+ const [kinQ, setKinQ] = useState("course"); // spec 036 follow-up: course, speed or both
+ const [showCharts, setShowCharts] = useState({ error: true, bearings: true, residuals: true, kinematics: true });
const [importErrors, setImportErrors] = useState(null);
const [notice, setNotice] = useState(null);
const [dragLabel, setDragLabel] = useState(null);
@@ -397,6 +403,15 @@ function Demo() {
const index = Number(t.getAttribute("data-index"));
const p = toSvg(e);
svgRef.current.setPointerCapture(e.pointerId);
+ // spec 036 follow-up: ctrl-click (cmd-click) deletes a waypoint (not the start or the end)
+ if (kind === "wp" && (e.ctrlKey || e.metaKey)) {
+ const tr = sc[vessel];
+ if (index >= 1 && index < tr.legs.length) {
+ commit({ ...sc, [vessel]: T.deleteWaypoint(tr, index) });
+ setSel(null);
+ }
+ return;
+ }
if (kind === "wp" || kind === "handle" || kind === "leg") {
drag.current = { kind, vessel, index, p0: p, moved: false };
if (kind !== "leg") setSel({ vessel, kind: kind === "wp" ? "wp" : "leg", index });
@@ -419,16 +434,28 @@ function Demo() {
const tr = sc[d.vessel];
let next = tr;
if (d.kind === "wp") {
- next = T.moveWaypoint(tr, d.index, wx, wy);
+ // spec 036 follow-up: a waypoint drag keeps the adjacent legs' speeds, so their durations change
+ next = T.moveWaypoint(tr, d.index, wx, wy, "speed");
if (d.index === 0) {
// the start point moves the whole track
next = { ...tr, start_x_nm: wx, start_y_nm: wy };
+ setDragLabel({ x: p[0], y: p[1], title: "Moving the whole track", lines: ["every leg keeps its course, speed and time"] });
+ } else {
+ // say what is kept (speed) and what changes (time), leg by leg, against the values at the drag's start
+ const legs = [d.index - 1, d.index].filter((i) => i < next.legs.length);
+ setDragLabel({
+ x: p[0], y: p[1], title: "Keeping speed: leg times change",
+ lines: legs.map((i) => `leg ${i + 1}: ${fmt(next.legs[i].speed_kt, 1)} kt, ${fmt(tr.legs[i].duration_s / 60, 1)} → ${fmt(next.legs[i].duration_s / 60, 1)} min`),
+ });
}
- setDragLabel(null);
} else if (d.kind === "handle") {
const v = T.velocityFromHandle(tr, d.index, wx, wy);
next = T.setLegVelocity(tr, d.index, v.course_deg, Math.min(v.speed_kt, 40));
- setDragLabel({ x: p[0], y: p[1], text: `${fmt(next.legs[d.index].speed_kt, 1)} kt, ${fmt(next.legs[d.index].course_deg, 0)}°` });
+ const L0 = tr.legs[d.index], L1 = next.legs[d.index];
+ setDragLabel({
+ x: p[0], y: p[1], title: "Keeping time: speed changes",
+ lines: [`leg ${d.index + 1}: ${fmt(L1.duration_s / 60, 1)} min, ${fmt(L0.speed_kt, 1)} → ${fmt(L1.speed_kt, 1)} kt`, `course ${fmt(L0.course_deg, 0)}° → ${fmt(L1.course_deg, 0)}°; later legs swing with it`],
+ });
}
setDraft({ ...sc, [d.vessel]: next });
};
@@ -605,6 +632,19 @@ function Demo() {
return (
+ {(() => {
+ // spec 036 follow-up: an arrowhead at the track's end, along its final course
+ const end = T.stateAt(path, path.end);
+ const X = clampPx(sx(end.x / NM)), Y = clampPx(sy(end.y / NM));
+ const sp = Math.hypot(end.vx, end.vy);
+ if (!(sp > 0)) return null;
+ const ux = end.vx / sp, uy = -end.vy / sp; // screen y runs down
+ // beyond the end waypoint's circle, so the circle does not hide it
+ const L = 12, Wd = 6, off = 9;
+ const base = [X + ux * off, Y + uy * off], tip = [X + ux * (off + L), Y + uy * (off + L)];
+ const pts = [tip, [base[0] - uy * Wd, base[1] + ux * Wd], [base[0] + uy * Wd, base[1] - ux * Wd]];
+ return q.map((v) => v.toFixed(1)).join(",")).join(" ")} fill={colour} pointerEvents="none">{`${name === "ownship" ? "Ownship" : "Target"} heading ${fmt(((Math.atan2(end.vx, end.vy) / DEG) + 360) % 360, 0)}° at the end of the scenario`};
+ })()}
{/* faint polyline between waypoints: click to insert a waypoint (FR-004) */}
{Wp.slice(0, -1).map((w, i) => (
@@ -616,7 +656,7 @@ function Demo() {
const [hx, hy] = T.handleOf(tr, i);
return (
- {`Leg ${i + 1}: ${fmt(l.course_deg, 0)}°, ${fmt(l.speed_kt, 1)} kt, ${fmt(l.duration_s / 60, 1)} min. Drag to change course and speed; the rest of the track swings with it.`}
+ {`Leg ${i + 1}: ${fmt(l.course_deg, 0)}°, ${fmt(l.speed_kt, 1)} kt, ${fmt(l.duration_s / 60, 1)} min. Drag this square to change course and speed while keeping the leg's time; later legs swing with it.`}
);
})}
@@ -625,8 +665,11 @@ function Demo() {
const [ax, ay] = Wp[i], [bx, by] = Wp[i + 1];
const dx = sx(bx) - sx(ax), dy = sy(by) - sy(ay);
const len = Math.hypot(dx, dy) || 1;
- const nx = -dy / len, ny = dx / len;
- const mx = (sx(ax) + sx(bx)) / 2 + nx * 12, my = (sy(ay) + sy(by)) / 2 + ny * 12;
+ // on the leg's north side (west when the leg runs north–south), clear of the square
+ // handle at its middle and the cursor that drags it
+ let nx = -dy / len, ny = dx / len;
+ if (Math.abs(ny) > 0.3 ? ny > 0 : nx > 0) { nx = -nx; ny = -ny; }
+ const mx = (sx(ax) + sx(bx)) / 2 + nx * 20, my = (sy(ay) + sy(by)) / 2 + ny * 20;
const anchor = nx > 0.3 ? "start" : nx < -0.3 ? "end" : "middle";
if (len < 40) return null;
return (
@@ -637,7 +680,7 @@ function Demo() {
})}
{Wp.map((w, i) => (
- {i === 0 ? "Start: drag to move the whole track" : `Waypoint ${i}: drag to move it alone${amber.has(i) ? " (turn clamped: the arc does not fit at this rate)" : ""}; select and press Delete to remove`}
+ {i === 0 ? "Start: drag to move the whole track" : `Waypoint ${i}: drag to move it, keeping the legs' speeds (their times change)${amber.has(i) ? "; turn clamped: the arc does not fit at this rate" : ""}. Ctrl-click, or select and press Delete, to remove it.`}
))}
@@ -745,7 +788,7 @@ function Demo() {
}
const big = Math.max(...pts.map((p) => Math.abs(p[1])).filter(Number.isFinite), 1e-9);
errChart = (w, h) => (
-
+
);
}
let brgChart = null;
@@ -764,6 +807,42 @@ function Demo() {
};
}
+ // spec 036 follow-up: both vessels' course and speed over the scenario, with true and detected turns
+ let kinChart = null;
+ {
+ const own = [], tgt = [];
+ for (let i = 0; i < b.n; i++) {
+ own.push([b.t[i], Math.atan2(b.ovx[i], b.ovy[i]), Math.hypot(b.ovx[i], b.ovy[i]) / KT]);
+ tgt.push([b.t[i], Math.atan2(b.tvx[i], b.tvy[i]), Math.hypot(b.tvx[i], b.tvy[i]) / KT]);
+ }
+ const est = sol && sol.t_s && sol.status !== "failed" ? sol.t_s.map((t, k) => [t + derived.t0, Math.atan2(sol.vx_mps[k], sol.vy_mps[k]), Math.hypot(sol.vx_mps[k], sol.vy_mps[k]) / KT]) : [];
+ // courses drawn around their circular mean, so a course across north does not jump 360°
+ let cs = 0, cc = 0;
+ for (const p of [...own, ...tgt]) { cs += Math.sin(p[1]); cc += Math.cos(p[1]); }
+ const mean = Math.atan2(cs, cc);
+ const unwrapC = (c) => (mean + Math.atan2(Math.sin(c - mean), Math.cos(c - mean))) / DEG;
+ const trueTgt = T.manoeuvres(b.paths.tgt).map((m) => [m.t0, m.t1, TGT]);
+ const trueOwn = T.manoeuvres(b.paths.own).map((m) => [m.t0, m.t1, OWN]);
+ const detTgt = (sol && sol.splitter_spans && splitterName !== "truth" ? sol.splitter_spans : []).map((f) => [f.start_s + derived.t0, Math.max(f.end_s, f.start_s + 20) + derived.t0, FOUND, "right"]);
+ const detOwn = (sol && sol.splitter_ownship_spans ? sol.splitter_ownship_spans : []).map((f) => [f.start_s + derived.t0, Math.max(f.end_s, f.start_s + 20) + derived.t0, "#17becf", "left"]);
+ const modelStrips = modelSpans.map((m) => [m[0], m[1], m[2], "right"]);
+ const marks = [[win.start_s, win.end_s, "#2ca02c"], ...trueOwn, ...trueTgt, ...detTgt, ...detOwn, ...modelStrips];
+ const detected = detTgt.length || detOwn.length || modelStrips.length;
+ const note = detected ? "; strips: detected" : "";
+ kinChart = {
+ course: (w, h) => [p[0], unwrapC(p[1])]), colour: OWN }, { points: tgt.map((p) => [p[0], unwrapC(p[1])]), colour: TGT }, { points: est.map((p) => [p[0], unwrapC(p[1])]), colour: EST, dash: "4 3" }]} marks={marks} />,
+ speed: (w, h) => [p[0], p[2]]), colour: OWN }, { points: tgt.map((p) => [p[0], p[2]]), colour: TGT }, { points: est.map((p) => [p[0], p[2]]), colour: EST, dash: "4 3" }]} marks={marks} yClip={[0, 40]} />,
+ };
+ }
+
+ // spec 036 follow-up: the preset the scenario matches (the drop-down shows it; "custom" once edited)
+ const presetShown = (() => {
+ const pick = (x) => JSON.stringify([x.ownship, x.target, x.sigma_deg, x.interval_s, x.seed, x.window]);
+ const k = pick(sc);
+ const hit = PRESETS.find((pr) => pick(pr.scenario) === k);
+ return hit ? hit.id : "custom";
+ })();
+
const selTrack = sel ? sc[sel.vessel] : null;
const editor = sel && selTrack ? (
@@ -808,8 +887,8 @@ function Demo() {
{notice &&
{notice}
}
@@ -885,14 +964,26 @@ function Demo() {
)}
{dragLabel && (
-
- {dragLabel.text}
+ {/* above and to the left of the cursor, which points up-left and trails down-right */}
+ {(() => {
+ const rows = [dragLabel.title, ...dragLabel.lines];
+ const w = Math.max(...rows.map((r) => r.length)) * 6.4 + 14, h = rows.length * 15 + 6;
+ // above-left of the cursor; flipped right or down where the plot's edge would clip it
+ const x0 = dragLabel.x - w - 12 >= 2 ? dragLabel.x - w - 12 : dragLabel.x + 18;
+ const y0 = dragLabel.y - h - 12 >= 2 ? dragLabel.y - h - 12 : dragLabel.y + 18;
+ return (
+
+
+ {rows.map((r, k) => {r})}
+
+ );
+ })()}
)}
{niceNm} NM
- click a leg to add a waypoint · drag a circle to move it · drag a square for course and speed · wheel to zoom
+ click a leg to add a waypoint · drag a circle: speed kept, time changes · drag a square: time kept, speed changes · ctrl-click a circle to deletenorth up; blue ownship, red target (thick: inside the window); green dashed: the solution; olive: bearings
@@ -923,24 +1014,39 @@ function Demo() {
@@ -1073,9 +1179,9 @@ function Demo() {
How to use it, and what is running
-
Drag a waypoint (circle) to move it alone: the legs either side change course and speed, everything else stays put. Drag the start (filled circle) to move a whole track.
-
Drag a leg's square handle to change its course and speed: every later leg swings round with it, so the rest of the track can move a long way.
-
Click a leg to insert a waypoint; select a waypoint and press Delete (or right-click it) to remove it. Undo with Ctrl+Z. Amber waypoints: the turn does not fit at its rate and is drawn tighter.
+
Drag a waypoint (circle) to move it alone: the legs either side keep their speeds, so their lengths and durations change (later waypoints stay put but are reached later or sooner). Drag the start (filled circle) to move a whole track. Ctrl-click (⌘-click) a waypoint to delete it.
+
Drag a leg's square handle to change its course and speed: the leg keeps its duration, so its length follows the speed, and every later leg swings round with it, so the rest of the track can move a long way.
+
Click a leg to insert a waypoint; select a waypoint and press Delete (or right-click or ctrl-click it) to remove it. Undo with Ctrl+Z. Amber waypoints: the turn does not fit at its rate and is drawn tighter.
Wheel to zoom, drag empty space to pan. The link in the address bar restores this exact scenario, noise draw and solver.
Leg splitters (spec 036): none; told the truth (an oracle); Debrief's 2015 arctan slicing (one split per steady ownship leg, ZigRatio); a multi-leg arctan slicing with independent slices; the arctan law with joined legs, searched over the whole window; and C, the project's classical segmenter (spec 005, spec 021's port). Their spans go to the segmented physics layer; "Run all splitters" compares them on this window.
Solvers: JavaScript batch least squares (spec 021's port of the Python reference); the physics layer of Gates 1–2 as an ONNX graph (tl-layer.onnx{tlInfo ? <> , SHA-256 {tlInfo.onnx_sha256.slice(0, 16)}…> : null}), with one leg or told the true manoeuvre times; and spec 016's whole-period learned model (three training seeds, 26 MB each, loaded on first use), which reads the whole window at once and also states where it thinks the target manoeuvred. For the time-late studies' standing system see Time-late.
diff --git a/site/src/pages/demo.module.css b/site/src/pages/demo.module.css
index 72dfdc81..45791fb4 100644
--- a/site/src/pages/demo.module.css
+++ b/site/src/pages/demo.module.css
@@ -264,3 +264,23 @@
border-radius: 4px;
}
.solverBox select { max-width: 18rem; }
+
+/* spec 036 follow-up: the error chart's quantity as a drop-down over the chart's title row, so its time
+ axis lines up with the other charts; course and speed side by side in one panel */
+.overlayHost { position: relative; }
+.chartSelect {
+ position: absolute;
+ top: 0.15rem;
+ left: 0.3rem;
+ z-index: 1;
+ font-size: 0.7rem;
+ padding: 0 0.1rem;
+ max-width: 6.5rem;
+}
+.subCharts {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ gap: 0.25rem;
+}
+.subCharts > * { flex: 1 1 0; min-width: 0; }
diff --git a/site/static/demo-data/demo-scenario.schema.json b/site/static/demo-data/demo-scenario.schema.json
index 76307b24..7f3b7283 100644
--- a/site/static/demo-data/demo-scenario.schema.json
+++ b/site/static/demo-data/demo-scenario.schema.json
@@ -162,5 +162,5 @@
],
"title": "DemoScenario",
"type": "object",
- "version": "0.38.0"
+ "version": "0.39.0"
}
diff --git a/site/static/demo-data/js/arctan.js b/site/static/demo-data/js/arctan.js
index d11c8879..504d02b7 100644
--- a/site/static/demo-data/js/arctan.js
+++ b/site/static/demo-data/js/arctan.js
@@ -182,7 +182,8 @@ export const DEBRIEF = { zigRatio: 0.6, bufferRows: 12, minSliceRows: 18, stepRo
export async function debriefSlicing(s, P = DEBRIEF, cancelled = () => false) {
const found = [];
- const legs = ownshipLegs(s).filter(([a, b]) => b - a + 1 >= P.minLegRows);
+ const allLegs = ownshipLegs(s);
+ const legs = allLegs.filter(([a, b]) => b - a + 1 >= P.minLegRows);
const breathe = () => new Promise((r) => setTimeout(r, 0));
let fits = 0;
for (const [a, b] of legs) {
@@ -206,7 +207,7 @@ export async function debriefSlicing(s, P = DEBRIEF, cancelled = () => false) {
}
if (best && best.score < wholeScore * P.zigRatio) found.push({ lo: best.lo, hi: best.hi, stat: wholeScore / best.score });
}
- return { spans: found, fits, legs };
+ return { spans: found, fits, legs: allLegs };
}
// ---------- multi-leg: recursive, ownship subtracted, threshold tied to the noise ----------
diff --git a/site/static/demo-data/js/scenario.js b/site/static/demo-data/js/scenario.js
index 187390a5..32fe4460 100644
--- a/site/static/demo-data/js/scenario.js
+++ b/site/static/demo-data/js/scenario.js
@@ -4,7 +4,7 @@
// same bearings whatever the window.
import { buildPath, stateAt, manoeuvres, DEG } from "./track.js";
-export const SCHEMA_VERSION = "0.38.0";
+export const SCHEMA_VERSION = "0.39.0";
const TWO_PI = 2 * Math.PI;
export const wrap2pi = (a) => {
const w = a % TWO_PI;
diff --git a/site/static/demo-data/js/solver-info.js b/site/static/demo-data/js/solver-info.js
index e99b9ee3..336df80f 100644
--- a/site/static/demo-data/js/solver-info.js
+++ b/site/static/demo-data/js/solver-info.js
@@ -16,11 +16,11 @@ export const LEGACY_SOLVERS = { "layer-cv": ["layer", "none"], "layer-oracle": [
// Spec 036: the leg splitters (DemoSplitterInfo, schema 0.38.0)
export const SPLITTER_INFO = {
- none: { name: "none", label: "None (one leg)", version: "none", assumptions: "No manoeuvre: one constant-velocity leg over the window.", told_truth: false },
- truth: { name: "truth", label: "Told the true manoeuvres (oracle)", version: "truth", assumptions: "The page tells it the target's true manoeuvre spans and their kinds (a course-only change gets the layer's speed-continuity prior; a speed change does not): a ceiling for any splitter, not a system. Every other splitter's spans are treated as course changes, C's convention.", told_truth: true },
- arctanDebrief: { name: "arctan-debrief", label: "Arctan slicing, Debrief 2015", version: "arctan-debrief-1", assumptions: "Debrief's zig detector: on each steady ownship leg, fit the three-parameter arctan law tan b = (A + Bt)/(C + Dt); try every split with a fixed 2-minute buffer dropped around it; accept the best if the slices' score per bearing is under the whole leg's times ZigRatio (0.6). One split per ownship leg; nothing found across ownship turns; the ratio is not tied to the bearing noise. Ownship legs are read from course changes over 0.5° per 10 s, so a turn slower than 0.05°/s is not seen as a turn.", told_truth: false },
- arctanMulti: { name: "arctan-multi", label: "Arctan slicing, multi-leg (noise-tied)", version: "arctan-multi-1", assumptions: "The arctan law with ownship's known motion subtracted (a constant-velocity target, valid through ownship's turns), split recursively anywhere in the window with a 2-minute buffer; a split is kept when it lowers the cost by more than 40 bearing variances (σ²). Splits are found one at a time, not searched jointly.", told_truth: false },
- arctanJoined: { name: "arctan-joined", label: "Arctan law, joined legs (whole-window search)", version: "arctan-joined-1", assumptions: "The arctan law with ownship subtracted, but the legs are joined: position is continuous and only the velocity changes at a knot. Knots are added one at a time, each placed where it lowers the whole window's cost most (all parameters refitted), kept while the drop exceeds 25 bearing variances (σ²); then each knot is taken out and put back at its best place among the others. At most four knots; a knot is an instant.", told_truth: false },
- c: { name: "c", label: "C: GLR + search, confirmed by the physics layer (spec 005)", version: "c-4d2c084f", assumptions: "The project's classical segmenter (spec 005; Gate 2's C, frozen; spec 021's JavaScript port): a sliding GLR test and a leg search nominate changes, and the physics layer confirms each on the bearings up to it (cost drop over τ = 13.8). Causal: its segmentation at the window's last bearing. Parameters in rows of 10 s; at most 720 rows. Slow: about three to four minutes on a two-hour window (its leg search alone takes about 40 s).", told_truth: false },
+ none: { name: "none", label: "None (one leg)", version: "none", assumptions: "No manoeuvre: one constant-velocity leg over the window.", told_truth: false, detects_target: false, detects_ownship: false },
+ truth: { name: "truth", label: "Told the true manoeuvres (oracle)", version: "truth", assumptions: "The page tells it the target's true manoeuvre spans and their kinds (a course-only change gets the layer's speed-continuity prior; a speed change does not): a ceiling for any splitter, not a system. Every other splitter's spans are treated as course changes, C's convention.", told_truth: true, detects_target: true, detects_ownship: false },
+ arctanDebrief: { name: "arctan-debrief", label: "Arctan slicing, Debrief 2015", version: "arctan-debrief-1", assumptions: "Debrief's zig detector: on each steady ownship leg, fit the three-parameter arctan law tan b = (A + Bt)/(C + Dt); try every split with a fixed 2-minute buffer dropped around it; accept the best if the slices' score per bearing is under the whole leg's times ZigRatio (0.6). One split per ownship leg; nothing found across ownship turns; the ratio is not tied to the bearing noise. Ownship legs are read from course changes over 0.5° per 10 s, so a turn slower than 0.05°/s is not seen as a turn.", told_truth: false, detects_target: true, detects_ownship: true },
+ arctanMulti: { name: "arctan-multi", label: "Arctan slicing, multi-leg (noise-tied)", version: "arctan-multi-1", assumptions: "The arctan law with ownship's known motion subtracted (a constant-velocity target, valid through ownship's turns), split recursively anywhere in the window with a 2-minute buffer; a split is kept when it lowers the cost by more than 40 bearing variances (σ²). Splits are found one at a time, not searched jointly.", told_truth: false, detects_target: true, detects_ownship: false },
+ arctanJoined: { name: "arctan-joined", label: "Arctan law, joined legs (whole-window search)", version: "arctan-joined-1", assumptions: "The arctan law with ownship subtracted, but the legs are joined: position is continuous and only the velocity changes at a knot. Knots are added one at a time, each placed where it lowers the whole window's cost most (all parameters refitted), kept while the drop exceeds 25 bearing variances (σ²); then each knot is taken out and put back at its best place among the others. At most four knots; a knot is an instant.", told_truth: false, detects_target: true, detects_ownship: false },
+ c: { name: "c", label: "C: GLR + search, confirmed by the physics layer (spec 005)", version: "c-4d2c084f", assumptions: "The project's classical segmenter (spec 005; Gate 2's C, frozen; spec 021's JavaScript port): a sliding GLR test and a leg search nominate changes, and the physics layer confirms each on the bearings up to it (cost drop over τ = 13.8). Causal: its segmentation at the window's last bearing. Parameters in rows of 10 s; at most 720 rows. Slow: about three to four minutes on a two-hour window (its leg search alone takes about 40 s).", told_truth: false, detects_target: true, detects_ownship: false },
};
export const SPLITTER_LIST = [SPLITTER_INFO.none, SPLITTER_INFO.truth, SPLITTER_INFO.arctanDebrief, SPLITTER_INFO.arctanMulti, SPLITTER_INFO.arctanJoined, SPLITTER_INFO.c];
diff --git a/site/static/demo-data/js/splitters.js b/site/static/demo-data/js/splitters.js
index 6f019b30..102eceec 100644
--- a/site/static/demo-data/js/splitters.js
+++ b/site/static/demo-data/js/splitters.js
@@ -70,10 +70,13 @@ export const arctanDebrief = {
const s = splitterArrays(p);
const r = await debriefSlicing(s, DEBRIEF, ctx.cancelled || (() => false));
const notes = [];
- if (!r.legs.length) notes.push("no steady ownship leg long enough to slice");
+ if (!r.legs.some(([a, b]) => b - a + 1 >= DEBRIEF.minLegRows)) notes.push("no steady ownship leg long enough to slice");
const d = dtNote(s);
if (d) notes.push(d);
- return { spans: spansOf(s, r.spans), rows_dt_s: s.dt, fits: r.fits, runtime_ms: now() - t0, message: notes.join("; ") || undefined };
+ // spec 036 follow-up: ownship turns as Debrief found them: the gaps between its steady ownship legs
+ const own = [];
+ for (let i = 0; i + 1 < r.legs.length; i++) own.push({ lo: r.legs[i][1], hi: r.legs[i + 1][0] });
+ return { spans: spansOf(s, r.spans), ownship_spans: spansOf(s, own), rows_dt_s: s.dt, fits: r.fits, runtime_ms: now() - t0, message: notes.join("; ") || undefined };
},
};
diff --git a/site/static/demo-data/js/track.js b/site/static/demo-data/js/track.js
index b3d38ac2..f2abaab8 100644
--- a/site/static/demo-data/js/track.js
+++ b/site/static/demo-data/js/track.js
@@ -165,7 +165,10 @@ const legFrom = (a, b, duration_s) => {
// FR-002: move waypoint j (1..L) to (x, y) NM; adjacent legs keep their durations, downstream
// waypoints stay put. Waypoint 0 (the start) moves the whole track.
-export function moveWaypoint(track, j, x, y) {
+// keep: "time" keeps each adjacent leg's duration (its speed changes); "speed" (spec 036 follow-up, the page's
+// waypoint drag) keeps each adjacent leg's speed, so its duration follows its new length (a leg at
+// rest keeps its duration).
+export function moveWaypoint(track, j, x, y, keep = "time") {
const out = copy(track);
if (j === 0) {
out.start_x_nm = x;
@@ -176,7 +179,12 @@ export function moveWaypoint(track, j, x, y) {
W[j] = [x, y];
for (const i of [j - 1, j]) {
if (i < 0 || i >= out.legs.length) continue;
- Object.assign(out.legs[i], legFrom(W[i], W[i + 1], out.legs[i].duration_s));
+ let dur = out.legs[i].duration_s;
+ if (keep === "speed" && out.legs[i].speed_kt > 0) {
+ const lenNm = Math.hypot(W[i + 1][0] - W[i][0], W[i + 1][1] - W[i][1]);
+ dur = Math.min(43200, Math.max(1, (lenNm / out.legs[i].speed_kt) * 3600.0));
+ }
+ Object.assign(out.legs[i], legFrom(W[i], W[i + 1], dur), { duration_s: dur });
}
return out;
}
diff --git a/site/static/demo-data/worker.js b/site/static/demo-data/worker.js
index 31002675..df805101 100644
--- a/site/static/demo-data/worker.js
+++ b/site/static/demo-data/worker.js
@@ -73,7 +73,7 @@ async function splitAndSolve(solverName, splitterName, problem, ctx) {
const given = splitter.info.told_truth ? problem : { ...problem, knots: [] };
const split = await splitter.split(given, ctx);
const solution = await solver.solve({ ...problem, knots: split.spans }, ctx);
- return { ...solution, splitter: splitter.info.name, splitter_spans: split.spans, splitter_runtime_ms: split.runtime_ms, splitter_message: split.message };
+ return { ...solution, splitter: splitter.info.name, splitter_spans: split.spans, splitter_ownship_spans: split.ownship_spans, splitter_runtime_ms: split.runtime_ms, splitter_message: split.message };
}
self.onmessage = async (ev) => {
diff --git a/src/tma2/types/generated/tma.py b/src/tma2/types/generated/tma.py
index ca7c1305..e470a8cc 100644
--- a/src/tma2/types/generated/tma.py
+++ b/src/tma2/types/generated/tma.py
@@ -31,7 +31,7 @@
metamodel_version = "1.12.0"
-version = "0.38.0"
+version = "0.39.0"
class ConfiguredBaseModel(BaseModel):
@@ -4069,6 +4069,7 @@ class TmaSolution(ConfiguredBaseModel):
manoeuvre_prob: Optional[list[float]] = Field(default=None, description="""The solver's probability that a target manoeuvre is in progress at each of manoeuvre_t_s.""", json_schema_extra = { "linkml_meta": {'domain_of': ['TmaSolution']} })
splitter: Optional[str] = Field(default=None, description="""Spec 036: the leg splitter whose spans the solver used.""", json_schema_extra = { "linkml_meta": {'domain_of': ['DemoScenario', 'TmaSolution']} })
splitter_spans: Optional[list[DemoSpan]] = Field(default=None, description="""Spec 036: the manoeuvre spans the leg splitter stated, in the problem's time.""", json_schema_extra = { "linkml_meta": {'domain_of': ['TmaSolution']} })
+ splitter_ownship_spans: Optional[list[DemoSpan]] = Field(default=None, description="""Spec 036 follow-up: ownship turns the leg splitter detected, in the problem's time (only a splitter that detects them, as Debrief's slicing).""", json_schema_extra = { "linkml_meta": {'domain_of': ['TmaSolution']} })
splitter_runtime_ms: Optional[float] = Field(default=None, json_schema_extra = { "linkml_meta": {'domain_of': ['TmaSolution']} })
splitter_message: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'domain_of': ['TmaSolution']} })
@@ -4089,6 +4090,8 @@ class DemoSplitterInfo(ConfiguredBaseModel):
label: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'domain_of': ['DemoSplitterInfo']} })
assumptions: str = Field(default=..., description="""Its method, in words.""", json_schema_extra = { "linkml_meta": {'domain_of': ['DemoSplitterInfo', 'DemoSolverInfo']} })
told_truth: bool = Field(default=..., description="""It is told the true manoeuvre spans (an oracle).""", json_schema_extra = { "linkml_meta": {'domain_of': ['DemoSplitterInfo']} })
+ detects_target: Optional[bool] = Field(default=None, description="""Spec 036 follow-up: it states target manoeuvres.""", json_schema_extra = { "linkml_meta": {'domain_of': ['DemoSplitterInfo']} })
+ detects_ownship: Optional[bool] = Field(default=None, description="""Spec 036 follow-up: it states ownship turns it detected.""", json_schema_extra = { "linkml_meta": {'domain_of': ['DemoSplitterInfo']} })
class DemoSolverInfo(ConfiguredBaseModel):
diff --git a/src/tma2/types/generated/tma.schema.json b/src/tma2/types/generated/tma.schema.json
index 49635296..78b4f1ba 100644
--- a/src/tma2/types/generated/tma.schema.json
+++ b/src/tma2/types/generated/tma.schema.json
@@ -978,6 +978,20 @@
"description": "Its method, in words.",
"type": "string"
},
+ "detects_ownship": {
+ "description": "Spec 036 follow-up: it states ownship turns it detected.",
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "detects_target": {
+ "description": "Spec 036 follow-up: it states target manoeuvres.",
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
"label": {
"type": [
"string",
@@ -5917,6 +5931,16 @@
"null"
]
},
+ "splitter_ownship_spans": {
+ "description": "Spec 036 follow-up: ownship turns the leg splitter detected, in the problem's time (only a splitter that detects them, as Debrief's slicing).",
+ "items": {
+ "$ref": "#/$defs/DemoSpan"
+ },
+ "type": [
+ "array",
+ "null"
+ ]
+ },
"splitter_runtime_ms": {
"type": [
"number",
@@ -6336,6 +6360,6 @@
],
"title": "tma",
"type": "object",
- "version": "0.38.0"
+ "version": "0.39.0"
}
diff --git a/src/tma2/types/generated/version.py b/src/tma2/types/generated/version.py
index 94ecfa94..c6a41d35 100644
--- a/src/tma2/types/generated/version.py
+++ b/src/tma2/types/generated/version.py
@@ -1,2 +1,2 @@
# Generated from schema/tma.yaml by scripts/gen_types.py. Do not edit.
-SCHEMA_VERSION = "0.38.0"
+SCHEMA_VERSION = "0.39.0"
diff --git a/tests/unit/test_demo_schema.py b/tests/unit/test_demo_schema.py
index e4031911..82fabc64 100644
--- a/tests/unit/test_demo_schema.py
+++ b/tests/unit/test_demo_schema.py
@@ -30,7 +30,7 @@ def test_pydantic_accepts_a_scenario() -> None:
leg = {"course_deg": 10.0, "speed_kt": 8.0, "duration_s": 600.0, "turn_rate_dps": 1.0}
sc = DemoScenario.model_validate(
{
- "schema_version": "0.38.0",
+ "schema_version": "0.39.0",
"ownship": {"start_x_nm": 0.0, "start_y_nm": 0.0, "legs": [leg]},
"target": {"start_x_nm": 1.0, "start_y_nm": 9.0, "legs": [leg]},
"sigma_deg": 1.0,
diff --git a/tests/unit/test_types.py b/tests/unit/test_types.py
index 11649d3d..893dea46 100644
--- a/tests/unit/test_types.py
+++ b/tests/unit/test_types.py
@@ -13,7 +13,7 @@
def test_schema_version_reads_gitma_files() -> None:
from tma2.data.versions import compatible
- assert SCHEMA_VERSION == "0.38.0"
+ assert SCHEMA_VERSION == "0.39.0"
assert compatible("0.16.0", SCHEMA_VERSION)