Skip to content

Conversation

@jzulauf-lunarg
Copy link
Contributor

@jzulauf-lunarg jzulauf-lunarg commented Jan 23, 2026

Preload storage is vector of PreloadFrames containing vectors of ParsedBlocks moved from a deque of parsed blocks created during pre-loading. Data construction and teardown are outside the measurement window.

Also fixes corner cases in 1st, 2nd, and stutter frames (when ProcessBlocks returns the same frame number twice), and removes extra frame when --quit-after-measurment-range is set.

NOTE: This is currently built on Performance Clawback II so it' has the "zulauf-unbuffered-read" change commit, so for clarity only review the changes of the last commit.

@jzulauf-lunarg jzulauf-lunarg requested a review from a team as a code owner January 23, 2026 23:54
@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build queued with queue ID 631199.

@jzulauf-lunarg jzulauf-lunarg self-assigned this Jan 23, 2026
@jzulauf-lunarg jzulauf-lunarg requested review from MarkY-LunarG, bradgrantham-lunarg, fabian-lunarg and ncesario-lunarg and removed request for a team January 23, 2026 23:55
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d0508e67d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 100 to +103
{
// We can succeed at EOF, if there are more files on the stack.
success = HandleBlockEof("preload", false /* no frame or block info */);
// Normal case, just add the preloaded frame
preloaded_frames_.emplace_back(std::make_unique<PreloadedFrame>(current_preload_frame));
preloaded_frames_.back()->AppendMovedBlocks(frame_blocks);

Choose a reason for hiding this comment

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

P2 Badge Skip enqueuing frames on kEndProcessing

This “normal case” enqueues a preloaded frame for any non-error result. When PreloadBlocksOneFrame ends with kEndProcessing (e.g., EOF right after the previous frame boundary or an early stop from block limits), frame_blocks can be empty or represent a partial frame, but it still gets queued here. During replay, ReplayOneFrame always returns kFrameBoundary, so ProcessNextFrame increments current_frame_number_ for that partial/empty frame, which doesn’t happen in the non-preload path and can shift frame counts/measurement range by one. Consider only enqueuing when preload_result == kFrameBoundary, or carry a “complete frame” flag so replay doesn’t increment for partial EOF frames.

Useful? React with 👍 / 👎.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8690 running.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8690 passed.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build queued with queue ID 634393.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8728 running.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8728 passed.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build queued with queue ID 634664.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8731 running.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8731 passed.

Copy link
Contributor

@ncesario-lunarg ncesario-lunarg left a comment

Choose a reason for hiding this comment

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

LGTM pending others' reviews.

bool IsReady() const { return state_ == BlockState::kReady; }
bool IsVisitable() const { return (state_ == BlockState::kReady) || (state_ == BlockState::kDeferredDecompress); }
bool IsUnknown() const { return state_ == BlockState::kUnknown; }
bool IsValid() const noexcept { return state_ != BlockState::kInvalid; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Does gfxreconstruct use exceptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's there to give compiler the hint that it doesn't need to at guard logic...

// GFXRECON_LOG_INFO("Frame delimiter encountered during preload, ending frame preload.");
break;
}
// This is really part of the non-preloaed previous (first) frame,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "preloaed" -> "preload"

Replay storage is vector of ParsedBlocks moved from ad deque of parsed
blocks

Also fixes corner cases in 1st, 2nd, and stutter frames, and extra frame
when --quit-after-measurment range.
@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build queued with queue ID 635662.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8743 running.

@ci-tester-lunarg
Copy link
Collaborator

CI gfxreconstruct build # 8743 passed.

// We assume that only known, vistable blocks were preloaded
GFXRECON_ASSERT(queued_block.IsVisitable());

bool decompressed = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused?


SetDecoderBlockIndex(block_index);
std::visit(dispatch_visitor, queued_block.GetArgs());
block_index++;
Copy link
Contributor

Choose a reason for hiding this comment

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

This has no effect

// Block processing will update current_frame_number_, so save and restore it,
// as callers rely on it remaining unchanged by preload.
const uint64_t save_current_frame = current_frame_number_;
bool success = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is never used

};

public:
const static uint32_t kFirstFrame = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be constexpr uint64_t

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants