Skip to content

Commit ed6a485

Browse files
committed
feat(v4-10): side_channel toggles in train dropdown → extras.side_channels_observed
Closes V4-10 / cppmega-mlx-zfh. Previously deferred for needing net-new SideChannelsTab; this lands the minimum viable version via train-dropdown checkboxes — same surface as train-num-steps. TopBar: - new state scDocIds / scTokenIds; checkboxes train-side-channel-doc_ids + train-side-channel-token_ids inside the run-pipeline dropdown next to train-num-steps - onRunPipeline opts gain side_channels: string[] list of toggled names App.tsx: - handleRunPipeline forwards as stage_options.train.side_channels = {name: synthetic_int_list(8 ints)} per toggled name Backend (stages.py): - stage_train reads opts.side_channels dict; for any non-empty list value records the key in extras.side_channels_observed[] - actual per-channel forward routing is v5+ work — this is the observation probe E2E 24_side_channels.spec.ts: - doc_ids only → ["doc_ids"] - both toggles → 2 entries - none → empty array 3/3 green; 29 stage_train pytest + 11 TopBar vitest still pass.
1 parent 79286a3 commit ed6a485

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// V4-10: side_channels toggle in train dropdown reaches stage_train
2+
// → extras.side_channels_observed lists the toggled names.
3+
4+
import { test, expect } from "@playwright/test";
5+
import { gotoApp, selectPreset, closeModal } from "../fixtures";
6+
7+
test("V4-10: doc_ids toggle reaches stage_train side_channels_observed",
8+
async ({ page }) => {
9+
test.setTimeout(60_000);
10+
await gotoApp(page);
11+
await selectPreset(page, "llama3_8b");
12+
13+
await page.getByTestId("run-pipeline-toggle").click();
14+
await page.getByTestId("train-side-channel-doc_ids").check();
15+
await page.getByTestId("run-pipeline-train").click();
16+
17+
const modal = page.getByTestId("run-result-modal");
18+
await modal.waitFor({ timeout: 60_000 });
19+
await page.getByTestId("run-result-expand-train").click();
20+
21+
// Array rendered with one entry
22+
const sc0 = await page.getByTestId(
23+
"run-result-extras-train-side_channels_observed-0").textContent();
24+
expect(sc0?.trim()).toBe("doc_ids");
25+
26+
await closeModal(page);
27+
});
28+
29+
test("V4-10: both toggles enabled → both observed", async ({ page }) => {
30+
test.setTimeout(60_000);
31+
await gotoApp(page);
32+
await selectPreset(page, "llama3_8b");
33+
34+
await page.getByTestId("run-pipeline-toggle").click();
35+
await page.getByTestId("train-side-channel-doc_ids").check();
36+
await page.getByTestId("train-side-channel-token_ids").check();
37+
await page.getByTestId("run-pipeline-train").click();
38+
39+
const modal = page.getByTestId("run-result-modal");
40+
await modal.waitFor({ timeout: 60_000 });
41+
await page.getByTestId("run-result-expand-train").click();
42+
43+
const items = page.locator(
44+
"[data-testid^='run-result-extras-train-side_channels_observed-']");
45+
const count = await items.count();
46+
expect(count).toBe(2);
47+
48+
await closeModal(page);
49+
});
50+
51+
test("V4-10: no toggle → empty observed list", async ({ page }) => {
52+
test.setTimeout(60_000);
53+
await gotoApp(page);
54+
await selectPreset(page, "llama3_8b");
55+
56+
await page.getByTestId("run-pipeline-toggle").click();
57+
await page.getByTestId("run-pipeline-train").click();
58+
59+
const modal = page.getByTestId("run-result-modal");
60+
await modal.waitFor({ timeout: 60_000 });
61+
await page.getByTestId("run-result-expand-train").click();
62+
63+
const items = page.locator(
64+
"[data-testid^='run-result-extras-train-side_channels_observed-']");
65+
const count = await items.count();
66+
expect(count).toBe(0);
67+
68+
await closeModal(page);
69+
});

0 commit comments

Comments
 (0)