Skip to content

Make the two ineffective import() calls static, fail the build on the next one, and re-measure the startup budget - #11676

Merged
danielhanchen merged 1 commit into
mainfrom
fix/startup-budget-static-imports
Sep 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/startup-budget-static-imports

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

main fails Frontend build + bundle sanity by itself: 5,601.9 KB raw against the 5,595.7 KB ceiling (the #11648 run reported 5,597.3 KB).

Where it went

Measured locally, one build per commit:

Commit Raw Transfer Chunks
83c4c8c (#11588, back under) 5,586.5 KB 1,659.5 KB 78
e64fd8f 5,591.9 KB 1,661.1 KB 78
76846f4 (#11607) 5,596.0 KB 1,662.5 KB 79
beab871 5,596.6 KB 1,662.8 KB 79
0065fad (after #11648) 5,601.9 KB 1,663.9 KB 79
this branch 5,599.7 KB 1,663.4 KB 79

Bisecting the chunk count lands on #11607. The extra chunk is thread-message-slot, 303 bytes, which Rolldown split out once fork-boundary-store began importing it. The rest grew inside chunks that were already eager: #11607's fork boundary (about 4 KB), then #11648's UI scale (about 5 KB). No new startup member was added, so there is nothing to lazy-load.

Changes

  • Two ineffective import() calls are now static imports. prompt-storage-dialog was loaded with import() in app-sidebar.tsx (2 sites), chat-page.tsx (2 sites) and chat-row-menu.ts, and refresh-context-usage in skills-api.ts (2 sites). The startup set already imports both statically, so the import() deferred nothing. It only split their graphs, which is the pattern Import the row fork's modules statically, which puts main back under the startup budget #11588 fixed for the row fork. Switching them to static imports saves 2.2 KB raw. Each function stays async, so a thrown export still rejects the way it did before.
  • The build now fails on the next one. vite.config.ts throws when Rolldown logs INEFFECTIVE_DYNAMIC_IMPORT. Until now that log only printed a yellow line in the build output, where nobody reads it. This is the second time the pattern has cost startup bytes.
  • The budget is re-measured, both halves together. rawBytes goes to 5,950,000 and transferBytes to 1,770,000. That leaves 210.8 KB raw and 65.1 KB transfer spare, the same margin Studio: re-measure the startup bundle budget, which main is red on by itself #11013 chose (211.7 KB and 64.6 KB).

Verification

… next one, and re-measure the startup budget

prompt-storage-dialog and refresh-context-usage were loaded with import() at five
sites while the startup set already imports both statically, so nothing was
deferred. Rolldown reported both as INEFFECTIVE_DYNAMIC_IMPORT and a build
warning is all it ever was. Importing them statically drops 2.2 KB raw from
the eager set, and the build now throws on that log instead of printing it.

That is not enough on its own: main measures 5,601.9 KB raw against the
5,595.7 KB ceiling. The eager set gained one 303-byte chunk since the last
raise and otherwise grew inside chunks already eager, mostly #11607 and
#11648, so the budget is re-measured with the margin #11013 chose.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T11:39:19.961646Z 82e2a68 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 82e2a68020

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit fef4775 into main Sep 23, 2026
39 of 47 checks passed
@danielhanchen
danielhanchen deleted the fix/startup-budget-static-imports branch September 23, 2026 11:56
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
… next one, and re-measure the startup budget (unslothai#11676)

prompt-storage-dialog and refresh-context-usage were loaded with import() at five
sites while the startup set already imports both statically, so nothing was
deferred. Rolldown reported both as INEFFECTIVE_DYNAMIC_IMPORT and a build
warning is all it ever was. Importing them statically drops 2.2 KB raw from
the eager set, and the build now throws on that log instead of printing it.

That is not enough on its own: main measures 5,601.9 KB raw against the
5,595.7 KB ceiling. The eager set gained one 303-byte chunk since the last
raise and otherwise grew inside chunks already eager, mostly unslothai#11607 and
unslothai#11648, so the budget is re-measured with the margin unslothai#11013 chose.
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