Solution 0xb53215a4f9d90f6e4ba30912c249312fc5c93334a3c0196b1a5afc92e841a04f
All checks were successful
elffuss/validation Validation passed

T2T-Item: 0xb53215a4f9d90f6e4ba30912c249312fc5c93334a3c0196b1a5afc92e841a04f
T2T-Issue: 0x7bf84a053d2bd6ce83a7ce9d2799aadf280de622b31dbf03026d0e69d76d3a9a
This commit is contained in:
2026-10-02 08:59:35 +00:00
committed by elffuss-bot
parent 42a4a9a67c
commit 2d1f524dd3
3 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
{
"schema": "elffuss-t2t/criteria@2",
"issue": 7,
"criteria": [
{
"index": 1,
"tests": [
"tests/acceptance/7/criteria.test.js::criterion 1"
]
}
]
}

View File

@@ -0,0 +1,26 @@
import { test } from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import * as mod from '../../../web/js/lab.js' // the code under test: call it as mod.<name>(...)
const source = readFileSync(new URL('../../../web/js/lab.js', import.meta.url), 'utf8') // the text of web/js/lab.js, for a criterion about how the file is written
test('criterion 1', () => {
// The label of each `litert:<key>` entry of `BRAINS` equals the `label` of `MODELS[<key>]` from providers/litert.js, and the entries `rules` and `onnx` still come first with their current labels.
const brains = mod.getBrains();
const models = mod.getModels();
const brainsLabels = Object.entries(brains).map(([key, brain]) => brain.label);
const modelsLabels = Object.entries(models).map(([key, model]) => model.label);
for (const [key, brain] of Object.entries(brains)) {
assert.equal(brain.label, models[key].label, `Label mismatch for key: ${key}`);
}
const brainKeys = Object.keys(brains);
const modelKeys = Object.keys(models);
const rulesIndex = brainKeys.indexOf('rules');
const onnxIndex = brainKeys.indexOf('onnx');
assert.equal(rulesIndex, 0, 'rules should be the first entry in BRAINS');
assert.equal(onnxIndex, 1, 'onnx should be the second entry in BRAINS');
})

View File

@@ -68,8 +68,8 @@ const BENCHES = [
const BRAINS = [
['rules', 'Reglas (sin GPU)', 'Determinista. Valida el arnés sin bajar pesos.'],
['onnx', 'Elffuss LM (CPU/wasm)', 'LFM2.5-1.2B por transformers.js.'],
['litert:gemma-e2b', 'Gemma-4 E2B (~2 GB)', 'WebGPU.'],
['litert:gemma-e4b', 'Gemma-4 E4B (~3 GB)', 'WebGPU. El mejor.'],
['litert:gemma-e2b', 'Gemma-4 E2B', 'WebGPU.'],
['litert:gemma-e4b', 'Gemma-4 E4B', 'WebGPU. El mejor.'],
];
// ─────────────────────────── consola ───────────────────────────