Private
Public Access
0
0
Files
manual_slop/scripts/tier2/artifacts
ed 694cfd2b70 diag(tier2): isolate the jank - _trigger_blink in render_response_panel
User asked: 'what does negative flows cause in the imgui procedural
dag graph that would cause a recursive processing of the stack?'

Tested 4 hypotheses:
1. PYTHONSTACKSIZE env var to bump main thread stack: IGNORED. Main
   thread stays at 1.94MB regardless of env var or PE header (PE
   header SizeOfStackReserve is 4TB but Windows OS uses its own
   default for the main thread commit size).
2. -X faulthandler: doesn't capture native STATUS_STACK_OVERFLOW
   (faulthandler only catches Python-level signals).
3. Editbin /STACK: editbin not installed on this system.
4. PE header patching with ctypes: SizeOfStackReserve is 4TB but the
   OS commits only 1.94MB for the main thread and Python doesn't
   honor any env var to change it.

The breakthrough: monkey-patched _handle_ai_response via sitecustomize
to disable _trigger_blink and _autofocus_response_tab. Result:

  WITHOUT _trigger_blink: process survives 60s, response event
  arrives with status='error' and correct error text. The test
  WOULD PASS.

  WITH _trigger_blink (default): process dies with 0xC00000FD
  (STATUS_STACK_OVERFLOW) within 1s of click.

The jank: in src/gui_2.py:render_response_panel (line 5537), the
_trigger_blink flag triggers imgui.set_window_focus('Response') on
the SAME frame as the response render. This native imgui call
apparently triggers imgui-bundle to do extra C++ draw work that
exhausts the main thread's 1.94MB stack.

Why negative_flows specifically: it's the ONLY tier-3 test where the
error response triggers the _trigger_blink path. Success responses
also trigger _trigger_blink but don't crash (perhaps because imgui-
bundle's layout calculations for an error overlay are heavier than
for a normal text response).

User predicted: 'i wont solve it but just pad out until failure'.
Confirmed - bumping stack didn't fix it (couldn't bump anyway, but
the prediction about recursion-related behavior is on track).

The fix (per user's framing 'needs to be guarded'): wrap the
set_window_focus call in render_response_panel in a try/except or
add a stack-depth guard before calling it. Or move the
_trigger_blink logic to a deferred frame to avoid the same-frame
race with the response render.
2026-06-17 13:22:38 -04:00
..