Skip to content

fix(cursor): halve the depth-cursor margin to 0.015 eye baselines (ADR-046 A.2) - #1965

Merged
dfattal merged 2 commits into
mainfrom
fix/cursor-margin-0015
Oct 11, 2026
Merged

dfattal merged 2 commits into
mainfrom
fix/cursor-margin-0015

Conversation

@dfattal

@dfattal dfattal commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What

David's Windows Leia panel check: with the 0.03 default the depth cursor floats visibly in front of the content. This halves the default margin (ADR-046 Amendment 2 A.2) to 0.015 eye baselines, about 1 mm of crossed on-screen disparity at a 63–65 mm IPD instead of about 2 mm.

Evidence

  • Unit tests (build-tests, macOS): tests_aux_cursor_depth passes 24521 assertions in 38 test cases. tests_aux_lift_cursor passes 62 assertions in 7 test cases. The default-margin test now pins U_CURSOR_DEPTH_DEFAULT_MARGIN and tuning().margin to 0.015, and it checks the behaviour too: with default tuning, content at d = −0.2 gives a target of −0.215.
  • Mutant: with the default restored to 0.03, tests_aux_cursor_depth fails 1 of 38 test cases (all 3 assertions at lines 475, 476 and 481 fail).
  • ./scripts/build_macos.sh passes.
  • Headless capture, same session, both builds: SIM_DISPLAY_OUTPUT=sbs DISPLAYXR_CURSOR_DEPTH_UV=0.5,0.5 run_cube_handle_metal.sh, /tmp/dxr_atlas.png, a 1×2 atlas with 823 px tiles:
margin runtime target d arrow disparity (white-bbox left edge) arrow disparity (mean x of white pixels) cube bottom rail under the arrow (patch correlation)
0.03 (baseline rebuild) −0.066 −20 px −20.9 px −13 px
0.015 −0.051 −16 px −15.0 / −16.9 px (2 captures) −10 to −12 px

Content under the cursor is d ≈ −0.036 in both runs, so the target moves exactly by the margin change. At about 317 px per baseline in this atlas that predicts a shift of about 4.8 px toward the cube, and the arrow moved about 4–5 px. The cube rotates, so its per-capture number varies by about ±1 px.

  • In the same run the Metal one-time notice now reads … (default look, 8.0 mm tall, 2 view(s); …), where it said 4 views before. On macOS the "default look = the current OS cursor" mirror line logs once as expected.

Not tested

  • On a real panel: the Windows Leia check that motivated this was done at 0.03. Whether 0.015 reads right needs a panel eyeball.
  • D3D11/D3D12 were not run on Windows hardware. Only Windows CI (MSVC) compiles the renderer changes: the MinGW check (aux_util displayxr_mcp) passes, but it cannot build the D3D targets.
  • The D3D11 service lifted-video cursor (feat(lift): depth-aware cursor on lifted content (ADR-046 Phase 3c) #1908) and the zones path were not run. They take the same constant through u_cursor_depth_tuning_defaults(), and only the build covers them.
  • Vulkan and GL capture were not rerun. Their notices already reported the views drawn.

🤖 Generated with Claude Code

dfattal and others added 2 commits October 11, 2026 16:12
…R-046 A.2)

Panel feedback (Windows Leia): with the 0.03 default the runtime-drawn
depth cursor floats visibly off the content. Halve the default margin to
0.015 eye baselines, about 1 mm of crossed on-screen disparity at a
63-65 mm IPD instead of about 2 mm.

U_CURSOR_DEPTH_DEFAULT_MARGIN is the single source: the in-process draw
(Metal/VK/GL), the zones path, the D3D11 service's lifted-video cursor and
the XR_DXR_cursor_depth placement all take it via
u_cursor_depth_tuning_defaults(). No other hard-coded 0.03 cursor margin
exists in the tree. XrCursorDepthOptionsDXR::margin still overrides it.

No struct change, so no SPEC_VERSION bump: a history note in the spec,
the ADR-046 Amendment 2 A.2 text, and the header comments are updated.

Also: the Metal one-time "drawing the cursor" notice reported the locate's
view count (4) for a 2-view app; it now reports the views actually drawn,
matching the GL and Vulkan notices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The notice printed the request's view count; it now prints the views
actually drawn (the request capped to the layout's tiles, as the draw loop
does), the same quantity the Metal, GL and Vulkan notices report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dfattal
dfattal force-pushed the fix/cursor-margin-0015 branch from 7a7ceac to a4bfe39 Compare October 11, 2026 23:13
@dfattal
dfattal merged commit e2d1909 into main Oct 11, 2026
42 checks passed
@dfattal
dfattal deleted the fix/cursor-margin-0015 branch October 11, 2026 23:31
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