Skip to content

Avoid duplicate browser migration archive copy - #4500

Merged
neekolas merged 1 commit into
self-hostedfrom
codex/browser-migration-copy
Oct 13, 2026
Merged

neekolas merged 1 commit into
self-hostedfrom
codex/browser-migration-copy

Conversation

@neekolas

@neekolas neekolas commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Browser archive reads make a second JavaScript byte-array copy before copying the bytes into WASM memory. Use a checked Uint8Array cast to remove that allocation and save up to 100 MB per read. The 100,000,000-byte file limit, returned bytes, and byte-based import API stay unchanged.

Extend the existing boundary test to observe real typed-array constructor copies. It fails on the old reader and passes on this change. The full Browser migration suite and Rust/JavaScript formatting pass. The tested source and 259 staged assets plus five shipping artifacts remain unchanged.

This follows the merged migration PR #4455.

Note

Avoid duplicate Uint8Array copy in wasm migration archive reader

In wasm.rs, read no longer builds a new JavaScript Uint8Array from the value returned by read_output. It downcasts that value directly to Uint8Array and converts it to a Rust vector.

Behavioral Change: values that fail the downcast now return the mapped output error instead of being wrapped in a new array.

Macroscope summarized b19684f.

@neekolas
neekolas requested a review from a team as a code owner October 13, 2026 00:54
@macroscopeapp

macroscopeapp Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a narrowly scoped optimization that removes an intermediate browser byte-array copy while preserving archive limits and returned data, with focused regression coverage. Because it changes the production browser migration reader, human review is required for this migration-path change.

You can add or adjust custom eligibility rules. Learn more.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.93%. Comparing base (334dd7f) to head (b19684f).

Additional details and impacted files
@@               Coverage Diff               @@
##           self-hosted    #4500      +/-   ##
===============================================
+ Coverage        87.91%   87.93%   +0.02%     
===============================================
  Files              549      549              
  Lines           104073   104073              
===============================================
+ Hits             91497    91518      +21     
+ Misses           12576    12555      -21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@neekolas
neekolas merged commit f34168b into self-hosted Oct 13, 2026
49 checks passed
@neekolas
neekolas deleted the codex/browser-migration-copy branch October 13, 2026 01:30
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