aboutsummaryrefslogtreecommitdiffstats
path: root/idatui
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-07 04:00:03 +0200
committeruser <user@clank>2026-08-07 04:00:03 +0200
commit8218b9112393420286210458daabe187af57cd8c (patch)
tree744c7ca91896b9487595e6bde5e1584d4e1ba2c4 /idatui
parentautoresearch: record the bench history, the budget and the graph non-determin... (diff)
downloadida-tui-8218b9112393420286210458daabe187af57cd8c.tar.gz
ida-tui-8218b9112393420286210458daabe187af57cd8c.tar.xz
ida-tui-8218b9112393420286210458daabe187af57cd8c.zip
CORRECTNESS REPAIR, kept on its merits. The full suite (which the gate was NOT running) revealed that the worker-connect poll change made test_project_ui flaky: 5ms polling on a background thread through a cold auto-analysis starved the UI thread enough that the loading overlay was still up when the test pressed Ctrl+O. Poll now backs off to a 25ms cap (keeps the boot win, no busy-wait), the racy boot wait is fixed, and checks.sh runs tests/run.py in full (830 checks) instead of just the scenario suite.
Result: {"status":"keep","total_ms":18608,"lg_boot_ms":708.5,"lg_decomp_ms":2454.9,"lg_graph_ms":1034.5,"lg_hex_ms":431.9,"lg_index_ms":95.1,"lg_listing_cold_ms":530.2,"lg_listing_warm_ms":413.4,"lg_nav_ms":7057.9,"lg_palette_ms":5,"lg_render_ms":214.2,"lg_search_ms":1408.9,"pure_graph_ms":213.3,"sm_boot_ms":433.6,"sm_decomp_ms":1292,"sm_graph_ms":754,"sm_hex_ms":433.4,"sm_index_ms":2.6,"sm_listing_cold_ms":260.4,"sm_listing_warm_ms":280.5,"sm_nav_ms":286.1,"sm_palette_ms":0.3,"sm_render_ms":251,"sm_search_ms":46.5,"fails":0}
Diffstat (limited to 'idatui')
-rw-r--r--idatui/worker_client.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/idatui/worker_client.py b/idatui/worker_client.py
index 4f90700..173cd9d 100644
--- a/idatui/worker_client.py
+++ b/idatui/worker_client.py
@@ -117,16 +117,20 @@ class WorkerClient:
# (a small binary, or a seeded .i64), which is most of the time in
# the tests and noticeable on a re-open.
#
- # Backing off geometrically from the first probe was still too eager:
- # a seeded database is ready at ~250ms, by which point the delay has
- # grown to 134ms, so every open waited ~350ms whatever the binary --
- # the same number for a 47KB `echo` and a 1.2MB `bash`, which is what
- # gives a polling artefact away. Hold the fast rate for the first few
- # seconds (a connect attempt on an absent socket is microseconds) and
- # only slow down for a genuine cold auto-analysis, which runs for
- # minutes and does not care about 200ms.
+ # Backing off all the way to 0.2s was too eager: a seeded database
+ # is ready at ~250ms, by which point the delay has grown to 134ms, so
+ # every open waited ~350ms whatever the binary -- the same number for
+ # a 47KB `echo` and a 1.2MB `bash`, which is what gives a polling
+ # artefact away. Cap the backoff at 25ms instead: the overshoot on a
+ # fast open is bounded by that, and 40 probes a second is nothing
+ # next to an auto-analysis that runs for minutes.
+ #
+ # Do NOT be tempted to hold the 5ms rate instead. This poll runs on a
+ # background thread while the UI thread is drawing, and 200 wakeups a
+ # second through a cold analysis cost enough GIL time to delay the
+ # app's own startup -- it left the loading overlay up long enough for
+ # project mode's first keypress to land on it.
delay = 0.005
- fast_until = t0 + 5.0
while time.time() < deadline:
try:
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
@@ -142,8 +146,7 @@ class WorkerClient:
progress(f"auto-analyzing {os.path.basename(self._bin)}… "
f"({int(time.time() - t0)}s)")
time.sleep(delay)
- if time.time() > fast_until:
- delay = min(delay * 1.6, 0.2)
+ delay = min(delay * 1.6, 0.025)
raise IDAConnectionError("worker did not become ready in time")
@property