Uh oh!
There was an error while loading. Please reload this page.
feat: speed up attw on native packages by ignoring *.node files - #282
feat: speed up attw on native packages by ignoring *.node files#282sxlijin wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 8318a9e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
sxlijin
commented
Aug 19, 2026
Original agent PR description: Summary
MotivationBoundaryML/baml#4481 is the motivating real-world example. BAML's ATTW CI currently stages a package without a very large opaque native This link is context only; this PR does not close BoundaryML/baml#4481. Validation
The repository does not define a lint script. |
andrewbranch
commented
Aug 19, 2026
Thank you! Where exactly is the work being saved here? Something still reads the Uint8Array from the tarball and passes it to the Package constructor; I’m assuming the actual savings come from something else triggering |
sxlijin
commented
Aug 20, 2026
I'm not totally sure, unfortunately: we had an external contributor send in the attw wrapper improvement to us, which dropped our attw step from 60s to 5s, which seems pretty plausible time savings for cutting out a 630MiB file read. I will admit that I'm not sure if the implementation that codex put together is the correct one, and I don't actually know what the expensive io op is that this change saves, but this repo seemed low activity enough that upstreaming the issue by opening the PR instead of a GH issue. If I'm reading your comment correctly, are you suggesting that the correct fix should be somewhere else? |
andrewbranch
commented
Aug 20, 2026
Yeah, that’s what I’m guessing, but it’s been a long time since I’ve been in the weeds of this code. I will take a closer look. |
sxlijin
commented
Aug 20, 2026
Sounds good, thanks! Would love if we could drop our wrapper script and just use attw directly :) |
When running attw on a native package - i.e. one that implements the library logic in C++ or Rust or something via N-API - attw today will read the entire
library-aarch64-apple-darwin.nodebinary artifact, which can easily be 100MiB+, but do nothing with it because there's no type information in the binary artifact.We ran into this in
BoundaryML/baml#4481 and are working around this by invoking attw through a wrapper that ignores
dist/*.node, but this felt like a good thing to upstream :)(Used my coding agent to open the PR, but I've rewritten the PR title and description to be hopefully useful.)