Skip to content

fix(cua-driver): report Windows tree completeness - #3264

Open
ethanblake4 wants to merge 3 commits into
trycua:mainfrom
ethanblake4:windows-tree-completeness
Open

fix(cua-driver): report Windows tree completeness#3264
ethanblake4 wants to merge 3 commits into
trycua:mainfrom
ethanblake4:windows-tree-completeness

Conversation

@ethanblake4

@ethanblake4 ethanblake4 commented Aug 19, 2026

Copy link
Copy Markdown

On Windows, elements_complete is currently meaningless; it is unconditionally assigned false because the walker does not track whether it hit max_elements or max_depth.

This PR tracks whether the Windows UIA walk actually skips nodes because of max_elements, max_depth, cache-request setup, or enumeration failures, and reports elements_complete from that traversal rather than always false. Query projection does not change underlying completeness; partial MSAA and unusable trees remain conservative.

The follow-up removes the dead walk_cached compatibility shim, historical bound aliases, and an unreachable second SAL fallback branch. SAL windows already return through the earlier MSAA path.

Validation:

  • cargo fmt --all -- --check
  • git diff --check
  • contributor validation: cargo test -p platform-windows uia::tests --locked; cargo check -p cua-driver --locked; schema consistency; WPF harness query/completeness row
  • pending on current head: Windows compile/unit CI and canonical WPF harness replay

@ethanblake4
ethanblake4 marked this pull request as ready for review August 19, 2026 19:49
@ethanblake4
ethanblake4 requested a review from f-trycua as a code owner August 19, 2026 19:49
@ethanblake4
ethanblake4 marked this pull request as draft August 19, 2026 19:55
@ethanblake4
ethanblake4 marked this pull request as ready for review August 19, 2026 20:43
@injaneity

Copy link
Copy Markdown
Collaborator

looks good! just a few changes needed:

  • remove the unused walk_cached compatibility shim and its historical max_* aliases instead of adapting dead code.
  • combine the four synthetic tests into a table-driven test. the query unit test is especially weak because it tests filtering and completeness independently; the wpf test already verifies their integration. the naming is not really representative of what the tests do

Remove the dead walk_cached compatibility path and its historical max_* aliases instead of wrapping them in WalkState. Collapse the synthetic WalkState bound tests into one table-driven case; query projection stays covered by the WPF harness.
@ethanblake4

Copy link
Copy Markdown
Author

thanks @injaneity ! Addressed those issues, does the new test setup look ok?

@injaneity
injaneity self-requested a review as a code owner August 21, 2026 17:20
Co-authored-by: Zane Chee <44902825+injaneity@users.noreply.github.com>
@injaneity
injaneity force-pushed the windows-tree-completeness branch from 64abc9e to 15d7e63 Compare August 21, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants