LearnNewsExamplesConnect
Frontmatter
assigneesDeviousCardi
createdAtNov 21, 2026, 10:10 AM
updatedAtNov 21, 2026, 3:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/21771
authorneo-gemini-julia
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined2
signals[]
blockedBy[]
blocking[]
closedAtNov 21, 2026, 3:51 PM

Bulk unmeasured e2e specs skew shard 1/15 into the 6-minute ceiling

Closed v14.0.0/archive-v14-0-0-chunk-6 bughelp wantedgood first issueaitestingbuild
neo-gemini-julia
neo-gemini-julia commented on Nov 21, 2026, 10:10 AM

Please comment to claim before starting; check current assignees and linked PRs.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Context

Two independent e2e-engine (1/15) CI runs hit the 6-minute (360s) step ceiling on 2026-11-21 with 100% of executed tests passing:

  • PR #21766 (job 136782504763, defect-note MESSAGE:023cd3db): 57 passed (6.0m) (362s) -> killed at timeout-minutes: 6.
  • PR #21769 (job 136792762453): 38 passed (6.1m) (368s) -> killed at timeout-minutes: 6.

Across the five completed green 15-shard runs on 2026-11-21 (44883471766, 44883100147, 44880123498, 44878141569, 44876901023), shards 1/15 and 2/15 consistently ran in 305-340s while shards 5/15, 6/15, and 12/15 finished in 195-225s — a 110-125s systematic spread across shards that balancedShard() plans identically at 367-368s.

The Problem

#21493 rebuilt buildScripts/util/e2eEngineDurations.json at 243 files and switched durationOf()'s unmeasured-file fallback from the table's median to its 90th percentile (38.5s on today's table). That fallback works when 1-5 files are missing, because a single over-priced file leaves its own shard light and spreads (38.5s - actual) / 15 across the other 14 shards.

Since 2026-11-19, 44 new example/component E2E specs joined enginePaths() (287 executed specs vs 243 entries in e2eEngineDurations.json, verified via node --input-type=module importing enginePaths, balancedShard, and ENGINE_DURATIONS from buildScripts/util/e2eCiSelection.mjs at 7cd0d6618e / beb96c739a). When 44 unmeasured specs (~3 per shard) enter balancedShard()'s single greedy pass at p90 = 38.5s (ahead of 90% of measured files):

  1. Shard 1/15 starts with workstation/WorkstationFilmTourNL.spec.mjs (166.4s) and shard 2/15 starts with portal/ExamplesCatalogNL.spec.mjs (130.4s), while shards 5/15 and 6/15 start at 73.3s and 72.4s.
  2. Before shard 1/15 catches up in planned seconds, shards 5/15 and 6/15 absorb 4 unmeasured specs (154.0s of p90 budget for lightweight example specs) and shards 3..4, 7..15 absorb 3 (115.5s), while shard 1/15 receives 1 (38.5s) and shard 2/15 receives 2 (77.0s).
  3. The remaining ~219 measured specs (< 38.5s) then equalize all 15 shards to 367-368s planned seconds — concentrating 328.6s of real measured work onto shard 1/15 (291.5s onto shard 2/15) vs 213.1-214.4s of real measured work on shards 5/15 and 6/15.

The Architectural Reality

Design authority: "the ceiling is six minutes of test time per shard … A shard nearing it gets its slow spec fixed first, and a sibling only when the runner budget has room" (.github/workflows/test.yml:465-469).

  • buildScripts/util/e2eCiSelection.mjs:221: ENGINE_DURATIONS loads buildScripts/util/e2eEngineDurations.json (243 entries vs 287 enginePaths() files).
  • buildScripts/util/e2eCiSelection.mjs:409-443: durationOf(durations) prices unmeasured files at known[Math.floor(known.length * .9)] (38.5s), and balancedShard({paths, shard, durations}) sorts paths in one pass by seconds(b) - seconds(a) || (a < b ? -1 : 1).
  • Because unmeasured files carry identical unknown expected cost, letting heavy measured outliers (166.4s, 130.4s) crowd unmeasured files onto other shards starves shard 1/15 of fallback headroom whenever a batch of specs lands between table rebuilds.
  • Placing unmeasured files onto the lightest shards first (before known files are balanced longest-first on top) deals 44 unmeasured files evenly (3 on 14 shards, 2 on 1 shard), lowering the heaviest shard's known load on today's stale table from 328.6s to 291.4s (251.6-253.0s across the other 14 shards) while preserving #21493's single-missing-file behavior (1 missing file still plans at p90 and leaves its shard p90 lighter in known work).

The Fix

  1. Spread unmeasured specs evenly before balancing known specs in balancedShard() (buildScripts/util/e2eCiSelection.mjs:430-443): Sort unmeasured files (!(path in durations)) ahead of measured files in balancedShard() ((a in durations) - (b in durations) || seconds(b) - seconds(a) || (a < b ? -1 : 1)), and document why in balancedShard's JSDoc: unknown-cost files distribute floor(K/M)..ceil(K/M) per shard first so multi-spec waves cannot concentrate real measured load onto the shard holding the single longest spec.
  2. Rebuild buildScripts/util/e2eEngineDurations.json from >= 5 recent completed full-matrix green runs: Use gh run view <id> --repo neomjs/neo --log passed to node buildScripts/util/e2eCiSelection.mjs --engine-durations run1.log run2.log ... > buildScripts/util/e2eEngineDurations.json (candidate green 15-shard runs from 2026-11-21: 44883471766, 44883100147, 44880123498, 44878141569, 44876901023, or fresher completed full runs at pickup time) so every file in enginePaths() carries a measured per-run-max duration.
  3. Pin bulk-unmeasured balancing in test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs: Add a deterministic unit arm (red on dev) with one heavy measured outlier (160s), smaller measured files (10-35s), and multiple unmeasured files (K >= 2 * shards), asserting that unmeasured files differ by at most 1 across shards and do not pile disproportionate known seconds onto shard 1.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
balancedShard({paths, shard, durations}) (buildScripts/util/e2eCiSelection.mjs:430) balancedShard & durationOf JSDoc (:402-429) Deals unmeasured files (!(path in durations), each priced at p90) across shards first, then balances measured files longest-first on top Empty durations ({}) still returns seconds: 0; 0 or 1 missing file matches existing p90 split balancedShard JSDoc in e2eCiSelection.mjs test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs

Decision Record impact: none.

Acceptance Criteria

  • AC-1: balancedShard() deals unmeasured files (!(path in durations)) before measured files so unmeasured file counts per shard differ by at most 1, pinned by a new unit test in test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs that fails on dev and passes on the branch (npx playwright test --config test/playwright/playwright.config.unit.mjs test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs).
  • AC-2: buildScripts/util/e2eEngineDurations.json holds a measured duration for every current enginePaths() file, rebuilt via --engine-durations from at least 5 completed full-matrix runs named in the PR body.
  • AC-3: The PR body records per-shard planned seconds before and after the table rebuild, plus the stale-table per-shard known-seconds range before (213.1-328.6s) and after (251.6-291.4s) the balancedShard() ordering fix.

Out of Scope

  • Adding a 16th e2e-engine shard (declined in #21493 under the 20-runner org pool budget).
  • Raising .github/workflows/test.yml:633's timeout-minutes: 6 ceiling (ruled out by .github/workflows/test.yml:465-469).
  • Scheduled automatic table commits in CI (out of scope per #21259, #21287, and #21493).
  • e2e-brain shard durations.

Avoided Traps

  • Changing durationOf() back to the median or mean: #21493 proved median under-plans single heavy new specs (11/17 exceeded the median) and puts the entire error onto one shard. Keeping p90 while dealing unmeasured files first preserves single-file headroom and eliminates multi-file starvation of shard 1/15.
  • Rebuilding e2eEngineDurations.json without fixing balancedShard(): Another wave of 30-40 Engine 14 / post-cut example specs would reproduce the exact 328.6s vs 213.1s real-work skew onto shard 1/15.
  • Pooling 20-30 historical runs from older spec versions: #21493 Avoided Traps showed stale per-file maxima from older spec revisions unbalance current splits; use 5-8 recent full-matrix runs.

Related

  • #21493 — introduced the p90 unmeasured-file fallback and 6m ceiling at 243 tier files.
  • #21287 — multi-run max engineDurations and 15-shard matrix.
  • #21259 — initial stale e2eEngineDurations.json diagnosis.
  • #21501 — extracted Generate the Docs class index out of the run step ceiling.

Live latest-open + closed sweep: checked latest 25 open issues (#21624-#21765) + open and closed searches (e2e shard, e2eEngineDurations, duration table, 6 minutes; read Out of Scope and Avoided Traps on closed #21493, #21287, #21259, and #21501) at 2026-11-21T09:08Z; 79 open issues (red), no open equivalent or owning CI-tier epic found. A2A in-flight sweep: checked latest 30 messages (status: 'all') through 2026-11-21T09:08Z; only @neo-gemini-maryam's defect-note (MESSAGE:023cd3db), which this ticket promotes, touches e2e-engine (1/15) 360s timeouts. MC sweep: query_raw_memories("e2e-engine shard timed out after 6 minutes all tests passed fallback duration table"), 8 results + ask_knowledge_base (type: 'ticket'), 5 refs (#21259, #21287, #21501, #20077, #21493), no prior exclusion on unmeasured-first shard ordering. Own-assignment sweep: 5 open (#21765, #21707, #21676, #20987, #20671), none overlapping. Agent OS structure map: n/a (buildScripts/util/ in neomjs/neo only).

Origin Session ID: 664ca229-4bbd-4e00-ae41-008707688181 Retrieval Hint: "bulk unmeasured e2e specs p90 fallback starves shard 1/15 balancedShard 6 minute ceiling"

DeviousCardi
DeviousCardi Nov 21, 2026, 10:54 AM

I'd like to work on this — implementing the unmeasured-first ordering fix in balancedShard(), rebuilding the durations table, and adding the unit test arm. Will open a PR shortly.

@github-actions - 2026-11-21T09:54:32Z

Thanks for claiming this, @DeviousCardi, and welcome! Assigned to you — you can start now.

Your claim reserves this issue for 3 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

DeviousCardi cross-referenced by PR #21780 on Nov 21, 2026, 1:58 PM
DeviousCardi
DeviousCardi Nov 21, 2026, 1:58 PM

PR opened: [QUARANTINED_URL: github.com] (branch fix/21771-unmeasured-first-sharding, commit a32cedd).

  • balancedShard() now deals unmeasured files first (floor(K/M)..ceil(K/M) per shard) before balancing measured files longest-first; p90 fallback unchanged for the single-missing-file case.

  • e2eEngineDurations.json rebuilt from 7 green full-matrix runs of 2026-11-21 (44903302345, 44900670601, 44883471766, 44883100147, 44880123498, 44878141569, 44876901023) — all 287 enginePaths() files measured.

  • New unit arm in E2eCiSelection.spec.mjs pins the split (red on dev, green on the branch); 27/27 spec tests pass, 552/552 in buildScripts/util.

  • Planned seconds: max 368s (over the 360s ceiling) before → 291-292s after; stale-table known-seconds range 213.1-328.6s → 251.6-291.4s with the ordering fix alone.

  • 2026-11-21T13:11:44Z @neo-opus-vega cross-referenced by PR #21782