mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 22:35:08 +00:00
fix(display): Vegas resumes after live priority, and six smaller runtime fixes (#644)
- Vegas: a live-priority pause was only lifted from inside run_frame(), which returns before that check while paused, so the ticker never came back until a restart. run_iteration() now resumes it (the controller only calls it when nothing preempts Vegas); start()/stop() clear the pause state. Iteration length is timed with the monotonic clock. - Dim schedule: a per-day disabled day now updates the minute-gate cache, so brightness no longer flips back to dim within each minute. - On-demand: a second request no longer overwrites the rotation resume index with the first request's mode. - Render pipeline: reset() drops the prepared group and deferred queue, and a prefetch in flight across a reset discards its result. - Sync: stop() removes the status file (and the controller's cleanup now calls it), standalone removes a stale one at startup, and writes use a unique mkstemp temp file. - render_gate.swap_releases_gil() delegates to frame_timing. - Stale docstrings/comments corrected. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1385,6 +1385,41 @@ class TestContinuousExtension:
|
||||
widths.append(p.scroll_helper.total_scroll_width)
|
||||
assert max(widths) < 6000, f"strip grew unbounded: {max(widths)}"
|
||||
|
||||
def test_reset_drops_the_previous_runs_prepared_content(self):
|
||||
# Vegas off then on: the group lined up for the old run, and any
|
||||
# canvas-bound plugins still queued, must not reach the new one.
|
||||
groups = [[('a', [self._block(600)])], [('old', [self._block(600)])]]
|
||||
p, _ = self._pipeline(groups, continuous_scroll=True)
|
||||
p.compose_scroll_content()
|
||||
p.start_prefetch()
|
||||
if p._prefetch_thread:
|
||||
p._prefetch_thread.join(timeout=5)
|
||||
p._deferred_queue.append('old-canvas')
|
||||
assert p._prepared_group is not None
|
||||
|
||||
p.reset()
|
||||
assert p._prepared_group is None
|
||||
assert not p.has_deferred()
|
||||
|
||||
def test_a_prefetch_in_flight_across_reset_is_discarded(self):
|
||||
import threading
|
||||
release = threading.Event()
|
||||
groups = [[('a', [self._block(600)])], [('old', [self._block(600)])]]
|
||||
p, stream = self._pipeline(groups, continuous_scroll=True)
|
||||
p.compose_scroll_content()
|
||||
take = stream.take_next_group
|
||||
|
||||
def slow_take(count=None, offscreen_only=False):
|
||||
release.wait(timeout=5)
|
||||
return take(count, offscreen_only)
|
||||
stream.take_next_group = slow_take
|
||||
|
||||
p.start_prefetch()
|
||||
p.reset() # Vegas stops while the fetch is still running
|
||||
release.set()
|
||||
p._prefetch_thread.join(timeout=5)
|
||||
assert p._prepared_group is None
|
||||
|
||||
|
||||
class TestDeferredDraining:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user