Skip to content

fix(ci): widen the i18n-runtime chunk ceiling to 6075 KB - #14532

Merged
bolichen97 merged 1 commit into
mainfrom
fix/raise-t-chunk-ceiling
Sep 27, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/raise-t-chunk-ceiling

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a contributor opening a pull request stops seeing Bundle Size Gate red for
28 bytes of growth in a chunk their branch never touched.

no linked issue: found while attributing CI reds on unrelated pull requests
(#14327, #14518), not from a filed report, so there is no issue to close on merge.

assets/t-*.js — the i18n runtime chunk (the i18next singleton, initI18n, the
English catalog) — measures 955.0 KB (977948 B) on an analyze build of main.
Its ceiling was 955 KB. It is over by 28 B, and that is enough to fail the
gate on every open pull request at once. Measured at 20:30 UTC: red on 6 of 12
other recently-updated open PRs, none of which grew this chunk.

Why it matters

Every one of those authors has to prove a red is not theirs before they can read
their own result, and the fastest honest way to do that costs an hour. The bill for
whatever grew this chunk lands on strangers, repeatedly, until someone happens to fix
it. The gate is working exactly as designed — it is reporting to the wrong people.

Not a goal

  • Not finding what grew. The entry's own note says the runtime went from a
    measured ~909 KB to 955 KB with nobody having established the cause. That
    investigation is real work and it stays open; this change does not pretend to have
    done it.
  • Not shrinking the chunk. A lazy import() boundary or a codeSplitting group
    is the structural answer and needs the investigation above first.
  • Not re-measuring to the 5% convention. ~1003 KB is what the file's convention
    would give, and it was deliberately NOT chosen: it leaves the same 28-byte cliff one
    feature away, which is how this red arrived in the first place.

What changed (motivation → approach → change)

One number, and a note that refuses to be mistaken for a measurement.

CHUNK_BUDGETS.t goes from 955 * KB to 6075 * KB. This is an operator decision,
not evidence
, and the comment says so in those words, because every other entry in
this file is "measured size + ~5% headroom" and a reader who applied that reading here
would conclude the chunk is fine. At 6.4x the measured size this entry no longer
signals growth for this chunk: the next 5 MB of i18n-runtime bloat arrives green. That
cost was weighed and accepted by a repository maintainer against the cost of the gate
reporting to people who cannot act on it.

The file already has precedent for a documented departure from the 5% rule — the lazy
per-locale catalog chunks share a 3 MB ceiling with their reasoning carried in a note —
so this follows that shape rather than inventing one: the number is unusual, and the
note beside it is what makes the number honest instead of misleading.

Backwards compatibility

Compatible, and deliberately narrow: one entry in one allowlist inside a CI script. No
runtime code, no build configuration, no other chunk's budget. Every other ceiling and
the 500 KB default are untouched, so growth anywhere else still fails exactly as before.

Tests

Verified in both directions against a real analyze build (npm run analyze) in a
clean origin/main worktree, which is the only way to check a gate that reads
dist/bundle-report.json:

ceiling node scripts/check-bundle-size.mjs
955 * KB (before) exit 1 — FAIL assets/t-5F-gSVGz.js: 955.0 KB exceeds its 955.0 KB budget by 28 B (chunk 't')
6075 * KB (after) exit 0 — 808 chunks within budget (default 500.0 KB, 24 allowlisted)

npx eslint scripts/check-bundle-size.mjs clean. The measurement quoted throughout —
977948 B — is read out of that build's own report, not inferred from the CI message.

Manual verification

The 6.4x figure is arithmetic on the measured size, not an estimate: 6075 KB ÷ 955.0 KB.
For scale inside this same allowlist, the largest chunk in the build is App at
1893.2 KB and each lazy locale catalog is ~1.0-1.8 MB against a 3 MB ceiling — so after
this change the widest ceiling in the file belongs to a chunk under 1 MB. That is the
asymmetry the note exists to flag, and it is the reason this is one PR with one number
rather than a quiet edit inside a larger change.

Screenshots / video

N/A — CI script only, no user-visible surface.

Pattern harvest

Rule candidate: review-prompt — a budget or ceiling whose number is a DECISION rather
than a measurement must say so where it lives. Every other entry in this file means
"measured + 5%", so an operator-chosen number that looks the same silently converts a
deferred investigation into an apparent all-clear. The note, not the number, is what
keeps the next reader from misreading it.

Not generalizable: the value itself. 6075 KB encodes one maintainer's trade between a
gate that mis-reports and a gate that under-reports, on one chunk, on one day.

The `t` chunk measures 955.0 KB (977948 B) on an analyze build of main, which is
28 B over the 955 KB ceiling it carried -- and that 28 B was failing Bundle Size
Gate on EVERY open pull request at once, on a chunk none of those branches grew.
Measured at 20:30 UTC: red on 6 of 12 other recently-updated open PRs.

A maintainer chose a wide ceiling over the two alternatives, knowing the cost:
shrinking the chunk needs someone to find what grew, and re-measuring to the 5%
convention (~1003 KB) would leave the same 28-B cliff one feature away. 6075 KB is
6.4x the measured size, so this entry no longer signals growth for this chunk --
the next 5 MB of i18n-runtime bloat arrives green.

The entry says so in its own comment rather than presenting the number as
evidence. Every other ceiling in this file is "measured size + ~5%", and reading
this one the same way would be reading it wrong: it is a decision about who the
gate reports to, not a statement that the chunk is fine. The deferred work is
named there too -- the runtime went from a measured ~909 KB to 955 KB and nobody
has established what grew, and re-measuring the ceiling down is a strict
improvement whenever that happens.

Verified both directions locally against a real analyze build: at 955 KB the gate
fails with the 28-B breach, at 6075 KB it reports 808 chunks within budget.
@bolichen97
bolichen97 requested a review from a team as a code owner September 27, 2026 21:20
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 27, 2026
@bolichen97
bolichen97 merged commit 3565123 into main Sep 27, 2026
41 of 44 checks passed
@bolichen97
bolichen97 deleted the fix/raise-t-chunk-ceiling branch September 27, 2026 21:21
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Sep 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of cf31a5c54c8949423474a3b60dbfde75f939b1df — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] cf31a5c

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — 🔴 changes requested (blocking)

GPT 5.6 found at least one blocking issue that must be resolved before merging cf31a5c54c8949423474a3b60dbfde75f939b1df. 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- website/scripts/check-bundle-size.mjs:153 -- The 6075 KB ceiling removes the i18n-runtime regression guard
t: 6075 * KB,
A multi-megabyte t chunk -> checkChunkBudgets accepts it -> Bundle Size Gate passes despite the regression.
Anchor: residual/guard-removal
Fix: Restore a near-current ceiling with bounded headroom, such as 1003 * KB.
[BLOCK-MERGE] cf31a5c
[GPT-REVIEWED] cf31a5c

Adjudication (Opus 5) — is blocking on each finding proportionate?

HARM: guard removal — the t chunk's regression ceiling sits at 6.4× its measured size, so growth is admitted silently.
Conditions confirmed: checkChunkBudgets breaches only on size > budget (website/scripts/lib/bundleReport.mjs:230) against t: 6075 * KB (website/scripts/check-bundle-size.mjs:153); the condition is ordinary English-catalog growth, which this file's own notes measure at ~36 KB per four days, not an extreme combination. Recovery path: none — findChunkCycles measures graph shape only (bundleReport.mjs:268), and vite's chunkSizeWarningLimit: 3810 (website/vite.config.ts:911) is a build warning that cannot fail the gate.
Rarity argument therefore cannot be stated: the reaching path is the normal one, so FLAG's bar is unmet.

[ADJUDICATION] cf31a5c total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] cf31a5c

[ADJUDICATION-FENCED] cf31a5c fenced=1 flagged=0
UPHOLD-FENCED F1 website/scripts/check-bundle-size.mjs:153 -- The ceiling is reached by ordinary catalog growth (the file's own notes measure ~36 KB per four days) rather than by any extreme condition, and no other gate measures this chunk's size, so the residual-risk argument FLAG requires cannot be made.
[GPT-ADJUDICATED-FENCED] cf31a5c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt cf31a5c54c8949423474a3b60dbfde75f939b1df: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of cf31a5c54c8949423474a3b60dbfde75f939b1df — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The 6.4x ceiling admits the exact regression this entry exists to catch — a catalog or library reaching the eager runtime chunk now lands green.

Watch

The entry's own header defines its purpose: "a jump here means a non-English catalog, or a library, reached the runtime module." Each lazy catalog is ~1.0–1.8 MB, so one leaking into the eagerly-loaded t chunk (955 KB → ~2–3 MB) fits under 6075 KB and ships silently to every first load — unlike the 3 MB catalog-chunk precedent cited, where the wide ceiling covers lazy chunks. A mid-band ceiling (~1200–1500 KB) still absorbs years of the documented ~5%-margin drift while keeping library/catalog-class detection.
Clears when: a maintainer explicitly confirms 6075 KB over a mid-band value, or the ceiling is lowered to one that still trips on a catalog-sized leak.

The deferred work the number encodes — "the i18n runtime went from a measured ~909 KB to 955 KB and nobody has named what grew" — exists only as a code comment; nothing re-triggers the investigation or the re-measure the note calls "a strict improvement."
Clears when: a filed issue tracks the growth attribution and the re-measure down to convention.

[DESIGN-REVIEWED] cf31a5c

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5 Review — 🔴 changes requested (blocking)

Reviewed cf31a5c54c8949423474a3b60dbfde75f939b1df — this comment is updated in place on each push.

BLOCKING — the t chunk ceiling is widened to 6.4x its measured size, removing the only size guard on the always-loaded i18n runtime.

[BLOCK-MERGE] cf31a5c

BLOCKING — website/scripts/check-bundle-size.mjs:153

  t: 6075 * KB, // operator ceiling; chunk measured 955.0 KB -- see the note above

A non-English catalog or a library reaching src/i18n/t.ts (the regression this entry's own note says it exists to catch — bn alone is 1.71 MB) → vite build --mode analyze → checkChunkBudgets's if (size > budget) in scripts/lib/bundleReport.mjs:230 with budget = 6,220,800 → 5.0 MB of growth on the chunk main.tsx statically imports before first render passes both ci.yml's bundle-size and main-ratchet-audit.yml's bundle-ceiling green, and chunkSizeWarningLimit: 3810 (vite.config.ts:911) is now tighter than this entry, so nothing else reports it either.
Fix: set the entry to the file-wide 5% convention over the stated 977,948 B measurement — t: 1003 * KB — which still clears the 28 B breach with ~47 KB of headroom.

[OPUS-REVIEWED] cf31a5c

Verdict parsed from the review's SHA-scoped output markers for commit cf31a5c54c8949423474a3b60dbfde75f939b1df.

False positive or not applicable? A repository writer can comment:
/ai-review override fable cf31a5c54c8949423474a3b60dbfde75f939b1df: <one-sentence reason>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant