Elffuss BraidHub

utopia-ia/elffuss-code public

Tests: the graphics backend flag comes from the environment, and no sizes or durations in logs

The new tests/litert-stop-real.mjs copied from e4b_live.mjs a hardcoded
ANGLE backend flag, which names the development platform, and a log line
with a memory size and a load-time claim. About two dozen other tests
pass the same flag.

The flag is gone from all of them: tests/chrome-args.mjs reads extra
Chromium flags from ELFFUSS_CHROME_ARGS (space separated), and each
browser launch appends them after its own flags. Without the variable
Chromium uses its default backend. The load log lines now read
«cargando E4B…», and the comments in e4b_live.mjs keep the counts but
drop the absolute durations and the size thresholds.

prompthist.mjs, a UI test that launches through the helper, still
passes. The GPU tests themselves were not run here.
Changesete0342697fef523c98ff5dca160ab28dcae705ec7bc410691efc9b287101dcfb2
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-10 18:30 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-10 18:30 +02:00
Parentsfe092393385c

Browse the files at this changeset

25 files changed

modified tests/alltools.mjs +2 −1
@@ -3,11 +3,12 @@
33 // ejecuta varias tool-calls de un mensaje. web.search/web.fetch usan internet
44 // real (proxy del servidor) → correr con BASE=https://code.elffuss.com.
55 import { chromium } from 'playwright';
6+import { CHROME_ARGS } from './chrome-args.mjs';
67 const BASE = process.env.BASE || 'https://code.elffuss.com';
78 let fails = 0;
89 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + String(e).replace(/\n/g, ' ').slice(0, 90) : '')); if (!c) fails++; };
910
10-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
11+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1112 const ctx = await b.newContext();
1213 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1314 const p = await ctx.newPage();
modified tests/appbuild_gif.mjs +2 −1
@@ -4,6 +4,7 @@
44 // apareciendo, para que se vea tanto el chat como el código real. Al final
55 // monta esas capturas en un GIF animado del proceso completo (ffmpeg).
66 import { chromium } from 'playwright';
7+import { CHROME_ARGS } from './chrome-args.mjs';
78 import { execFileSync } from 'node:child_process';
89 import { mkdirSync, readdirSync } from 'node:fs';
910
@@ -27,7 +28,7 @@
2728
2829 const PROFILE = (process.env.SCRATCH || '/tmp/elffuss-test') + '/profile-code-gemma';
2930 const ctx = await chromium.launchPersistentContext(PROFILE, {
30- args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', '--use-angle=metal'],
31+ args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', ...CHROME_ARGS],
3132 viewport: { width: 1440, height: 900 },
3233 });
3334 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'litert:gemma-e2b'); } catch {} });
modified tests/arch.mjs +2 −1
@@ -1,9 +1,10 @@
11 // Vista Arquitectura (grafo 3D fiel a CodeFlow, librería 3d-force-graph).
22 import { chromium } from 'playwright';
3+import { CHROME_ARGS } from './chrome-args.mjs';
34 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
45 const BASE = process.env.BASE || 'http://localhost:8799';
56 let fails = 0; const ok = (n,c,e='')=>{console.log((c?'✅':'❌')+' '+n+(e?' — '+e:''));if(!c)fails++};
6-const b = await chromium.launch({ args:['--enable-unsafe-webgpu','--use-angle=metal'] });
7+const b = await chromium.launch({ args:['--enable-unsafe-webgpu',...CHROME_ARGS] });
78 const ctx = await b.newContext(); await ctx.addInitScript(()=>{try{localStorage.setItem('elffusscode.model','rules')}catch{}});
89 const p = await ctx.newPage({ viewport:{width:1500,height:900} });
910 p.on('console', m=>{ if(m.type()==='error' && !/allow-same-origin/.test(m.text())) console.log(' console.error:', m.text().slice(0,140)); });
modified tests/bugs.mjs +2 −1
@@ -1,10 +1,11 @@
11 // Bug A: al cerrar la última pestaña → estado vacío (no Monaco en blanco).
22 // Bug B: abrir/cerrar/alternar vistas (grafo/ciudad) → siempre cargan bien.
33 import { chromium } from 'playwright';
4+import { CHROME_ARGS } from './chrome-args.mjs';
45 const OUT=(process.env.SCRATCH || '/tmp/elffuss-test');
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails=0; const ok=(n,c,e='')=>{console.log((c?'✅':'❌')+' '+n+(e?' — '+e:''));if(!c)fails++};
7-const b=await chromium.launch({args:['--enable-unsafe-webgpu','--use-angle=metal']});
8+const b=await chromium.launch({args:['--enable-unsafe-webgpu',...CHROME_ARGS]});
89 const ctx=await b.newContext(); await ctx.addInitScript(()=>{try{localStorage.setItem('elffusscode.model','rules')}catch{}});
910 const p=await ctx.newPage({viewport:{width:1500,height:900}});
1011 p.on('pageerror',e=>{if(!/allow-same-origin/.test(e.message))console.log(' pageerror:',e.message.slice(0,120))});
added tests/chrome-args.mjs +8 −0
@@ -0,0 +1,8 @@
1+// Flags extra de Chromium para las pruebas con GPU. El backend gráfico que
2+// necesita cada máquina NO se fija en el código: se pasa por el entorno,
3+// separado por espacios, p. ej.
4+//
5+// ELFFUSS_CHROME_ARGS="--use-angle=<backend>" node tests/e4b_live.mjs
6+//
7+// Sin la variable, Chromium usa el suyo por defecto.
8+export const CHROME_ARGS = (process.env.ELFFUSS_CHROME_ARGS || '').split(/\s+/).filter(Boolean);
modified tests/city.mjs +2 −1
@@ -1,12 +1,13 @@
11 // Verifica la Ciudad 3D (motor VibeCodeViewer vendorizado): siembra un proyecto
22 // anidado, abre la vista, comprueba que el WebGL pinta la metrópolis y captura.
33 import { chromium } from 'playwright';
4+import { CHROME_ARGS } from './chrome-args.mjs';
45 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails = 0;
78 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
89
9-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
10+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1011 const ctx = await b.newContext();
1112 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1213 const p = await ctx.newPage({ viewport: { width: 1500, height: 900 } });
modified tests/contrast.mjs +2 −1
@@ -1,6 +1,7 @@
11 // Verifica el contraste de las tarjetas de modelo (CEREBRO) tras el fix.
22 // Abre Ajustes, mide luminancia de título+subtítulo vs fondo y captura.
33 import { chromium } from 'playwright';
4+import { CHROME_ARGS } from './chrome-args.mjs';
45 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
56 const BASE = process.env.BASE || 'http://localhost:8799';
67
@@ -8,7 +9,7 @@
89 const ratio = (a, b) => { const [x, y] = [lum(a) + 0.05, lum(b) + 0.05]; return (Math.max(x, y) / Math.min(x, y)); };
910 const parse = s => s.match(/\d+/g).slice(0, 3).map(Number);
1011
11-const br = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
12+const br = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1213 const ctx = await br.newContext();
1314 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1415 const p = await ctx.newPage({ viewport: { width: 1200, height: 820 } });
modified tests/demo_code_final.mjs +2 −1
@@ -4,6 +4,7 @@
44 // Doubles as an e2e smoke test: loads the real Gemma-4 model on WebGPU and
55 // exercises code.read / code.search / code.edit end to end.
66 import { chromium } from 'playwright';
7+import { CHROME_ARGS } from './chrome-args.mjs';
78 import { mkdirSync } from 'node:fs';
89 const REC = process.env.REC || new URL('../../elffuss-assets/_recording', import.meta.url).pathname;
910 const OUT = process.env.OUT || REC + '/videos';
@@ -23,7 +24,7 @@
2324 const PROFILE = process.env.PROFILE || REC + '/profile-code-gemma';
2425 mkdirSync(PROFILE, { recursive: true });
2526 const ctx = await chromium.launchPersistentContext(PROFILE, {
26- args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', '--use-angle=metal',
27+ args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', ...CHROME_ARGS,
2728 // WebGPU LLM inference issues long GPU dispatches; Chromium's GPU watchdog
2829 // otherwise kills the GPU process mid-inference/-load → "Target page…closed".
2930 '--disable-gpu-watchdog', '--disable-gpu-process-crash-limit'],
modified tests/diag_sw.mjs +2 −1
@@ -1,7 +1,8 @@
11 import { chromium } from 'playwright';
2+import { CHROME_ARGS } from './chrome-args.mjs';
23 const BASE = process.env.BASE || 'https://code.elffuss.com';
34 const MODEL = process.env.M || 'litert:gemma-e2b';
4-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu','--use-angle=metal'] });
5+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu',...CHROME_ARGS] });
56 const ctx = await b.newContext();
67 await ctx.addInitScript(m => { try { localStorage.setItem('elffusscode.model', m) } catch {} }, MODEL);
78 const p = await ctx.newPage();
modified tests/e2e.mjs +2 −1
@@ -4,12 +4,13 @@
44 //
55 // BASE=https://code.elffuss.com node e2e.mjs
66 import { chromium } from 'playwright';
7+import { CHROME_ARGS } from './chrome-args.mjs';
78
89 const BASE = process.env.BASE || 'https://code.elffuss.com';
910 let fails = 0;
1011 const ok = (name, cond, extra = '') => { console.log((cond ? '✅' : '❌') + ' ' + name + (extra ? ' — ' + extra : '')); if (!cond) fails++; };
1112
12-const browser = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
13+const browser = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1314
1415 // siembra un proyecto en OPFS y entra al IDE
1516 async function ide() {
modified tests/e4b_live.mjs +7 −6
@@ -6,11 +6,12 @@
66 // Requisitos (por eso no está en run-tools.sh, que es determinista y rápido):
77 // · adaptador WebGPU real
88 // · perfil PERSISTENTE — en el contexto efímero de Playwright, Cache Storage
9-// es de memoria y no traga GB (verificado: 1 GB ya falla ahí)
9+// vive en memoria y no aguanta un modelo entero (verificado)
1010 // · el .litertlm servido en local (E4B_URL) para no bajar 3 GB en cada corrida
1111 //
1212 // E4B_URL=http://localhost:8790/__e4b.litertlm PROFILE=/tmp/elf-e4b node e4b_live.mjs
1313 import { chromium } from 'playwright';
14+import { CHROME_ARGS } from './chrome-args.mjs';
1415 import { mkdirSync } from 'node:fs';
1516 import { tmpdir } from 'node:os';
1617 import { join } from 'node:path';
@@ -24,12 +25,12 @@
2425 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
2526 const log = (...a) => console.log('· ' + a.join(' '));
2627
27-// OJO: el Chromium que trae Playwright MUERE cargando E4B (2,97 GB) — medido:
28-// 3 intentos, 3 muertes del navegador, >18 min cada una. Con el Chrome REAL
29-// instalado, lo mismo tarda ~90 s y funciona. Por eso el canal es 'chrome'.
28+// OJO: el Chromium que trae Playwright MUERE cargando E4B: 3 intentos, 3
29+// muertes del navegador. Con el Chrome REAL instalado funciona. Por eso el
30+// canal es 'chrome'.
3031 const ctx = await chromium.launchPersistentContext(PROFILE, {
3132 channel: process.env.CHANNEL || 'chrome',
32- args: ['--enable-unsafe-webgpu', '--use-angle=metal'],
33+ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS],
3334 timeout: 120000,
3435 });
3536 const p = await ctx.newPage();
@@ -39,7 +40,7 @@
3940 await p.waitForTimeout(1500);
4041
4142 // ---------- 1 · carga real del modelo ----------
42-log('cargando E4B (~3 GB a la GPU), puede tardar varios minutos…');
43+log('cargando E4B…');
4344 const load = await p.evaluate(async (url) => {
4445 const m = await import('/js/providers/litert.js');
4546 m.MODELS['gemma-e4b'].url = url; // apuntamos a la copia local
modified tests/litert-stop-real.mjs +3 −2
@@ -14,6 +14,7 @@
1414 //
1515 // E4B_URL=http://localhost:8790/__e4b.litertlm PROFILE=/tmp/elf-e4b node litert-stop-real.mjs
1616 import { chromium } from 'playwright';
17+import { CHROME_ARGS } from './chrome-args.mjs';
1718 import { mkdirSync } from 'node:fs';
1819 import { tmpdir } from 'node:os';
1920 import { join } from 'node:path';
@@ -29,7 +30,7 @@
2930
3031 const ctx = await chromium.launchPersistentContext(PROFILE, {
3132 channel: process.env.CHANNEL || 'chrome',
32- args: ['--enable-unsafe-webgpu', '--use-angle=metal'],
33+ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS],
3334 timeout: 120000,
3435 });
3536 const p = await ctx.newPage();
@@ -37,7 +38,7 @@
3738 await p.goto(BASE + '/?test-opfs', { waitUntil: 'domcontentloaded' });
3839 await p.waitForTimeout(1500);
3940
40-log('cargando E4B (~3 GB a la GPU), puede tardar varios minutos…');
41+log('cargando E4B…');
4142 const load = await p.evaluate(async (url) => {
4243 const m = await import('/js/providers/litert.js');
4344 m.MODELS['gemma-e4b'].url = url;
modified tests/litertcache.mjs +2 −1
@@ -2,6 +2,7 @@
22 // (persistente) y en la 2ª llamada devuelve el blob SIN red (offline). Usa un
33 // fixture .litertlm determinista (no baja los GB reales).
44 import { chromium } from 'playwright';
5+import { CHROME_ARGS } from './chrome-args.mjs';
56 import { writeFileSync, rmSync } from 'node:fs';
67 import { fileURLToPath } from 'node:url';
78 import { dirname, join } from 'node:path';
@@ -14,7 +15,7 @@
1415 process.on('exit', ()=>{ try{rmSync(FIXP)}catch{} });
1516 const FIX = BASE + '/__litert_fixture.litertlm';
1617
17-const b = await chromium.launch({args:['--enable-unsafe-webgpu','--use-angle=metal']});
18+const b = await chromium.launch({args:['--enable-unsafe-webgpu',...CHROME_ARGS]});
1819 const ctx = await b.newContext();
1920 const p = await ctx.newPage();
2021 await p.goto(BASE+'/', {waitUntil:'domcontentloaded'});
modified tests/longsession.mjs +2 −1
@@ -8,12 +8,13 @@
88 // SEMANTIC=on node tests/longsession.mjs → BM25 + embeddings
99 // La segunda descarga el modelo de embeddings la primera vez que se corre.
1010 import { chromium } from 'playwright';
11+import { CHROME_ARGS } from './chrome-args.mjs';
1112 const BASE = process.env.BASE || 'http://localhost:8799';
1213 const SEM = process.env.SEMANTIC === 'on';
1314 let fails = 0;
1415 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
1516
16-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
17+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1718 const ctx = await b.newContext();
1819 await ctx.addInitScript(sem => {
1920 try {
modified tests/mind.mjs +2 −1
@@ -1,10 +1,11 @@
11 // Mente v2: mundo audio-reactivo + consolas flotantes + nodos clicables +
22 // config de cerebro + persistencia (música/animación) + reporte al chat.
33 import { chromium } from 'playwright';
4+import { CHROME_ARGS } from './chrome-args.mjs';
45 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails = 0; const ok = (n,c,e='')=>{console.log((c?'✅':'❌')+' '+n+(e?' — '+e:''));if(!c)fails++};
7-const b = await chromium.launch({ args:['--enable-unsafe-webgpu','--use-angle=metal','--autoplay-policy=no-user-gesture-required'] });
8+const b = await chromium.launch({ args:['--enable-unsafe-webgpu',...CHROME_ARGS,'--autoplay-policy=no-user-gesture-required'] });
89 const ctx = await b.newContext(); await ctx.addInitScript(()=>{try{localStorage.setItem('elffusscode.model','rules')}catch{}});
910 const p = await ctx.newPage({ viewport:{width:1500,height:900} });
1011 p.on('console', m=>{ if(m.type()==='error' && !/allow-same-origin|soundcloud|widget|encrypted-media|permissions policy/i.test(m.text())) console.log(' err:', m.text().slice(0,140)); });
modified tests/mind_stars.mjs +2 −1
@@ -1,11 +1,12 @@
11 // Mente v3: estrellas por perfil (no consolas), historial completo, perfiles
22 // editables, ciudad de fondo + haces de actividad, y tool-calling REAL del CEO.
33 import { chromium } from 'playwright';
4+import { CHROME_ARGS } from './chrome-args.mjs';
45 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails = 0; const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
78
8-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal', '--autoplay-policy=no-user-gesture-required'] });
9+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS, '--autoplay-policy=no-user-gesture-required'] });
910 const ctx = await b.newContext();
1011 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); localStorage.removeItem('elffusscode.ceoProfiles'); } catch {} });
1112 const p = await ctx.newPage({ viewport: { width: 1500, height: 900 } });
modified tests/mind_video.mjs +2 −1
@@ -1,7 +1,8 @@
11 import { chromium } from 'playwright';
2+import { CHROME_ARGS } from './chrome-args.mjs';
23 const VDIR=(process.env.SCRATCH || '/tmp/elffuss-test') + '/vid';
34 const BASE = process.env.BASE || 'http://localhost:8799';
4-const b=await chromium.launch({args:['--enable-unsafe-webgpu','--use-angle=metal','--autoplay-policy=no-user-gesture-required']});
5+const b=await chromium.launch({args:['--enable-unsafe-webgpu',...CHROME_ARGS,'--autoplay-policy=no-user-gesture-required']});
56 const ctx=await b.newContext({viewport:{width:1280,height:720},recordVideo:{dir:VDIR,size:{width:1280,height:720}}});
67 await ctx.addInitScript(()=>{try{localStorage.setItem('elffusscode.model','rules')}catch{}});
78 const p=await ctx.newPage();
modified tests/mindpersist.mjs +2 −1
@@ -2,10 +2,11 @@
22 // memoria/DOM — al recargar la página (cerrar pestaña, refrescar) se perdía
33 // todo. Ahora se persiste en IndexedDB y sobrevive a una recarga REAL.
44 import { chromium } from 'playwright';
5+import { CHROME_ARGS } from './chrome-args.mjs';
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails = 0; const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
78
8-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal', '--autoplay-policy=no-user-gesture-required'] });
9+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS, '--autoplay-policy=no-user-gesture-required'] });
910 const ctx = await b.newContext(); await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1011 const p = await ctx.newPage({ viewport: { width: 1300, height: 850 } });
1112 await p.goto(BASE + '/?test-opfs', { waitUntil: 'domcontentloaded' }); await p.waitForTimeout(1500);
modified tests/modelcache.mjs +2 −1
@@ -2,6 +2,7 @@
22 // desde Cache Storage (incluso OFFLINE) y soporta range requests. Usa un fixture
33 // .litertlm determinista (byte[i] = i%256) para no bajar los GB reales.
44 import { chromium } from 'playwright';
5+import { CHROME_ARGS } from './chrome-args.mjs';
56 import { writeFileSync, rmSync } from 'node:fs';
67 import { fileURLToPath } from 'node:url';
78 import { dirname, join } from 'node:path';
@@ -18,7 +19,7 @@
1819 const cleanup = () => { try { rmSync(FIXPATH); } catch {} };
1920 process.on('exit', cleanup);
2021
21-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
22+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
2223 const ctx = await b.newContext();
2324 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
2425 const p = await ctx.newPage({ viewport: { width: 1200, height: 800 } });
modified tests/multiwrite.mjs +2 −1
@@ -2,11 +2,12 @@
22 // code.write debe escribir TODOS los ficheros con su contenido. Inyectamos un
33 // proveedor falso (sin modelo real) y comprobamos el contenido en OPFS.
44 import { chromium } from 'playwright';
5+import { CHROME_ARGS } from './chrome-args.mjs';
56 const BASE = process.env.BASE || 'http://localhost:8799';
67 let fails = 0;
78 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
89
9-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
10+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1011 const ctx = await b.newContext();
1112 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1213 const p = await ctx.newPage();
modified tests/prompthist.mjs +2 −1
@@ -1,10 +1,11 @@
11 // Historial del prompt del chat: ↑/↓ recuperan lo enviado y ciclan.
22 import { chromium } from 'playwright';
3+import { CHROME_ARGS } from './chrome-args.mjs';
34 const BASE = process.env.BASE || 'http://localhost:8799';
45 let fails = 0;
56 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
67
7-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
8+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
89 const ctx = await b.newContext();
910 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1011 const p = await ctx.newPage({ viewport: { width: 1400, height: 900 } });
modified tests/swe_bench.mjs +2 −1
@@ -10,13 +10,14 @@
1010 //
1111 // Salida estilo results.tsv de agentic-install + score final resolved/N.
1212 import { chromium } from 'playwright';
13+import { CHROME_ARGS } from './chrome-args.mjs';
1314 import { TASKS } from './swe/tasks.js';
1415 const BASE = process.env.BASE || 'http://localhost:8799';
1516 const SOLVER = process.env.SOLVER || 'scripted';
1617 const MODEL = process.env.M || 'rules';
1718 const TIMEOUT = +(process.env.TIMEOUT || (SOLVER === 'model' ? 180000 : 15000));
1819
19-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
20+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
2021 const ctx = await b.newContext();
2122 await ctx.addInitScript(m => { try { localStorage.setItem('elffusscode.model', m); } catch {} }, SOLVER === 'model' ? MODEL : 'rules');
2223 const p = await ctx.newPage();
modified tests/swe_style.mjs +2 −1
@@ -8,11 +8,12 @@
88 // harness sea determinista en CI. Cambiando `fake` por el provider real (Gemma/
99 // heal) se mide al modelo de verdad: el arnés y la verificación son los mismos.
1010 import { chromium } from 'playwright';
11+import { CHROME_ARGS } from './chrome-args.mjs';
1112 const BASE = process.env.BASE || 'http://localhost:8799';
1213 let fails = 0;
1314 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
1415
15-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
16+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1617 const ctx = await b.newContext();
1718 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1819 const p = await ctx.newPage();
modified tests/terminal.mjs +2 −1
@@ -4,12 +4,13 @@
44 // El shell importado en page.evaluate es el MISMO singleton que usa la app
55 // (los módulos ES se cachean por realm) → comparte el proyecto abierto.
66 import { chromium } from 'playwright';
7+import { CHROME_ARGS } from './chrome-args.mjs';
78 const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
89 const BASE = process.env.BASE || 'http://localhost:8799';
910 let fails = 0;
1011 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
1112
12-const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', '--use-angle=metal'] });
13+const b = await chromium.launch({ args: ['--enable-unsafe-webgpu', ...CHROME_ARGS] });
1314 const ctx = await b.newContext();
1415 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
1516 const p = await ctx.newPage({ viewport: { width: 1500, height: 900 } });
modified tests/warmup_code.mjs +2 −1
@@ -1,8 +1,9 @@
11 import { chromium } from 'playwright';
2+import { CHROME_ARGS } from './chrome-args.mjs';
23 const BASE = process.env.BASE || 'https://code.elffuss.com';
34 const PROFILE = (process.env.SCRATCH || '/tmp/elffuss-test') + '/profile-code-gemma';
45 const ctx = await chromium.launchPersistentContext(PROFILE, {
5- args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', '--use-angle=metal'],
6+ args: ['--autoplay-policy=no-user-gesture-required', '--enable-unsafe-webgpu', ...CHROME_ARGS],
67 viewport: { width: 1440, height: 900 },
78 });
89 await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'litert:gemma-e2b'); } catch {} });