Skip to content

Commit 5a12091

Browse files
committed
test(v4-5): all 11 ActivationName values through UI→train
Closes V4-5 / cppmega-mlx-doa. V3-5 only proved swiglu propagation; v4-5 parametrises across the full 11-entry ACTIVATION_OPTIONS set declared in BrickContextPanel.tsx: glu, gelu, relu, relu2, sqrelu, silu, mish, swiglu, geglu, reglu, xielu Each cell: click llama3_8b_mlp brick → BrickContextPanel → set activation → Apply → Train → assert extras.model_summary.mlp_activation matches selection AND losses finite AND weight_delta>0. 11/11 green in 14.4s. Backend support pre-verified via direct BLOCK_BUILDERS['mlp'] smoke for every activation.
1 parent f93fc58 commit 5a12091

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// V4-5: Every ActivationName must propagate UI → BrickContextPanel →
2+
// stage_train → extras.model_summary.mlp_activation. V3-5 proved only
3+
// swiglu; this proves all 11.
4+
5+
import { test, expect } from "@playwright/test";
6+
import { gotoApp, selectPreset, clickRunPipeline, closeModal } from "../fixtures";
7+
import { readTrainExtras } from "../utils/train_extras";
8+
9+
// Order matches ACTIVATION_OPTIONS in BrickContextPanel.tsx.
10+
const ACTIVATIONS = [
11+
"glu", "gelu", "relu", "relu2", "sqrelu", "silu", "mish",
12+
"swiglu", "geglu", "reglu", "xielu",
13+
];
14+
15+
for (const act of ACTIVATIONS) {
16+
test(`V4-5: UI activation '${act}' reaches extras.model_summary`,
17+
async ({ page }) => {
18+
test.setTimeout(60_000);
19+
await gotoApp(page);
20+
await selectPreset(page, "llama3_8b");
21+
22+
await page.locator("[data-testid='brick-node-llama3_8b_mlp']").click();
23+
const panel = page.getByTestId("brick-context-llama3_8b_mlp");
24+
await expect(panel).toBeVisible({ timeout: 4_000 });
25+
await page.locator(
26+
"[data-testid='brick-context-llama3_8b_mlp-activation']")
27+
.selectOption(act);
28+
await page.locator(
29+
"[data-testid='brick-context-llama3_8b_mlp-apply']").click();
30+
31+
await clickRunPipeline(page, "train");
32+
const extras = await readTrainExtras(page);
33+
34+
// Propagation assertion
35+
expect(extras.model_summary.mlp_activation).toBe(act);
36+
// Math sanity
37+
expect(extras.losses.every(l => Number.isFinite(l))).toBe(true);
38+
expect(extras.weight_delta_norm).toBeGreaterThan(0);
39+
40+
await closeModal(page);
41+
});
42+
}

0 commit comments

Comments
 (0)