Skip to content

fix(javascript): preserve wide async chunk collection - #10362

Merged
kaoru0822-kitauji merged 2 commits into
mainfrom
codex/n13-0938-bundler-chunks-8545
Nov 13, 2026
Merged

kaoru0822-kitauji merged 2 commits into
mainfrom
codex/n13-0938-bundler-chunks-8545

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #8545. This changes the bundler collector independently of #10355/#10356/#10359. Related #9500 changes bootstrap recognition in the same file; its collector is unchanged. Earlier #8568 is closed without merging.

Problem and change

recoverBundlerModules expands a factory's async keys into call arguments. A valid 1.45 MB Webpack source with 130,000 distinct keys overflows the source collector. The production worker's larger stack admits that case, but 300,000 calls still overflow and retain a generic memory constraint with misleading heap guidance.

Append keys by iteration at their owner, preserving normalization, deduplication, module order, unknown counts, source digests and ranges. Oversized facts reach the existing 8 MiB checkpoint owner and receive its exact transport ceiling and recovery. This does not make an oversized public graph admissible. No limits, schema, provider, execution authority or downstream error projection change. Ordinary correctness fix; advance scope approval is not applicable.

Executed verification

Base bbe2bcc979be747698d9ad9ce87af017b92e0f10; macOS arm64, Node 24.22.1 / npm 11.16.0.

  • Final tests on clean base: one failing capacity regression, at the collector's original call spread; one passing public checkpoint control.
  • npm run test:focused -- tests/boundary/javascript/asyncChunkCapacity.test.ts tests/acceptance/javascriptAsyncChunkBudget.test.ts src/domain/javascript/javascriptBundlerRegistrationIdentity.test.ts src/domain/javascript/javascriptFactoryExportRoles.test.ts src/domain/javascript/javascriptStaticAnalysisModuleIndex.test.ts src/domain/javascript/javascriptStaticAnalysis.no_finding_caps.test.ts — 140 passed in 6 files, 7.05 seconds for the selected suite.
  • The 130,000-key regression retains every numeric key plus a sibling module's distinct key, deduplicates the repeated key, preserves one unknown, and verifies exact module source digest/range. Existing identity, export-role, module-index and uncapped-finding controls pass.
  • The compiled CLI control uses 50,000 calls, a 2 GiB worker and graph caps of one. It retains the interrupted source, reports resource: transport with the checkpoint bytes and unchanged 8 MiB ceiling, and explains that increasing max_heap_mb cannot raise it. No source code executes.
  • An earlier local 300,000-call CLI test passed after the fix; the corresponding base probe retained the call-stack memory failure. Both commands exited zero with an interrupted file. That larger case is executed local evidence, separate from the final bounded control.
  • npm run check — passed; typed lint: 7,254 files, 0 errors, 4,987 advisory warnings. npm run verify:test-discovery — 3,508 files exactly once. Diff and commit/push hooks passed.

CI follow-up: the initial 300,000-call acceptance case hit its selected 30-second analysis deadline after 32 seconds on the runner. The final public control only generates the facts needed to exercise checkpoint refusal; the original 130,000-key capacity regression remains. No timeout was raised. Separately, the unchanged Linux desktop cleanup fixture failed once and passed an unchanged-head retry; #10366 retains that unresolved intermittent failure. No lifecycle fix or blanket retry policy is claimed. Fresh-head Actions at ce17ee28153ba80e810b2c45aec0a78d413d4215 completed: 25 distinct successful checks, 22 skipped, none failed or running (latest result per check name; repeated metadata runs excluded). Automated review has no actionable findings.

No runtime speedup is claimed; CPU, agent tokens and process-family peak were not benchmarked. No real Electron application, external provider, stdio MCP or Windows/Linux workflow was verified locally.

Author readiness

Human owner: @kaoru0822-kitauji

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The author is exempt from the declaration check under CONTRIBUTING.md. Ready status records technical readiness; no human review is attested here. The PR readiness status passes under the verified author-ID exemption.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

The collector now appends async chunk keys one at a time instead of passing them all as function arguments.

  • Wide Webpack factories keep their async chunk keys.

Reviews (3) · Last reviewed commit: "test(javascript): bound the public check..." · Reviewed by Greptile

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator Author

CI also exposed an oversized public test workload: the 300,000-call acceptance case hit its caller-selected 30-second analysis deadline after 32.0 seconds on the runner. The 130,000-key source regression passed.

The public checkpoint control only needs enough static facts to exceed 8 MiB. I am reducing that control to 50,000 calls and including JSON stdout in failure diagnostics; the original 130,000-key producer regression still catches the actual call-spread defect. The public case is now explicitly a working admission control, not a second baseline-failing regression. The larger compiled CLI before/after was executed locally and remains manual evidence. No timeout or production budget is raised.

The separate Linux lifecycle-marker failure is tracked in #10366. One unchanged-head retry is running; it is not a claimed fix. A slow local Linux VM-image download was stopped before any guest test ran.

@kaoru0822-kitauji
kaoru0822-kitauji marked this pull request as ready for review November 13, 2026 14:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T14:10:16.424823Z ce17ee2 Draft marked ready
ℹ️ 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.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit 4b26f38 into main Nov 13, 2026
53 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the codex/n13-0938-bundler-chunks-8545 branch November 13, 2026 14:17
N0zoM1z0 pushed a commit that referenced this pull request Nov 14, 2026
`target.push(...items)` passes every item as a call argument and
overflows the stack once a target-sized array grows past the engine's
argument limit. This class was fixed one site at a time in #10304,
#10343, #10362 and #8632. Add one shared appendAll helper in
src/domain and use it at the remaining sites whose arrays grow with the
input: XML member counting, app-task row suggestions, native call
routes and unresolved calls, call-path caveats, environment-manifest
merges, reference-source import entries, dyld trace edges and JS
symbolic flow values. The web bundle merge from the previous commit now
uses the shared helper too.

Bounded spreads (fixed literals, page-sized reads) are left as they are.

Refs #10445
Refs #10342

Co-Authored-By: gensokyo-dev <[email protected]>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants