Repository navigation
Conversation
added 5 commits
November 21, 2026 19:10
The sweep is a cross-product of independent cells, so its wall time was the sum of every cell. Partition the workload in src/lib/visualMatrix.ts (built from the same lists), run one share per core in its own process with its own server and port, and let the aggregate refuse to read green when a share measured nothing, dropped a cell, or never wrote its result. Per-cell failure messages keep the cell label, so a failure raised in share 2 reaches the job output.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Written-by: HugoXK
Author: Fledge Platform Dev-3
Fixes #1208
Large-PR: 6 files, 846 changed lines — the serial loop (155 lines removed) becomes a coordinator plus a share mode, the partition and its aggregate guard, and the red test that pins the three failure modes; no hunk can go without losing one of the card's four acceptance clauses.
What changed
The
visualgate's sweep is a cross-product of independent cells, and it wasone serial loop: its wall time was the sum of every cell (54 s and 66 s on two
attempts of the same commit) inside a 79–88 s job. The cells are now cut into
contiguous shares and run one share per core, inside the same
visualcheck.src/lib/visualMatrix.tsgains the workload model:visualWorkload()buildsthe sweep and the gate from the exported lists (no second copy),
cellLabel()names a cell with the exact prefix its failure already used,
partitionWorkload()cuts the workload into contiguous balanced shares, and
shardFailures()is theaggregate's guard.
scripts/visual-matrix.tsis now a coordinator plus a share mode (--share I/N).The coordinator spawns one share per core (four by default,
VISUAL_SHARDSoverrides it), each in its own process with its own server, port and temporary
database, then reads each share's
visual-matrix/shares/shard-<i>.jsonandprints the aggregate. A page reused its browser context per locale and mode, so
a share does not pay context setup per cell.
share's result never arrived, a share dropped a cell it was assigned, a cell was
measured twice, or a share exited nonzero without naming a failure. Every share
failure is printed verbatim by the aggregate, so a failing cell in share 2
reaches the job output, not only that share's artifact.
visualkeeps its name and its place: the job is unchanged,ci-okandmain-healthstillneedsa check calledvisual, and no required-check listmoved. The job graph is not touched; the parallel work sits inside the check.
docs/architecture.mdanddocs/ui.mdnow describe the sharded run instead ofthe single serial app.
Why this shape
The card's own numbers are the argument: the matrix is 54–66 s of a 79–88 s job,
the browser cache was worth ~3 s against 12 s of run-to-run noise, and the job's
critical path is therefore the serial sweep. Running N independent shares on a
multi-core runner makes the gate about as long as one share.
Alternatives considered
visual. Rejected:it changes the job graph and the jobs that depend on
visualby name, which thecard's third acceptance clause and the Lead's scope both forbid.
cell, so each share would rebuild its browser context per cell — the partition is
contiguous on purpose.
server is one Node process, so the shares would serialize on the resource the
shard exists to spread; a share that crashed the server would also be measured
by its neighbours.
cache is ci: keep the console visual matrix fast and deterministic #787's mechanism and its allowlist is ci: allow actions/cache on the reviewed list so a workflow can cache its browser layer #1206; sharding stands alone.
Red first
test/visualMatrixShards.test.tsat the pin044c7515with only the testcommitted: 6 tests, 5 fail, 1 pass.
test/visualMatrixShards.test.tssha256359ab9d1d77b56f2e9e9b3e0b2c0f3250e8717ac9e6f0a8ef2a5f0be6e8ec905(
tmp/1208/red-base.log). The file reaches the new API through the module object,so it loads at the pin and names the missing function instead of dying at import.
The three existing runner-shape tests in
test/visualMatrix.test.tsthat pinnedthe serial loop's text now assert the same contracts against
visualWorkload():the narrow case still goes through the overflow walk with locale/width/path, the
landing page is still the one cell captured signed out, and the gate still covers
every path at
GATE_WIDTHS×GATE_SCHEMES. No assertion was dropped.Mechanism exercised without a browser
No local Playwright browser is installed in this workspace (the CDN download is
not usable at this speed), so the browser pass itself is CI-side. The
orchestration was still run for real:
VISUAL_SHARDS=2 npx tsx scripts/visual-matrix.tsspawned both shares, each started its own server and reached
chromium.launch,each wrote
visual-matrix/shares/shard-<i>.jsonwith zero cells, and theaggregate failed with 190 failures — both share stops plus every one of the
188 cells named as never measured — exit 1 (
tmp/1208/smoke-2-share.log). Thatis the survival half of #787 running in the direction that bites: a share that
measured nothing does not read green.
Acceptance measurement
Product's ruling on
#1208(comment7067745172) fixes the method: every rununder 66 s, all on the same head, gated on the job total. Three consecutive runs
of the
visualjob at405bda6f6eed41d2a9d0a935ff929dd2367b211c, allsuccess:npm ciplaywright installvisual:matrix44938519599#113695060359944938519599#213695146375644938519599#3136952575665All three are under the 66 s cap; the slowest has 6 s of headroom. The matrix
step is 22–30 s against the card's 54–66 s baseline for the same 188 cells; the
rest of the total is the install, the build and the upload, which this card does
not change.
Tuning evidence at earlier heads, deliberately not counted in the three above:
ee61b76emeasured a 70 s job whose install was 26 s (job136948961541), and02850622, with the default set to two shares per core, measured a 35 smatrix and a 64 s job (job
136949780225). Eight shares are slower than four onthis runner, so the default is one share per core and
VISUAL_SHARDSoverridesit for a measurement.
Not claimed: the local smoke run's wall time. It has no browser and demonstrates
only the aggregate's refusal.
Ran:
npm run checkatee61b76e— lint, typecheck, 3299 tests / 3299 pass, build: pass (tmp/1208/check-tip-ee61b76e.log)npx tsx --test test/visualMatrixShards.test.ts— 6/6 at the tip; at044c7515the same file is 1/6node scripts/risk-gate.mjs --base 044c7515—risk-tier: T3; basis: scripts/visual-matrix.tsnode scripts/changelog.mjs checkandnode scripts/version.mjs check— passVISUAL_SHARDS=2 npx tsx scripts/visual-matrix.ts— aggregate refused with 190 named failures, exit 1 (no browser in this workspace)Not run: the visual matrix in a real browser, and therefore the timing — no local Playwright browser; CI owns both, and the run ids and totals go into this body.
Not run:
dockerand any other flag-set job that is notvisual.Changelog-not-needed: this changes the CI gate's scheduling only; no user-visible behaviour or surface changes.