Reader/eager first chunk#8
Merged
virtexalejandro merged 3 commits intomainfrom Apr 28, 2026
Merged
Conversation
…/ OnReady API OpenReplayFile() previously returned the instant the header+footer were parsed, leaving zero frames serviceable. Loaded() was true but the first GetFrame*() call would still pay the chunk-0 load cost synchronously. This change kicks off chunk 0 load eagerly on OpenReplayFile() and exposes three consumption styles so callers choose whatever fits: - poll: IsReady() / IsReadyFailed() / GetReadyError() - block: WaitUntilReady() / WaitUntilReady(timeout) - listen: ReplayReaderEvents::OnReady / OnReadyFailed Failure of the async chunk-0 load does NOT fail OpenReplayFile() -- the reader is still usable for metadata inspection (header, schema, seek table), consistent with the async philosophy. Empty replays flip ready synchronously via MarkReadyVacuous() so waiters never hang. The eager warm is narrowed to a (0,0) cache window around the WarmAt(0) call and restored to the default (2,2) immediately after. This preserves the intent that only the first chunk is pre-loaded -- callers that set a narrow cache window right after OpenReplayFile() (memory-constrained tools, isolation tests) stay unaffected. No external handle to the reader exists during the narrow window so the temporary narrow is unobservable. Tests: 6 new cases in test_reader_context.cpp (poll happy path, direct- facade callback, post-open callback single-shot, empty replay, destruction-during-load race, sync GetFrame hits warm cache, WarmAt after ready doesn't regress the flag, OnReadyFailed on corrupt chunk 0). Two of the failure tests GTEST_SKIP when aggressive corruption also breaks the synchronous header/footer parse. Samples: samples/ready_api.cpp demos all three styles (--style=a|b|c|all). Benchmarks: bench_reader_ready.cpp measures OpenReplayFile alone, OpenReplayFile+WaitUntilReady, and OpenReplayFile+GetFrameSync(0) on the synth_10k.vtx fixture. Numbers on this box: ~2.98ms open-only, ~5.65ms open-to-ready, ~5.91ms open-to-first-frame. TSan: not runnable on MSVC (VTX_SANITIZE gated NOT MSVC); Linux CI job covers -DVTX_SANITIZE=thread. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mechanical fixes flagged by the diff-only clang-format gate in .github/workflows/build.yml. No semantic changes.
virtexalejandro
added a commit
that referenced
this pull request
Apr 28, 2026
Reader/eager first chunk
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.
No description provided.