From 3cd3457d2a7e580a94b6c15c3fefc4b99ebd1524 Mon Sep 17 00:00:00 2001 From: leehack Date: Fri, 13 Nov 2026 19:49:21 -0500 Subject: [PATCH] Run the chat-app Web smoke in Safari and Firefox and add a WebGPU generation E2E (#1025) --browser safari|firefox serves require-corp and drives the real-model smoke through safaridriver or geckodriver; --backend webgpu offloads all layers. The Dart web scenarios reject both browsers: package:test pages are never cross-origin isolated. web-webgpu-generation compares full-offload WebGPU text with CPU Wasm in direct and worker runtimes. --- doc/testing_matrix.md | 39 ++++- .../webgpu/webgpu_generation_e2e_test.dart | 154 ++++++++++++++++++ ...wright_chat_app_real_model_smoke_test.dart | 94 ++++++++++- test/unit/tooling/run_local_e2e_test.dart | 153 +++++++++++++++++ test/unit/tooling/test_matrix_test.dart | 53 ++++++ .../playwright_chat_app_real_model_smoke.py | 35 ++-- tool/testing/run_local_e2e.dart | 122 +++++++++++++- tool/testing/safari_webdriver.py | 55 ++++++- tool/testing/test_matrix.dart | 53 ++++++ 9 files changed, 728 insertions(+), 30 deletions(-) create mode 100644 test/e2e/webgpu/webgpu_generation_e2e_test.dart diff --git a/doc/testing_matrix.md b/doc/testing_matrix.md index 939cbe2cd..0b428c90a 100644 --- a/doc/testing_matrix.md +++ b/doc/testing_matrix.md @@ -161,7 +161,7 @@ Pick targeted rows based on the touched surface: | Tool-result media (`LlamaToolResultContent.content`, `LlamaToolOutput`) | `root-vm`, `tool-result-image-smoke`, validation `qwen3vl-gguf-cpu` / `-metal` (`M01`) | | LiteRT-LM embedding engine | `litert-lm-multimodal-embedding`; includes the documented local-only upstream WebGPU parity diagnostic | | LiteRT-LM native backend | `litert-lm-lifecycle`, `litert-lm-engine-smoke`, `litert-lm-chat-features-smoke`, `litert-lm-json-schema`, `litert-lm-asr-smoke`, `litert-lm-asr-preservation`, `litert-lm-media-preservation`, `litert-lm-utility-preservation` | -| Web bridge bootstrap or interop | `web-bridge-smoke`, `web-mock-chat-smoke`, `web-real-model-smoke`, `web-tool-penalty-smoke`, `web-lazy-grammar`, `web-tool-choice-grammar` | +| Web bridge bootstrap or interop | `web-bridge-smoke`, `web-mock-chat-smoke`, `web-real-model-smoke`, `web-real-model-smoke-safari`, `web-real-model-smoke-firefox`, `web-tool-penalty-smoke`, `web-lazy-grammar`, `web-webgpu-generation`, `web-tool-choice-grammar` | | WebGPU multimodal | `webgpu-multimodal-regression`, `web-speech-task-cancel`, plus `web-speech-to-text-smoke` for typed Qwen3-ASR and `web-text-to-speech-smoke` for typed Qwen3-TTS | | Large WebGPU GGUF / wasm64 selection | `gemma4-webgpu-mem64` | | LiteRT-LM web / Gemma 4 web bundle | `gemma4-litert-web` | @@ -232,7 +232,7 @@ The matrix is designed to cover these essential axes: | Axis | Covered by | | --- | --- | | llama.cpp native GGUF | `root-vm`, `native-prompt-reuse-parity`, `native-inference-benchmark`, `gguf-chat-features-smoke`, `gguf-audio-chat-smoke`, `decision-model-smoke` | -| llama.cpp WebGPU GGUF | `web-bridge-smoke`, `web-mock-chat-smoke`, `web-real-model-smoke`, `web-tool-penalty-smoke`, `web-lazy-grammar`, `web-tool-choice-grammar`, `webgpu-multimodal-regression`, `web-speech-to-text-smoke`, `web-text-to-speech-smoke`, `web-speech-task-cancel`, `gemma4-webgpu-mem64`, `decision-model-web-smoke` | +| llama.cpp WebGPU GGUF | `web-bridge-smoke`, `web-mock-chat-smoke`, `web-real-model-smoke`, `web-real-model-smoke-safari`, `web-real-model-smoke-firefox`, `web-tool-penalty-smoke`, `web-lazy-grammar`, `web-webgpu-generation`, `web-tool-choice-grammar`, `webgpu-multimodal-regression`, `web-speech-to-text-smoke`, `web-text-to-speech-smoke`, `web-speech-task-cancel`, `gemma4-webgpu-mem64`, `decision-model-web-smoke` | | LiteRT-LM native `.litertlm` | `litert-lm-engine-smoke`, `litert-lm-chat-features-smoke`, `native-hook-bundles` | | LiteRT-LM web `.litertlm` | `gemma4-litert-web` | | Model families | Qwen 2.5 prompt reuse, Qwen 3/3.5 chat/multimodal, Gemma 4 tool/thinking/mem64/LiteRT-LM/audio, Laya ModernBERT decision encoder and head | @@ -1464,6 +1464,41 @@ This qualifies the Web grammar plumbing on the selected weights, not hardware WebGPU or LFM2 auto accuracy/enforcement (#1715). The latter still needs its separate template contract and false-probe restriction. +## Safari and Firefox chat-app smoke + +`web-real-model-smoke-safari` and `web-real-model-smoke-firefox` run +`chat-app-web-real-model-smoke --browser safari|firefox` through +`tool/testing/safari_webdriver.py`. The runner serves the repo with +`--coep require-corp`, because both browsers expose `SharedArrayBuffer` only to +cross-origin isolated pages. `--backend webgpu` adds `--backend-index 0 +--gpu-layers 99`; the default stays CPU Wasm. Run each with `--dry-run` first. + +- Safari needs Settings > Developer > Allow Remote Automation and an unlocked + screen; a hidden page fails before the model loads. +- Firefox runs the binary in `FIREFOX_EXECUTABLE` through the geckodriver in + `GECKODRIVER` (default: `PATH`). geckodriver's script sandbox hides page + globals, so the helper installs its capture hooks as a page `