Repository navigation
test(eventStream): stream-equivalence corpus bank - #556
Merged
Merged
Conversation
Ports the K6 formal streaming gates from the v2 rewrite: the full corpus x chunk-size matrix (whole-file / 1024 / 37 / sampled 1-byte), the raw-event parity spot-gate, the synthesized EBE SQ gate, both bounded-memory gates plus the ED-1 large-deflate variant, the backpressure gate, and the seven-phase truncation matrix. Port changes: fixture roots reworked to packages/fixtures/testImages and packages/fixtures/dicom (test/sample-op.lei added explicitly - it has not moved into fixtures on this branch), and review finding 23 fixed - relative paths are posix-normalized so the 1-byte-chunk sample filter matches on every platform, with a pinned assertion that the filtered sample resolves to all three fixtures so the gate can never silently skip again. Known-reject parity compares error class, not message, so the branches' differing raw-dataset error text is not load-bearing. Co-Authored-By: Claude Fable 5 <[email protected]>
buildAndTruncate and the fmiEnd scratch variable were dead code in the v2 file too; this branch's ESLint gate is stricter than the one the original grew up under. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Sep 30, 2026
|
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
This is the stream-equivalence corpus bank — the K6 formal gates from the v2 rewrite, ported onto this branch. It is the last piece of the streaming-reader review's test surface (finding 23), and it lands after the finding 6/7 fixes deliberately: its known-reject parity cells exercise exactly the error paths that PR #554 repaired.
A word on the budget first, since this file is ~1.5k lines: it is test-only and a mostly-verbatim port. The hand-written review surface is the ~50 lines of fixture-root rework plus the finding-23 fix; everything else — the comparison helpers, the synthetic-file byte writer, and the seven gates — arrives as-is from the reviewed v2 branch, reformatted by this repo's prettier config. I'd ask for the same kind of waiver the reader itself landed under in #538.
What the gates cover, in one breath: every fixture in the corpus (30 of them — the three CT1_UNC endianness variants, the extension-less deflate trio, 17 encapsulated permutations, the six committed dicom fixtures, and the known-reject
sample-op.lei) is streamed at whole-file, 1024-byte, and 37-byte chunk sizes and compared element-for-element against the bufferedfromPart10oracle; a raw-event spot-gate compares the full event call sequence for five representative fixtures; a synthesized correctly-encoded Explicit Big Endian SQ closes the K4 item-tag-endianness gap; two bounded-memory gates (plus the ED-1 large-deflate variant) prove the per-fragment consume and relay-throttle bounds with real byte counts; a backpressure gate pins that a blocked drain actually suspends the body loop; and a seven-phase truncation matrix asserts reject-not-hang from mid-preamble to empty input, each phase wrapped in a hang-detection timeout.The port made two kinds of changes. The mechanical one: fixture roots move from the v2 monorepo's
packages/parser/testImagesto this branch'spackages/fixtures/testImages, and the committedtest/*.dcmfixtures topackages/fixtures/dicom. I verified every enumerated fixture exists here 1:1 — the one wrinkle issample-op.lei, which still lives attest/sample-op.leion this branch, so the discovery adds it explicitly with a comment rather than silently losing the corpus's only known-reject cell.The substantive one is the finding-23 fix. The 1-byte-chunk gate samples three fixtures by filtering discovered paths against posix-style literals — but
path.relativeyields backslashes on Windows, so on that platform the filter matched nothing and the whole gate silently vanished. The port normalizes every discovered relative path to posix and pins the sample:One thing I verified rather than assumed: the known-reject cells assert that stream and buffered throw the same error class, not the same message — this branch's raw-dataset error text differs from v2's, and the class-level comparison means that difference is not load-bearing. All 112 gate tests pass here, and the full suite is green at 779 passing. The suite adds about four minutes of runtime, almost all of it the corpus matrix over the large CT images.
🤖 Generated with Claude Code