Skip to content

rollout: add ordinals to rollout JSONL lines#31859

Draft
owenlin0 wants to merge 2 commits into
owen/reverse_jsonl_scannerfrom
owen/rollout_ordinals
Draft

rollout: add ordinals to rollout JSONL lines#31859
owenlin0 wants to merge 2 commits into
owen/reverse_jsonl_scannerfrom
owen/rollout_ordinals

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds an optional integer ordinal to each rollout JSONL line and emits them only for thread.history_mode = 'paginated' threads. Since we haven't started writing any yet, we can guarantee that all paginated threads are new rollouts and can start with ordinal 0. We don't have to deal with populating 0 in the middle of a rollout.

For legacy rollouts, we don't write ordinals and leave it as ordinal: None.

Why

Ordinals give paginated rollout records a durable ordering position for later projection and thread forking optimizations. Having a monotonically increasing integer for an append-only log just makes a lot of sense and makes things downstream easier.

@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 03989c7 to f04dbe7 Compare July 9, 2026 20:47
@owenlin0 owenlin0 changed the title core: add ordinals to rollout items rollout: add ordinals to paginated records Jul 9, 2026
@owenlin0 owenlin0 changed the base branch from main to owen/reverse_jsonl_scanner July 9, 2026 20:47
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from 89ed20b to 8c750e4 Compare July 9, 2026 21:07
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from f04dbe7 to 77c3655 Compare July 9, 2026 21:08
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from 8c750e4 to b70fee9 Compare July 9, 2026 21:23
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 77c3655 to 132432a Compare July 9, 2026 21:26
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from b70fee9 to c0b4b7a Compare July 9, 2026 22:06
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 132432a to 76fc070 Compare July 9, 2026 22:07
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from c0b4b7a to 6a09208 Compare July 9, 2026 23:26
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 76fc070 to 5bc52c8 Compare July 9, 2026 23:30
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from 6a09208 to 0d139e9 Compare July 9, 2026 23:57
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 5bc52c8 to 5c059c3 Compare July 10, 2026 00:01
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from 0d139e9 to ce5433a Compare July 10, 2026 00:09
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from 5c059c3 to be36b03 Compare July 10, 2026 00:13
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from ce5433a to fdc193c Compare July 10, 2026 03:27
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from be36b03 to fb7b102 Compare July 10, 2026 03:27
@owenlin0 owenlin0 force-pushed the owen/reverse_jsonl_scanner branch from 930e827 to 239e27c Compare July 10, 2026 04:16
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch 3 times, most recently from 404f923 to a77e380 Compare July 10, 2026 04:31
@owenlin0 owenlin0 changed the title rollout: add ordinals to paginated records rollout: add ordinals to rollout JSONL lines Jul 10, 2026
@owenlin0 owenlin0 force-pushed the owen/rollout_ordinals branch from a77e380 to 3b1fd5b Compare July 10, 2026 04:41
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.

1 participant