Skip to content

fix: append wide arrays without call spreads - #10539

Merged
N0zoM1z0 merged 6 commits into
mainfrom
fix/wide-array-append
Nov 14, 2026
Merged

N0zoM1z0 merged 6 commits into
mainfrom
fix/wide-array-append

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

push(...items) and other call spreads throw RangeError once an array exceeds the engine's argument limit, even when the items are within REA's own byte and count admission. This lands two contributor fixes for real crashes of this kind and converts the remaining unbounded sites to one shared helper. Merge with rebase to keep per-commit authorship.

Fixes #10445
Refs #10342

Change From
Web bundle analysis merges wide script results without call spreads, and its capacity test uses a valid script_key (#10445) #10446, Vinícius DS Andrade
Node SEA / artifact claim collectors and Bun segment claims append without call arguments, so a valid but ambiguous Bun carrier is no longer reported as an I/O failure #10342 by Felix and ShuaixinHuang (production code and its Bun test; its vitest and scheduling commits are not taken)
src/domain/appendAll.ts appends with a loop, and 11 other sites whose input size follows the target (reference imports, native call routes, environment manifest rules, dylib resolution, call paths, app task draft rows and member counts, JS symbolic bindings, web bundle results) use it. After review, the if-branch and continuation-condition joins in the symbolic return flow do too follow-up

Contribution scope: ordinary fixes within existing boundaries; maintainer scope decision not applicable.

  • Read existing files or captured data.

Not included: a lint rule against call spreads on unbounded arrays. There are about 130 push(... sites in src/, most bounded by construction, so whether to enforce this with a rule is left as a maintainer decision.

Evidence and regression coverage

  • appendAll.test.ts appends more items than the engine's argument limit allows in one call.
  • webBundleResultCapacity.test.ts and bunStandaloneCli.test.ts (from the contributor PRs) cover the crashing inputs.

Validation performed

  • npm run test:focused -- on the three changed test files, after rebasing onto current main: 9 passed. When the branch was prepared, the wider affected set passed: 622 tests.
  • npm run check:fast (pre-push): passed. oxfmt --check on the changed files: clean.

Compatibility, safety, and release

  • Breaking changes: none.

Author readiness

Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).

Supersedes #10446 and #10342.

viniciusdsandrade and others added 5 commits November 14, 2026 13:18
`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]>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T13:18:39.339569Z
We couldn’t complete this review. Comment @codex review to try again.
45af365 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 usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous wide-branch failure is fixed and no new blocking issue was found.

Summary

Replaces wide array call spreads with loops and a shared appendAll helper across analysis and artifact readers.

  • Web bundle analysis collects wide script results without call spreads.
  • Bun and Node SEA readers collect wide artifact claims without call spreads.
  • Other analysis workflows append wide collections item by item.

Reviews (3) · Last reviewed commit: "fix(javascript): join wide symbolic bran..." · Reviewed by Greptile

The block branch of the symbolic return flow already appended without a
call spread, but the adjacent if branch and both continuation-condition
joins still spread, so a generated wrapper with a wide tree of unknown
conditions could still overflow the argument limit.

Refs #10445

Co-Authored-By: gensokyo-dev <[email protected]>
@N0zoM1z0
N0zoM1z0 merged commit 1582520 into main Nov 14, 2026
52 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/wide-array-append branch November 14, 2026 13:59
@morluto morluto added the bug Something isn't working label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] buildCapturedWebBundleAnalysis overflows call stack when merging wide script observation or inference lists

5 participants