ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
d18d48e90f |
routing: a flight's points along a wire are read from its d, not asked of the browser each frame (#3164)
getPointAtLength walks a path from its start on every call. The flights
pose three points a frame, and along the wires to keys hundreds of rows
down (two groups of 500 and 300 keys open) WebKit spent 810-860 ms of
every 5 s in it, over half of the page's time in frames (1.43-1.51 s).
pointAt now flattens a d once, into points no more than 2 px apart along
its curve's control points, with the length along it to each, and finds
a point by a binary search between two of them. Only what the stage
draws with is read so (an absolute M, then L, Q and C); any other d is
still asked of the browser, a point every ptStep, as before. The wire
ends (tips) are still asked of the browser, once a d.
Run:
- the sandbox app (bin3164, fake upstream, 501 + 301 keys, a request
every 0.3 s), WebKit, both groups open, 5 s, 2 runs each: points asked
4759-5845 -> 104-132, their time 854-860 ms -> 19-38 ms, time in frame
callbacks 1461-1507 ms -> 860-874 ms.
- accuracy, every wire and flight path on that page (815 paths, 162k
points): the flattened point is within 0.12 px of Chromium's
getPointAtLength and 0.76 px of WebKit's; WebKit's own getTotalLength
is 1.39 px off Chromium's on the longest, so most of that is WebKit's.
- frames in 10 s (4 runs, alternating): 462-541 before, 446-463 after,
within the noise of a machine at load ~6. The frames are bound by
WebKit's painting now, not the script; this saves CPU, not frames.
- routing-busy-frames now counts points asked of the browser per d
measured (<= 2): 6 of 6 pass here, 6 of 6 red on origin/main
("5737 points asked of the browser along the 1749 d's measured").
- every routing*.test.cjs and panel-routing*.test.cjs (112 files,
--test-concurrency=6, load ~8): 1418 tests, 1365 pass, 53 fail. The
reds are those of
|
||
|
|
81a58d2f35 |
gui tests: routing-busy-frames counts paths measured again for the same d, not lengths against frames (#3557)
The bar was path lengths < 8 × frames drawn. The lengths follow the
paths the flights and the moving rows make (~1,800 in the 3s), not the
frames, so a busy machine that drew 228 frames instead of ~300 went red
with the page doing just what it should.
What the test is about is that a path is measured once for each d it
has. The page's getTotalLength and getPointAtLength are now wrapped to
remember the d each path was last measured at: a length measured again
for the same d, or a point again at the same distance along the same d,
is counted. The bars: lengths again ≤ 1/20 of lengths, points again ≤ 2
for each d measured (a wire's two ends are asked for by its tips and
among its points). Neither depends on the frame count.
Run at this head (frames3557 worktree on origin/main
|
||
|
|
588f87a126 |
gui: the Routing page measures a path again only when it moves (yg6888 on X: "打开页面很卡")
yg6888 on X: the Routing page lags, with 29 accounts in a group, nested
sub-groups and three agents sending at once.
Cause: every frame posed every flight, and each pose measured the paths
it flies along and the wire ends it meets with getTotalLength and
getPointAtLength, again on every frame. Each render also re-set every
via's "d" and formatted every row's token counts with a new
Intl.NumberFormat (toLocaleString).
Fix:
- measure() keeps a path's length in a WeakMap and measures again only
when its "d" changes.
- tip() keeps its result.
- A via's "d" is set only when it changed.
- pointAt() reads points measured every 8 px along a path, cached per
"d", and interpolates between them. The chord is off by under a
pixel.
- ledNum uses one Intl.NumberFormat per language.
- metaFit runs only when rows were redrawn.
Numbers: CPU profile of the page for 40 s under a busy sandbox gateway,
machine load ~250:
main thread rAF calls per call getPointAtLength getTotalLength ledNum
before 28.0 s 4047 6.9 ms 5.58 s 5.04 s 1.13 s
after 15.9 s 3635 4.4 ms 1.50 s 0.50 s 0
The GUI test counts per frame: ~15 lengths and ~27 points before, ~4
lengths and 13-16 points after. Paths still move during the rows' FLIP
slide and the agent tick, and they are measured again then.
renderHist's own time (~1.8 s) and getBoundingClientRect (~1.2 s) are
not changed here.
Test: routing-busy-frames.test.cjs, in Chromium and WebKit, en/zh/de.
It pumps three agents' requests and asserts fewer than 8 lengths a
frame, fewer than 200 formats, and token titles grouped in the page's
language. Red on the old client.js and app.js. Example green:
"chromium en 382 frames, 1519 lengths, 4864 points, 0 formats".
Run record, the three commits on origin/main
|