Skip to content

stream: normalize fused stateless transform results - #65367

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-stateless-transform-intermediate-output
Open

stream: normalize fused stateless transform results#65367
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-stateless-transform-intermediate-output

Conversation

@trivikr

@trivikr trivikr commented Aug 18, 2026

Copy link
Copy Markdown
Member

Fixes: #65366

Normalize each stateless transform result before passing it to the next transform in a fused run. This ensures that subsequent transforms always receive Uint8Array[] batches in both synchronous and asynchronous pipelines.


Assisted-by: codex:gpt-5.6-sol

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Aug 18, 2026
Normalize each stateless transform result before passing it to
the next transform in a fused run. This ensures that subsequent
transforms always receive Uint8Array[] batches in both synchronous
and asynchronous pipelines.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@trivikr
trivikr force-pushed the stream-iter-stateless-transform-intermediate-output branch from f42db5e to a780551 Compare August 18, 2026 03:01
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2026
@nodejs-github-bot

This comment was marked as resolved.

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (92ee8b7) to head (a780551).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/pull.js 51.51% 14 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65367      +/-   ##
==========================================
- Coverage   90.15%   90.11%   -0.04%     
==========================================
  Files         752      752              
  Lines      251884   251907      +23     
  Branches    47368    47373       +5     
==========================================
- Hits       227078   227009      -69     
- Misses      16164    16236      +72     
- Partials     8642     8662      +20     
Files with missing lines Coverage Δ
lib/internal/streams/iter/pull.js 83.28% <51.51%> (-0.87%) ⬇️

... and 36 files with indirect coverage changes

🚀 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.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

if (isUint8Array(result)) return [result];
if (typeof result === 'string') return [toUint8Array(result)];
if (isAnyArrayBuffer(result)) return [new Uint8Array(result)];
if (ArrayBufferIsView(result)) return [arrayBufferViewToUint8Array(result)];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: shouldn't we return result as default if none of the if cases match ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream/iter: fused stateless transforms do not normalize output between transforms

4 participants