Skip to content

Commit da96461

Browse files
committed
test(v7-f56b): Playwright visual e2e — dim_env mismatch badge
vbgui/e2e/scenarios/56_symbolic_dim_warn.spec.ts: - Asserts the live inline mismatch indicator (dim-env-inline-mismatch) fires *during typing* — before Apply hits verify — so the architect sees the issue without a roundtrip. - After Apply, asserts the post-verify canvas badge (symbolic-dim-warn-badge) renders with the offending H and nh*head_dim product in its message. - Restores compatibility (nh=2) and asserts the badge clears after the next verify roundtrip. This is the first F-block visual e2e. Asserts on visible elements (banner + inline indicator), not on text in the modal extras — meets the user requirement that visual loss/training params be observed "visually, not in the text output window". Ref: cppmega-mlx-j3qa.2
1 parent 999136f commit da96461

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// V7-F56b visual e2e: edit dim_env via the inline editor so
2+
// nh*head_dim != H, assert the live mismatch indicator surfaces
3+
// during typing AND the post-verify canvas badge surfaces.
4+
//
5+
// Honest closure note: today the warning shows up as a yellow banner
6+
// (severity=warning, not fail) — the verify call still returns ok
7+
// because the codebase intentionally supports decoupled Q dim via
8+
// internal W_Q : R^H → R^{nh*head_dim} projection. The badge alerts
9+
// the architect that they probably mis-typed dim_env.
10+
11+
import { test, expect } from "@playwright/test";
12+
import { gotoApp, selectPreset } from "../fixtures";
13+
14+
test("F56b: dim_env mismatch surfaces live + post-verify badge", async ({
15+
page,
16+
}) => {
17+
await gotoApp(page);
18+
await selectPreset(page, "llama3_8b");
19+
20+
// Editor is visible above the canvas after preset drop.
21+
const editor = page.getByTestId("dim-env-editor");
22+
await expect(editor).toBeVisible();
23+
24+
// Compatible default (H=128, nh=2, head_dim=64 — 2*64=128) → no
25+
// inline mismatch, no badge.
26+
await expect(page.getByTestId("dim-env-inline-mismatch"))
27+
.toHaveCount(0);
28+
await expect(page.getByTestId("symbolic-dim-warn-badge"))
29+
.toHaveCount(0);
30+
31+
// Mutate nh to 3 — 3*64=192 ≠ 128 (the F56 honest finding shape).
32+
// The inline indicator fires *during* typing, before Apply.
33+
await page.getByTestId("dim-env-nh").fill("3");
34+
const inline = page.getByTestId("dim-env-inline-mismatch");
35+
await expect(inline).toBeVisible();
36+
await expect(inline).toContainText("192");
37+
await expect(inline).toContainText("128");
38+
39+
// Apply → verify RPC roundtrip → gotcha lands → badge renders.
40+
await page.getByTestId("dim-env-apply").click();
41+
const badge = page.getByTestId("symbolic-dim-warn-badge");
42+
await expect(badge).toBeVisible({ timeout: 8_000 });
43+
const message = page.getByTestId("symbolic-dim-warn-message");
44+
await expect(message).toContainText("128");
45+
await expect(message).toContainText("192");
46+
47+
// Restore consistency → badge clears after the next verify.
48+
await page.getByTestId("dim-env-nh").fill("2");
49+
await page.getByTestId("dim-env-apply").click();
50+
await expect(page.getByTestId("symbolic-dim-warn-badge"))
51+
.toHaveCount(0, { timeout: 8_000 });
52+
});

0 commit comments

Comments
 (0)