Repository navigation
Conversation
Discovered when testing some other changes that zstd was not handling certain chunk boundaries very well. This fixes it. - Decodes concatenated and skippable zstd frames across all chunk boundaries. - Preserves rejectGarbageAfterEnd semantics. - Reports corruption in subsequent frames. - Handles trailing partial frame identifiers consistently. - Covers classic sync/async and iterable APIs. - Updated documentation and internal typings. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
Collaborator
Member
|
The Error: not ok 5 line-length: Line should be <= 72 columns.
...
'- Decodes concatenated and skippable zstd frames across all chunk boundaries.', |
Member
Author
|
Yes, I'll fix the lint issue in the commit message when landing. |
panva
approved these changes
Sep 8, 2026
trivikr
approved these changes
Sep 8, 2026
jasnell
added a commit
that referenced
this pull request
Sep 8, 2026
Discovered when testing some other changes that zstd was not handling certain chunk boundaries very well. This fixes it. - Decodes concatenated and skippable zstd frames across all chunk boundaries. - Preserves rejectGarbageAfterEnd semantics. - Reports corruption in subsequent frames. - Handles trailing partial frame identifiers consistently. - Covers classic sync/async and iterable APIs. - Updated documentation and internal typings. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65865 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Member
Author
|
Landed in 7055c48 |
aduh95
pushed a commit
that referenced
this pull request
Sep 16, 2026
Discovered when testing some other changes that zstd was not handling certain chunk boundaries very well. This fixes it. - Decodes concatenated and skippable zstd frames across all chunk boundaries. - Preserves rejectGarbageAfterEnd semantics. - Reports corruption in subsequent frames. - Handles trailing partial frame identifiers consistently. - Covers classic sync/async and iterable APIs. - Updated documentation and internal typings. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65865 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Sep 22, 2026
Discovered when testing some other changes that zstd was not handling certain chunk boundaries very well. This fixes it. - Decodes concatenated and skippable zstd frames across all chunk boundaries. - Preserves rejectGarbageAfterEnd semantics. - Reports corruption in subsequent frames. - Handles trailing partial frame identifiers consistently. - Covers classic sync/async and iterable APIs. - Updated documentation and internal typings. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65865 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This was referenced Oct 19, 2026
andimial
pushed a commit
to andimial/mneme
that referenced
this pull request
Oct 20, 2026
原反证断言 zstdDecompressSync(buf) 只能拿到第一帧,依赖的是「整块解只吐第一帧」这一 Node 旧行为。24.22.0 起解码跨 chunk 边界也能解出所有帧(nodejs/node#65865),断言在 legacy 腿(装 latest 24.x)上过期,main 下次 runner 升到 24.22.0 就会红。 改成数 zstd magic 帧头:既与产品代码 orEachFrame 的切帧判据同源,又不绑定解码器语义。 第二行断言用 stat.frames + stat.failed——帧头数 = 成功数 + 失败数 是实现契约,而 「帧头数 = 成功数」只在 failed 恒为 0 时成立,是巧合不是规矩。 已知局限写进注释:这条锁的是「切帧判据仍是 magic」,不是碰撞免疫。payload 里撞上 magic 时计数器与解码器会一起错(半片也解得出来),实测 frames 同样变成 4,这条测不出来。
JDProfresh
added a commit
to JDProfresh/Codeman
that referenced
this pull request
Oct 26, 2026
…t frame The frame-walking test asserted that zlib.zstdDecompressSync returns only the first of 40 concatenated frames. That was true when the walker was written, but nodejs/node#65865 (shipped in 26.10.0 and in 24.22.0 LTS) makes Node decode every frame, so the assertion fails on current Node 24 LTS and 26 while the walker itself is still correct. The assertion tested Node, not Codeman: the walker's own 40-frame checks stay, and the comments now say which Node versions stop at the first frame, since the supported range (>=22) still includes them.
Ark0N
pushed a commit
to Ark0N/Codeman
that referenced
this pull request
Oct 27, 2026
…t frame The frame-walking test asserted that zlib.zstdDecompressSync returns only the first of 40 concatenated frames. That was true when the walker was written, but nodejs/node#65865 (shipped in 26.10.0 and in 24.22.0 LTS) makes Node decode every frame, so the assertion fails on current Node 24 LTS and 26 while the walker itself is still correct. The assertion tested Node, not Codeman: the walker's own 40-frame checks stay, and the comments now say which Node versions stop at the first frame, since the supported range (>=22) still includes them.
Ark0N
pushed a commit
to Ark0N/Codeman
that referenced
this pull request
Oct 27, 2026
- docs/architecture-invariants.md DeepSeek mechanism (1): the decoder stops at the first frame only before Node 24.22 and 26.10 (nodejs/node#65865) - src/deepseek-transcript.ts:33: reflow the over-long comment line to the width of the lines around it - docs/deepseek-integration.md:241: same reflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nightness
added a commit
to Brainwires/deno
that referenced
this pull request
Dec 4, 2026
…e 26.10 has them The vendored test-zlib-reject-garbage-after-end.js is Node 26.5's, whose zstd case expects decoding to stop after the first frame. Item 632 decodes every concatenated frame, as Node 26.10 does (nodejs/node#65865), which changed that case to trailing junk and added five zstd frame tests. Ignore the vendored copy with that reason and port Node 26.10's version of the test into tests/unit_node/zlib_test.ts. Also point a net.ts comment at item 616 (it said 615). DENEXT.md item 632. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nightness
added a commit
to Brainwires/deno
that referenced
this pull request
Dec 4, 2026
Input that ends in one to three bytes of another frame's magic number after a complete frame was silently accepted under rejectGarbageAfterEnd: the zstd decoder takes those bytes into its own buffer, so the JS side never saw input left over. Node 26.10 (nodejs/node#65865) decides at the finish flush in ZstdDecompressContext::GetErrorInfo: with all input consumed and output space left, a frame still open is "unexpected end of file" (Z_BUF_ERROR), except a partial magic number after a complete frame, which is trailing junk (refused under rejectGarbageAfterEnd). Port that check: the decoder gets the flush and rejectGarbageAfterEnd (through init, as in Node), and the JS side turns its trailing-junk error into ERR_TRAILING_JUNK_AFTER_STREAM_END, also for the continuation writes. The ported Node tests cast through zlib.ZstdOptions instead of any. Tests: unit_node zlib_test.ts "zstd handles incomplete trailing frame identifiers as junk" (Node 26.10's), plus "zstd input that ends inside a frame is an unexpected end of file" and "zstd trailing partial magic across writes is junk at the end". DENEXT.md item 632. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Open
2 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Discovered when testing some other changes that zstd was not handling certain chunk boundaries very well. This fixes it.
Technically a behavior change but zstd is still experimental.