Repository navigation
Add end-to-end latency benchmarking and optimize axe scanning #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
8802371
perf: cut MCP tool latency by ~73%, and add a benchmark that measures it
claude 9de0113
fix: address PR review on the latency work
claude b3935b8
fix: report frames a scan could not reach, and verify cached refs res…
claude 0e54e82
fix: report every unscanned frame, expose them in matrix output, clea…
claude be17d68
test: cover the partial-scan warning in scan_page and audit_site
claude f868246
fix: harden frame coverage reporting, restore matrix ordering, guard …
claude c296ec9
fix: bound every frame probe and verify the injection is this server's
claude 246c124
fix: settle failed requests, and do not warn about frames scoped out …
claude 57dbf46
fix: preserve session media emulation, zoom across reloads, and neste…
claude 581ddb9
fix: settle sub-frame navigations, pierce shadow roots, propagate fra…
claude 5e9f847
fix: bound frame lookup, suppress deltas across partial scans, flush …
claude 77161aa
fix: do not blame a variant for the baseline's missing coverage
claude 55e2190
fix: do not let queued frame injections consume their own timeout
claude 587dbef
fix: revalidate cached ref semantics
JustasMonkev 41f66d9
fix: validate refs with public aria snapshots
JustasMonkev 429b00f
fix: version nullable matrix deltas
JustasMonkev 9dd486d
fix: harden frame coverage and snapshot caching
JustasMonkev e70d16c
fix: align hidden frames and benchmark totals
JustasMonkev 5eaa61f
fix: isolate axe scan readiness
JustasMonkev 0d231b4
fix: reject stale snapshot captures
JustasMonkev 763b998
fix: preserve complete scan coverage
JustasMonkev 9db220d
fix: namespace axe readiness tokens
JustasMonkev d720e14
fix: invalidate refs across navigation
JustasMonkev 247f136
fix: mirror axe hidden semantics
JustasMonkev 750f6c2
fix: stabilize axe frame coverage
JustasMonkev 343d05d
fix: align axe frame scope semantics
JustasMonkev c73fef1
fix: validate benchmark report path
JustasMonkev 7443761
fix: cap unscanned frame URLs
JustasMonkev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| /** | ||
| * Deterministic pages served to the benchmarked MCP server. | ||
| * | ||
| * The markup is generated from a fixed seed so every run - and every revision | ||
| * compared against another - scans exactly the same DOM. | ||
| */ | ||
|
|
||
| const seededRandom = seed => () => { | ||
| seed = (seed * 1103515245 + 12345) & 0x7fffffff; | ||
| return seed / 0x7fffffff; | ||
| }; | ||
|
|
||
| function heavyPage() { | ||
| const random = seededRandom(42); | ||
| const rows = []; | ||
| for (let index = 0; index < 220; index++) { | ||
| const label = `Item ${index}`; | ||
| // A mix of named and unnamed controls so axe finds real violations and the | ||
| // aria snapshot has interactive refs to click. | ||
| const missingAlt = random() < 0.2; | ||
| // Every fifth button is genuinely unnamed - no label, and an aria-hidden | ||
| // glyph for its only content - so the scan really does report button-name. | ||
| const unnamed = index % 5 === 0; | ||
| rows.push([ | ||
| '<li class="row">', | ||
| `<a href="/page-${index % 12}.html">${label} link</a>`, | ||
| unnamed | ||
| ? `<button id="btn-${index}"><span aria-hidden="true">▶</span></button>` | ||
| : `<button id="btn-${index}" aria-label="Action ${index}">Go ${index}</button>`, | ||
| `<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" ${missingAlt ? '' : `alt="Thumb ${index}"`}>`, | ||
| `<span class="muted" style="color:#bbb;background:#fff">Low contrast text ${index}</span>`, | ||
| '</li>', | ||
| ].join('')); | ||
| } | ||
| return [ | ||
| '<!doctype html><html lang="en"><head><meta charset="utf-8">', | ||
| '<title>Benchmark heavy page</title>', | ||
| '<style>.row{display:flex;gap:4px;align-items:center}.muted{font-size:12px}', | ||
| 'button{min-width:12px;min-height:12px}img{width:16px;height:16px}</style>', | ||
| '</head><body>', | ||
| '<a href="#main" class="skip">Skip to main content</a>', | ||
| '<header><nav><a href="/page-1.html">Home</a><a href="/page-2.html">Docs</a></nav></header>', | ||
| '<main id="main"><h1>Benchmark heavy page</h1>', | ||
| '<form><label>Search <input aria-label="Search" name="q"></label>', | ||
| '<select aria-label="Sort"><option>Newest</option><option>Oldest</option></select>', | ||
| '<button type="button" id="submit" aria-label="Submit search">Submit</button></form>', | ||
| `<ul>${rows.join('')}</ul>`, | ||
| '</main></body></html>', | ||
| ].join(''); | ||
| } | ||
|
|
||
| function smallPage(index) { | ||
| return [ | ||
| '<!doctype html><html lang="en"><head><meta charset="utf-8">', | ||
| `<title>Benchmark page ${index}</title></head><body>`, | ||
| `<main><h1>Page ${index}</h1>`, | ||
| `<p>Body copy for page ${index}.</p>`, | ||
| `<a href="/page-${(index + 1) % 12}.html">Next page</a>`, | ||
| `<a href="/page-${(index + 2) % 12}.html">Skip ahead</a>`, | ||
| `<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">`, | ||
| '<button><span aria-hidden="true">▶</span></button>', | ||
| '</main></body></html>', | ||
| ].join(''); | ||
| } | ||
|
|
||
| export const pages = new Map([ | ||
| ['/', heavyPage()], | ||
| ['/heavy.html', heavyPage()], | ||
| ...Array.from({ length: 12 }, (_, index) => [`/page-${index}.html`, smallPage(index)]), | ||
| ]); | ||
|
|
||
| /** A string with many embedded data URLs, for the string-processing micro benchmark. */ | ||
| export function dataUrlHeavyText(repeat = 400) { | ||
| const payload = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'.repeat(4); | ||
| const lines = []; | ||
| for (let index = 0; index < repeat; index++) { | ||
| lines.push(`- img "Thumb ${index}" [ref=e${index}]:`); | ||
| lines.push(` - /url: data:image/gif;base64,${payload}`); | ||
| lines.push(`- text: plain aria node ${index} with no url at all`); | ||
| lines.push(`- link "Item ${index}" [ref=e${index}b]:`); | ||
| lines.push(` - /url: https://example.com/page-${index}`); | ||
| } | ||
| return lines.join('\n'); | ||
| } | ||
|
|
||
| /** A large aria snapshot with no data URLs at all - the common case. */ | ||
| export function plainSnapshotText(repeat = 2000) { | ||
| const lines = []; | ||
| for (let index = 0; index < repeat; index++) { | ||
| lines.push(`- listitem [ref=e${index}]:`); | ||
| lines.push(` - link "Item ${index} link" [ref=e${index}a]: /page-${index % 12}.html`); | ||
| lines.push(` - button "Action ${index}" [ref=e${index}b]`); | ||
| lines.push(` - text: Low contrast text ${index}`); | ||
| } | ||
| return lines.join('\n'); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.