Skip to content

fix(tuner): keep a running composition across a report-axis move - #697

Merged
kirillDevPro merged 1 commit into
mainfrom
fix/tuner-axis-kill
Sep 22, 2026
Merged

kirillDevPro merged 1 commit into
mainfrom
fix/tuner-axis-kill

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

The tuner's field-set composition ("Подобрать состав") died a few minutes in without an error,
a summary line or a "stopped" caption — the progress and spinner vanished and the button looked
never pressed.

Root cause: the Analytics window's report-axis observer retires every in-flight read identity
when the axis changes, and it also invalidated the tuner — which cancelled the running search
and reset its state to Idle. The axis moves on events unrelated to the search (a core's feed
respawning, a time-offset bucket change, a newly connected core), and each deeper beam step
takes longer, so the kill almost always landed around step 5-6.

Fix: the observer takes an axis-only path. Read identities and drafts are still retired, but a
live composition is kept, and its finished result is marked "report time axis shifted" in a
warning tone. The search never held a read-cancellation token, so keeping it raises no SQLite
interrupt and no false read failure. A scope, period or field change still stops the search.

How to verify

  • cargo test -p moon-ui-gpui --bin moonterminal analytics::tuner (135 pass) and
    --test theme_contract (360 pass); the new tests are mutation-proved.
  • In the app: start "Подобрать состав" and let it run to the end — it finishes with a result.

The tuner's field-set composition died a few minutes in, without an
error, a summary line or a "stopped" caption: the progress and spinner
vanished and the button looked never pressed.

The Analytics window's report-axis observer retires every in-flight
read identity when the axis changes - and it also invalidated the
tuner, which cancelled the running search and reset its state to Idle.
The axis moves on events unrelated to the search (a core's feed
respawning, a time-offset bucket change, a newly connected core), and
each later beam depth takes longer than the last, so the kill almost
always landed around step 5-6.

The observer now takes an axis-only path: read identities and drafts are
still retired, but a live composition is kept, and its finished result
is marked "report time axis shifted" in a warning tone. The run stays
valid - its rows are snapshotted at start, and the shift is at most a
15-minute offset bucket against a weeks-long fitting window; a report
generation advance, a larger change, already does not cancel it. The
search never held a read-cancellation token, so keeping it raises no
SQLite interrupt and no false read failure. A scope, period or field
change still stops the search as before.
@kirillDevPro
kirillDevPro merged commit ddd1ac7 into main Sep 22, 2026
8 checks passed
@kirillDevPro
kirillDevPro deleted the fix/tuner-axis-kill branch September 22, 2026 18:08
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