Skip to content

Studio: keep the prompt upsampler client out of the startup chunks, reset the startup budget to the build - #14168

Merged
danielhanchen merged 7 commits into
mainfrom
fix/bundle-budget-after-14137
Oct 19, 2026
Merged

danielhanchen merged 7 commits into
mainfrom
fix/bundle-budget-after-14137

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Main is over the startup bundle budget, so Frontend build + bundle sanity fails on every PR based on it:

over the startup budget: transfer 2005.9 KB > 2003.5 KB, raw 6665.4 KB > 6659.1 KB      (main at 2fee36ff)

This PR takes two steps. It moves #14137's prompt upsampler client out of the startup chunks, which is real growth with a lazy home. It then resets both limits to the measured build. Main has gone over this budget repeatedly, and the root of that is a shortfall in how the limits were raised, which this corrects.

Cause

#14137 (FLUX.3 prompt upsampling). The Images page is lazy (ImagesPage = lazy(...) in __root.tsx), but features/images/api.ts is not. Startup modules import it for other calls (loaded-models-api.ts, loaded-models-sources.ts, use-media-companion-bytes.ts). #14137 put the four upsampler calls there, with value imports from lib/prompt-enhance.ts, so that module joined the startup chunks. Only prompt-enhance-panel.tsx, inside the lazy Images page, calls them.

The limits themselves. Each raise since #14073 was sized from its own PR's delta and added to the previous limit. That previous limit already sat below the build, starting at #14073:

The raises since (#14072, #14075, #14110, #14108, #14113) each added their delta, so the shortfall carried forward. CI agrees with my machine to the byte: the first run of this PR read 1999.7 KB transfer on both.

Change

  • New features/images/prompt-upsampler-api.ts: holds getPromptUpsamplerStatus, startPromptUpsamplerDownload, cancelPromptUpsamplerDownload and previewEnhancedPrompt, moved unchanged, with the same parseJson error handling.
  • api.ts: now imports only the PromptEnhancement type from lib/prompt-enhance (erased at build).
  • prompt-enhance-panel.tsx: imports the calls from the new module.
  • No behavior change in the app.
  • check-bundle-budget.ts: both limits are reset to the measured build plus the usual margin (160 B raw, 189 B transfer), with an entry in the BUDGET comment block explaining why the reset is absolute rather than by delta.

Testing

One machine and build, Node 24, exact byte totals from the budget script, 95 chunks throughout:

tree raw B transfer B
main 2fee36ff 6,825,378 2,053,999
main 2fee36ff + the move 6,821,006 2,052,708
main 78e5eefa4d (adds #14113) + the move 6,821,334 2,052,857
+ #14183 6,821,410 2,052,614
+ #14172 (one tooltip design) 6,825,307 2,053,990
this PR (main b227654927, adds #14184, + the move) 6,825,725 2,054,072

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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-10-19T04:46:37.599474Z 438a0a5 Manual request
🔒 Security Review ⚠️ Failed 2026-10-18T23:17:49.054331Z 7646148 PR opened
ℹ️ 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. Hooray!

Reviewed commit: 764614875c

ℹ️ 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

Copy link
Copy Markdown
Member Author

pre-commit.ci added 81fb69b8, which reformats two backend test files that main currently carries unformatted (test_video_backend.py, test_video_te_quant_default.py): a blank line and a call wrapped one argument per line. It is formatting only, so it stays.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 81fb69b8de

ℹ️ 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 changed the title Studio: keep the prompt upsampler client out of the startup chunks Studio: keep the prompt upsampler client out of the startup chunks, fix the transfer budget Oct 19, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7d23b499c2

ℹ️ 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".

# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
@danielhanchen danielhanchen changed the title Studio: keep the prompt upsampler client out of the startup chunks, fix the transfer budget Studio: keep the prompt upsampler client out of the startup chunks, reset the startup budget to the build Oct 19, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 4af8c8b1b1

ℹ️ 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".

…er-14137

# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 43d3167c5d

ℹ️ 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

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 438a0a5119

ℹ️ 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 69dbf9e into main Oct 19, 2026
@danielhanchen
danielhanchen deleted the fix/bundle-budget-after-14137 branch October 19, 2026 04:47
danielhanchen added a commit that referenced this pull request Oct 19, 2026
## Summary

Main is over the startup bundle budget again, by 17 B raw, so `Frontend
build + bundle sanity` fails on every PR based on it:

```
over the startup budget: raw 6665.9 KB > 6665.9 KB      (main at 551dc28)
```

#14168 reset both limits to the measured build plus a 160 B raw / 189 B
transfer margin. #14190 (open //host links as web links) then added 177
B raw / 52 B transfer to the eager startup chunks. It merged while its
own bundle check was still queued, so the raise never happened.

## Cause

`studio/frontend/src/lib/open-link.ts` is the shared link opener, and
the eager shell imports it. #14190 adds leading/trailing
control-character trimming and `//host` (scheme-relative) link handling
there (+16 lines). That is real growth with no lazy home: the opener is
needed from the first screen. #14187, the other commit since the reset,
changes no frontend code.

## Change

- **`check-bundle-budget.ts`:** a BUDGET comment entry for #14190, and
both limits moved to the measured build plus the same margin:
  - `rawBytes`: 6,825,885 -> 6,826,062.
  - `transferBytes`: 2,054,261 -> 2,054,313.

## Testing

One machine and build, Node 24, exact byte totals from the budget
script, 95 chunks throughout. CI has matched this machine to the byte on
every earlier budget change.

| tree | raw B | transfer B |
|---|---|---|
| `4dc8bf0bd2` (after #14168, no frontend change since) | 6,825,725 |
2,054,072 |
| main `551dc28123` (+ #14190, #14187) | 6,825,902 | 2,054,124 |

- **Main against the old limits:** `over the startup budget: raw 6665.9
KB > 6665.9 KB`.
- **With this change:** `within budget (0.2 KB transfer, 0.2 KB raw to
spare)`.
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