Skip to content

tests: paint-gate re-showable menus + drain synth plays (sync audit)#31

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/node-editor-test-sync-gates
Jun 6, 2026
Merged

tests: paint-gate re-showable menus + drain synth plays (sync audit)#31
borisbat merged 1 commit into
masterfrom
bbatkin/node-editor-test-sync-gates

Conversation

@borisbat

@borisbat borisbat commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Ports the dasImgui sync-audit (dasImgui#181) to the node-editor integration suite. These tests drive the async live API (daslang-live over HTTP), so the test must explicitly wait for each effect — never lean on a poll window to absorb an in-flight synth gesture, and never gate a re-showable popup on registry existence when it should gate on actual paint.

A fleet of audit agents swept all 12 integration tests against the seven sync patterns from the dasImgui audit. The suite was already in good shape — imgui_editor_playwright's ne_* helpers gate chords on real effects, and the clipboard / groups / styling / navigation / call-forms tests are clean. The genuine gaps were concentrated in the synth-mouse and context-menu paths:

Changes

  • imgui_editor_playwright: add ne_wait_visible — the paint-gated peer of ne_wait_widget (present and rendered-this-frame). Existence-only can stale-pass on a cached menu entry before the popup repaints (the documented popup re-open race; wait_for_visible closes it). Registered in utils/node_editor2rst.das's "Polling / await" group so the docs Uncategorized-gate stays clean.
  • test_shader_graph (context_menu / new_node_drag): drain the synth right-click with wait_for_mouse_idle before the menu wait, and switch the two re-showable BG_CTX context-menu waits to ne_wait_visible.
  • test_context_menus: switch the NODE_MENU / BG_MENU item waits to ne_wait_visible (the local right_click wrapper already drains the mouse timeline).
  • test_delete_and_select: drain the synth click (wait_for_mouse_idle) and the Delete key (wait_for_key_idle) before their effect polls, instead of relying on the 6 s poll window to absorb the in-flight gesture.

Why it's safe

Pure hardening — every change adds a wait or strengthens existence→paint, never removes one. A paint-gate can only fail where the old existence-gate would also eventually fail. Confirmed widget_rendered is set for the suspended-popup menu items (the with_suspended screen-space path), so ne_wait_visible resolves for them.

Validation (local, mirrors CI)

  • Full suite green 3× headless (23/23, 4 isolated workers) — baseline before changes, twice after.
  • context_menu subtest 0.56 s → 0.85 s (the added idle+paint gates doing real work), well within budget.
  • MCP PERF/STYLE lint clean; utils/lint LINT0xx clean on all 5 changed files; formatter reports already-formatted.
  • node_editor2rst regenerated → no Uncategorized; ne_wait_visible lands in "Polling / await".

Deferred (surfaced for discussion, not in this PR)

The connect_by_drag / create_by_drag tests perform real multi-frame pin-drags via wall-clock imgui_mouse_play timelines. Unlike dasImgui's old drag() (≈1 ms press→move gap, which dt-collapsed on slow runners — fixed by frame-pacing in dasImgui#184), these use a deliberately wide ~1000 ms press→move gap (t_ms 400→1400) and have been green on all CI OSes. Frame-pacing them would be strictly more deterministic but needs dasImgui #184's frame_paced flag plus a timeline rewrite (a cross-repo dependency). Left as a follow-up.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports the dasImgui “sync-audit” hardening patterns into this repo’s node-editor integration tests, strengthening the async live-API test gating so context-menu/popup assertions wait on actual paint and synthetic input timelines are fully drained before polling for effects.

Changes:

  • Added ne_wait_visible helper to wait for {canvas}/{subpath} to be present and painted this frame (intended for re-showable popups / menu items).
  • Hardened shader-graph context-menu flows by draining the synthetic right-click timeline before waiting, and switching BG_CTX/* menu waits to paint-gated waits.
  • Hardened delete/select tutorial regression by draining synthetic mouse and key timelines before polling for selection and deletion effects.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
daslib/imgui_editor_playwright.das Adds ne_wait_visible helper (paint-gated wait) for popup/menu items.
tests/integration/test_shader_graph.das Drains synthetic right-click before menu waits; switches BG context-menu waits to ne_wait_visible.
tests/integration/test_context_menus.das Switches node/background menu waits to ne_wait_visible for re-showable popups.
tests/integration/test_delete_and_select.das Drains synthetic click and Delete key timelines before effect polling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Ports the dasImgui sync-audit (PR #181) to the node-editor integration suite.
These tests drive the async live API; the gaps were leaning on a poll window to
absorb an in-flight synth gesture, and gating re-showable popups on registry
existence rather than actual paint.

- imgui_editor_playwright: add ne_wait_visible — the paint-gated peer of
  ne_wait_widget (present AND rendered-this-frame). Existence-only can stale-pass
  on a cached menu entry before the popup repaints (the documented popup re-open
  race; wait_for_visible closes it).
- test_shader_graph (context_menu / new_node_drag): drain the synth right-click
  with wait_for_mouse_idle before the menu wait, and switch the two re-showable
  BG_CTX context-menu waits to ne_wait_visible.
- test_context_menus: switch the NODE_MENU / BG_MENU item waits to ne_wait_visible
  (the local right_click wrapper already drains the mouse timeline).
- test_delete_and_select: drain the synth click (wait_for_mouse_idle) and the
  Delete key (wait_for_key_idle) before their effect polls, instead of relying on
  the 6s poll window to absorb the in-flight gesture.

Pure hardening — every change adds a wait or strengthens existence->paint, never
removes one. Full suite green 3x headless (23/23, 4 workers); lint + format clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@borisbat borisbat force-pushed the bbatkin/node-editor-test-sync-gates branch from 8cab9d6 to bf5e368 Compare June 6, 2026 02:51
@borisbat borisbat merged commit f0afd4e into master Jun 6, 2026
6 of 7 checks 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.

2 participants