Skip to content

fix editor reader - #64

Merged
Exsper merged 7 commits into
masterfrom
dev
Sep 17, 2026
Merged

Exsper merged 7 commits into
masterfrom
dev

Conversation

@Exsper

@Exsper Exsper commented Sep 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

Reading the osu! editor is inherently best-effort: the editor object lives in
osu! stable's managed heap and is rebuilt (test mode, map load) or moved by the
GC, so cached pointers go stale. Until now a single failed read threw out of the
periodic task, which stopped drawing, spammed "Periodic task error: Exception:
FetchEditor error." / "FetchAll error." and could leave the viewer stuck until
it was restarted (issue #62).

Read path:
* Never treat "not in the editor" as an error: a window title that does not end
  with ".osu" (test mode, song select, loading) is reported as an idle state and
  no longer counts as a failure.
* Keep the last good snapshot and keep drawing frames while reads fail; the
  status bar now says which state the viewer is in instead of silently showing a
  frozen picture.
* A failed read invalidates the "editor check succeeded" cache so the next tick
  performs a real validation instead of trusting a stale address.
* Consecutive read failures back off (200ms doubling to 3s) and, after 10
  failures, force a re-bind which now bypasses the success cache (previously the
  recovery call was swallowed by it, so a dead binding could persist forever).

Re-binding:
* Move the memory scan (up to ScanTimeoutMs per attempt) to a background
  thread; the drawing loop keeps running and only skips reads while it is in
  flight.
* Replace the permanent region blacklist with a per-region backoff (60s
  doubling to 30min), a resume cursor and a "last hit region first" fast path,
  so a skipped region is retried later instead of never, and a timed-out scan
  makes progress instead of restarting from zero.
* Validate candidate addresses harder (editor state + HOM + object list) to
  avoid latching onto dead editor copies left behind by test mode.
* Limit how many scan threads may run at once (timed-out scans cannot be
  interrupted and would otherwise pile up).

Other:
* The Reset menu item (F5) now really drops the binding (the reader used to be
  a static instance, so the old address and scan state survived) and restores
  the normal drawing interval instead of polling once every 3 seconds.
* Read cadence and defaults are intentionally unchanged: full reads still run at
  FullRead_Interval (20ms) while the editor is in the foreground and the mouse is
  moving, and at LowFreqRead_Interval otherwise. A beatmap is static, so the only
  moving content on screen is the object being dragged/placed, and its position
  is only available from memory: this interval is what makes it follow the mouse
  smoothly, so it must not be traded away for fewer reads. Cutting read volume
  should instead be done by reading only the dragged/selected objects
  incrementally.
* Docs: describe the new status texts, the drag-follow role of the read interval,
  and ask for the Editor Reader log switch when reporting read problems.
@Exsper
Exsper merged commit 5103c80 into master Sep 17, 2026
1 check passed
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