Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The localized guards preserve synchronization and terminal-state handling, with focused regression coverage and no unresolved findings.
No open issues 🎉
What changed in this PR
This PR prevents empty writes to the HLS ingest byte queue from being mistaken for EOF, preserving live-stream reader behavior.
Changes:
- Accept empty writes immediately without modifying the queue, while still rejecting writes after finish or cancellation.
- Reject nonpositive read lengths without waiting or consuming bytes.
- Add regression coverage and document the corrected queue semantics.
| File | Description |
|---|---|
| Tests/AetherEngineTests/ByteFIFOTests.swift | Tests empty writes, terminal states, and invalid read lengths. |
| Sources/AetherEngine/IO/HLSIngest/ByteFIFO.swift | Adds guards for empty writes and nonpositive read lengths. |
| docs/architecture.md | Clarifies the byte queue’s write, read, and EOF behavior. |
| CHANGELOG.md | Records the HLS FIFO fix. |
Review effort: Balanced
jonluca
force-pushed
the
fix/fifo-empty-operations
branch
from
October 25, 2026 18:28
4dbf19d to
0571301
Compare
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.
Summary
Writing empty
Datainto the live-ingest FIFO creates a chunk that a reader drains as zero bytes, even though the queue is still open. The ingest boundary interprets that zero as EOF. Empty writes now leave the queue untouched and complete without waiting for capacity; finished and cancelled queues still reject them.Nonpositive read lengths now return an error without waiting or consuming bytes, keeping zero reserved for a finished, drained queue. Storage and dependencies are unchanged.
Test plan
swift test --disable-automatic-resolution --jobs 4, then ran the nearby suites with--skip-build.-warnings-as-errors: upstream returned zero after an empty write; the fixed source kept the reader parked until a byte arrived and then returned one. The invalid-length result changes from zero to -1.git diff --checkpass. The package test build retains the existing unrelated CLI unused-binding and interruption-test unused-result warnings.Checklist