Conversation
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Thanks @ZenAlexa , this is indeed an issue. With our current design, we need to do two paces for the model loop and UI loop. Your PR should address issue with the model pace order But model pace will only happen when BLOCK mode is used in BACKPRESSUE, and happens when model generation is faster than UI rate (which defaults to 60hz), which is rare. |
Keep event collection immediately after model pacing. Restore the terminal lifecycle path for separate follow-up. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Yep, I agree on keeping this PR tight 👍 One detail I found while tracing it: I’ve trimmed #573 down to the ordering change and one focused regression. The terminal message settlement is a real lifecycle issue with its own boundary, so I’ve taken it out of this PR and will keep that work separate. |
…anup-investigate-the-large-input-to-model-step Signed-off-by: Ziming Wang <zimingwang945@gmail.com> # Conflicts: # flashdreams/flashdreams/api_v2/loop.py
|
Caught up with #548's multi-session lifecycle in The model loop now reads once before cadence for lifecycle and finished-state decisions, then folds in one more event-buffer snapshot after cadence before the step. Queued state messages keep their once-per-model-step ordering. The focused CPU suite passes all 61 tests (•̀ᴗ•́)و |
|
Yep, the race exists on current |
| while not self._shutdown_event.is_set() and ( | ||
| max_steps is None or steps_run < max_steps | ||
| ): | ||
| events, generation = event_buffer.read(reader_id) |
There was a problem hiding this comment.
event_buffer.read(reader_id) is called twice in this loop.
here and in line 333.
This doesn't seem right.. I will look into this
|
The second
|
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
| run = self._incorporate_user_events(events, generation) | ||
| if run.step_index is None: |
There was a problem hiding this comment.
Post-cadence messages are dropped
When an asynchronous model-loop operation is accepted during cadence pacing and the second event read observes a close event or another terminal condition, _incorporate_user_events() terminates the loop without running another message batch. _shutdown() then discards the accepted operation, causing reset, restart, or other model-state requests to be silently lost.
|
I've synced the cadence fix with current The regression continues to reproduce the stale input on the base branch and passes with the post-wait read. |
|
I checked the post-cadence queue concern against the shutdown contract: queued operations are discarded when the loop closes. Reset events use the event-buffer generation, and session replacement goes through the UI loop. I'm keeping one message snapshot per iteration here. |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Summary
I collect input after cadence pacing so events received during the wait reach the upcoming model step. Reset also clears buffered step timing at that final input snapshot.
Addresses #543.
Validation