-
Notifications
You must be signed in to change notification settings - Fork 250
feat(runtime): materialize verified native PDF inputs #3266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tianrking
wants to merge
1
commit into
apache:main
Choose a base branch
from
tianrking:feat/runtime-native-pdf-inputs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Bound the work the request telemetry does on these bytes before raising the cap that makes them routine.
capturePreparedProviderRequestruns on every provider request — the tracker exists whenever model-call accounting does, so this is not gated onrecordProviderRequestCapture— andcanonicalizehas no typed-array branch, so aUint8Arrayis expanded element-wise throughObject.keys().sort(). Measured against this repository's builtpackages/runtime/distwith capture persistence disabled: an 8 MiB attachment costs 3.5 s per step, 12 MiB (today's image cap) 7.5 s, and 16 MiB (this cap) 9.5 s per step withrequestBytesreported as 222.4 MiB; across three steps that is 28.5 s during which a 10 ms timer scheduled beforehand never fires, and RSS grows 4.4 to 7.6 GiB. With capture persistence enabled the bytes are also verbatim inserializedRequest— I matched the%PDF-header inside it — which contradicts this PR's "without copying bytes into transcript text or diagnostics" and #3164's "PDF bytes must never enter transcript text, logs, RuntimeEvents, or diagnostics". This is not introduced here; images take the same path onmain. But this slice raises the ceiling to 18 MiB combined and makes ten-plus-MiB attachments ordinary, because a 16 MiB PDF is a normal document and a 16 MiB PNG is not. Giverequest-shape.tsa binary branch that represents file data as{ byteLength, sha256 }— substituting that summary drops the same call from 9.5 s to 0.4 ms andrequestBytesfrom 222.4 MiB to 312 B — and add a regression asserting that a file part's bytes never appear inserializedRequest. Landing it as a separate prerequisite is fine; landing native PDF input without it is not.