Compare each device report's planned threads with its sweep

Ouverte
#47 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
89/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript
Domaine
data, testing

Piste de recherche

Start with scripts/devices/table.mjs, scripts/devices/table.test.mjs, and scripts/devices/validate.mjs to follow the report-reading and test-writing patterns. Add scripts/devices/plans.test.mjs using scripts/devices/fixtures/good-report.json, then implement the pure report-to-rows logic and Markdown output in scripts/devices/plans.mjs. Run node --test scripts/devices/plans.test.mjs; done means the specified sweep cases pass, the script prints “No reports yet.” with no data, and docs/devices.md documents how to run it.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

agent-friendly device-lab

Why

Each Device lab report times the thread count Hermit planned for the phone and then 2 and 4 threads, but the device table shows only the planned count, so nobody can see where another count was faster. ROADMAP.md, Now: numbers from real phones, so the device-adaptive runtime learns from real hardware.

What to do

No phone needed. The counts come from sweepThreads() in packages/eval/src/device-lab.ts; a report keeps them in speed (the plan's count) and speed.sweep (the others).

  1. Test first: create scripts/devices/plans.test.mjs with made-up reports built from scripts/devices/fixtures/good-report.json. Change the numbers and keep the made-up phone names. Cover: the plan is fastest; a sweep count beats the plan; a sweep entry that wrote nothing (tokensPerSecond 0); a report with an empty sweep; no reports at all.
  2. Create scripts/devices/plans.mjs. It reads the reports in data/devices, or in --data DIR, through readEntries() from scripts/devices/table.mjs, which checks every file. It prints a Markdown table: phone, chip, tier (runtime.tier), the cores Android allowed (runtime.allowedCpus), the planned threads and their tokens per second, each sweep count with its tokens per second, the fastest count, and how much faster than the plan it was, in percent.
  3. Mark a row when another count beat the plan by more than 10 percent. Keep that number in one named constant: each count is the mean of only two calls, so small gaps are noise.
  4. Export the pure part (reports in, rows out), the way table.mjs exports renderTable(), so most tests need no files. For a test that does, write files with writeReport() from scripts/devices/validate.mjs, as table.test.mjs does.
  5. Add one line to docs/devices.md, after the sentence about table.mjs, saying how to run it.

Done when

  • node scripts/devices/plans.mjs prints "No reports yet." when there is no data, and the table otherwise.
  • node --test scripts/devices/plans.test.mjs passes, and pnpm test runs it: the root test script already includes scripts/devices/*.test.mjs.
  • The script only reads. It writes no file, and the device table between the markers in docs/devices.md doesn't change.

How to check

node --test scripts/devices/plans.test.mjs
node scripts/devices/plans.mjs --data DIR
pnpm test

Keep in mind

  • Node built-ins only. No dependency, no network.
  • Don't change the planner in packages/model here. If the table shows the plan losing on some chip, open an issue with those rows: a planner change is on the model path and needs its own numbers.
  • Made-up phones only in tests and fixtures.
Langage dominant
TypeScript
Étoiles
11
Forks
0
Merge moyen
10 min
PR mergées (30 j)
6

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de DojoCodingLabs/hermit

Toutes les issues de DojoCodingLabs/hermit

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.