Skip to content

Commit fd000ab

Browse files
Clarify batch iteration indexing in streaming callback.
Document that batch bounds use completed-iteration base values while OnIteration is normalized to 1-based indices to avoid ambiguity in replay tracking. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 073427a commit fd000ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/c_bindings/fast_wrapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ class StreamingOneWesolowskiCallback final : public WesolowskiCallback {
268268
batch_end_iteration = 0;
269269
return;
270270
}
271+
// `base_iteration` is the number of completed iterations before this batch.
272+
// `OnIteration` normalizes to 1-based (`iteration++`), so this batch is [base+1, base+size].
271273
batch_start_iteration = base_iteration + 1;
272274
if (std::numeric_limits<uint64_t>::max() - base_iteration < batch_size) {
273275
batch_end_iteration = std::numeric_limits<uint64_t>::max();

0 commit comments

Comments
 (0)