Repository navigation
Description
Description of the bug
The text summary returned by lighthouse_audit prints a fractional category score with floating-point noise, for example Accessibility: 56.99999999999999 for the score 0.57 that Lighthouse writes to report.json and displays as 57. The value is off by about 1e-14, so the reader still gets the right magnitude, but the summary no longer matches the score Lighthouse reports. Observed in navigation and snapshot modes on 1.10.1 and on main at b2f522c. Lighthouse rounds category scores to two decimals, and 8 of the 101 possible values print with noise in Node because multiplying them by 100 in floating point is not exact: 0.07, 0.14, 0.28, 0.29, 0.55, 0.56, 0.57 and 0.58.
Actual behavior
On main in navigation mode, the relevant category lines were (the run also printed an Agentic Browsing line, which belongs to the separate null-score issue):
### Category Scores
- Accessibility: 56.99999999999999 (accessibility)
- Best Practices: 96 (best-practices)
- SEO: 82 (seo)
The report.json from the same call had "accessibility": 0.57, "best-practices": 0.96 and "seo": 0.82. 1.10.1 printed the same lines. Both versions printed Accessibility: 56.99999999999999 in snapshot mode too, against the same report.json value of 0.57.
Run counts: across 15 local MCP sessions on this page (both versions, navigation and snapshot in each), all 30 audits printed Accessibility: 56.99999999999999 while report.json held 0.57. 4 of those sessions used the fixture above exactly; the rest used equivalent pages with the same markup apart from the inline script, and different /llms.txt responses.
A control page whose Accessibility score was 0.33 printed 33 on both versions, because 0.33 * 100 happens to be exact. The noise depends on the score value, not on the page or the mode.
Reproduction
- Save this loopback fixture as
/tmp/x/server.mjsand runnode /tmp/x/server.mjs; it prints its port (PORTbelow). The default page gets an Accessibility score of0.57. The/llms.txtandcontrolbranches belong to the separate null-score issue and do not affect this one:
import http from 'node:http';
const control = process.argv[2] === 'control';
const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==', 'base64');
const server = http.createServer((req, res) => {
const {port} = server.address();
if (req.url === '/') {
res.writeHead(200, {'content-type': 'text/html'});
return res.end(control
? '<!doctype html><html><head><title>Control</title></head><body><h1>Control</h1><img src="pixel.png"><button></button><a href="#"></a><input type="text"></body></html>'
: `<!doctype html><title>Fixture</title><h1>Fixture</h1><img src="http://localhost:${port}/pixel.png"><script>fetch('/data.json')</script>`);
}
if (req.url === '/pixel.png') { res.writeHead(200, {'content-type': 'image/png'}); return res.end(png); }
if (req.url === '/data.json') { res.writeHead(200, {'content-type': 'application/json'}); return res.end('{"ok":true}'); }
if (req.url === '/llms.txt' && !control) { res.writeHead(304); return res.end(); }
res.writeHead(404); res.end();
});
server.listen(0, '127.0.0.1', () => console.log(server.address().port));- Start the MCP server over stdio with any MCP client:
npx -y chrome-devtools-mcp@1.10.1 --isolated --headless --no-usage-statistics --no-performance-crux. For main, runnpm ci && npm run buildin a checkout, thennode build/src/bin/chrome-devtools-mcp.jswith the same flags; that build still reports version1.10.1because the version bump happens at release. - Call
new_pagewith{"url": "http://127.0.0.1:PORT/"}. - Call
lighthouse_auditwith{"pageId": <the new page id>, "mode": "navigation", "device": "desktop"}, then again with"mode": "snapshot". - Compare the
Accessibilityline under### Category Scoreswithcategories.accessibility.scorein thereport.jsonfile listed in the same result.
Tested environment: macOS, Node v24.21.0, Google Chrome 154.0.8037.93, bundled Lighthouse 13.4.1 (the lighthouseVersion in report.json). The arithmetic alone is enough to show the effect: in Node, 0.57 * 100 evaluates to 56.99999999999999.
Expectation
The summary reports category scores on Lighthouse's 0-100 scale as Lighthouse presents them:
- Lighthouse's report renders a category score as
Math.round(score * 100)(report/renderer/category-renderer.js:385, lighthouse 13.5.0). - The tool description promises "Lighthouse score and reports" (
src/tools/lighthouse.ts:36, anddocs/tool-reference.md:425on main).
For this fixture, Accessibility should be shown as 57.
Chrome DevTools MCP version
1.10.1 (npm) and main b2f522c (local build)
Chrome version
154.0.8037.93 (stable, headless, isolated)
Node version
v24.21.0
Operating system
macOS
Evidence
- Expected source: Lighthouse's display rule
Math.round(numericScore * 100)atreport/renderer/category-renderer.js:385(lighthouse 13.5.0 npm package); the tool description atsrc/tools/lighthouse.ts:36(main and tagchrome-devtools-mcp-v1.10.1). - Failure source: local MCP runs on 1.10.1 and main, comparing the
lighthouse_audittext result with thereport.jsonwritten by the same call. The score line is built as(score.score ?? 0) * 100with no rounding atsrc/McpResponse.ts:1162-1164on main andsrc/McpResponse.ts:1116-1120at tagchrome-devtools-mcp-v1.10.1. - Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
Additional context
A separate issue, #2915, covers the same summary line printing a null category score as 0. That defect is reported separately because either one can be fixed while the other remains, and they rest on different contracts: Lighthouse's display rounding here, Lighthouse's null-score semantics there.
Total Timing is out of scope. Its printed value matched report.json exactly in every run, including noisy values such as 7940.650000000001 and 3973.0499999999997. Lighthouse itself stores timing.total as the sum of two rounded durations, and no project or Lighthouse source promises a rounded timing.
Fix check
Run the fixture above on the fixed build in both modes.
- Failing today:
Accessibility: 56.99999999999999whilereport.jsonholds0.57. - Restored: the Accessibility line shows
57, Lighthouse's rounded value, with no floating-point artifact.
Controls:
- Scores that already print exactly keep their values:
0.96as96,0.82as82,1as100, and the control page's0.33as33. - With
--experimentalStructuredContent, the structuredscoresstill carry the raw0.57.
Activity
yulunz commentedon Oct 5, 2026
Confirmed. We'll apply
Math.round(score * 100)to match the Lighthouse report.fix: round lighthouse category scores and show unscored categories as…
chore(main): release chrome-devtools-mcp 1.11.0 (#2823)