Repository navigation
fix(cursor): halve the depth-cursor margin to 0.015 eye baselines (ADR-046 A.2) - #1965
Merged
Merged
Conversation
…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
force-pushed
the
fix/cursor-margin-0015
branch
from
October 11, 2026 23:13
7a7ceac to
a4bfe39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
u_cursor_depth.h:U_CURSOR_DEPTH_DEFAULT_MARGIN0.03 → 0.015, plus comments inu_cursor_depth.{h,c}. It is the single source: the in-process runtime draw (Metal/VK/GL, and D3D11/D3D12 once feat(cursor): the runtime draws the depth cursor — D3D11 + D3D12 (ADR-046 Amendment 2 §B) #1944 lands), the zones path, feat(lift): depth-aware cursor on lifted content (ADR-046 Phase 3c) #1908's lifted-video cursor (comp_d3d11_service.cpp) and theXR_DXR_cursor_depthplacement inoxr_session.call get it fromu_cursor_depth_tuning_defaults(). A tree-wide grep found no other hard-coded 0.03 cursor margin (service,u_lift_cursor, test apps, docs). The other0.03fvalues in the tests are explicit per-call margins in geometry tests and stay as they are.XrCursorDepthOptionsDXR::marginstill overrides the default. An app that wants the old look passesmargin = 0.03.SPEC_VERSIONbump. The struct is unchanged and the margin is a default, not a contract. The spec has no rule that forces a bump, so the spec's version-history table gets a dated6 (2026-10-11)row, and §2.4 and §3 now say 0.015. The comments inXR_DXR_cursor_depth.hare updated (they mirror todisplayxr-extensions).oxr_session.c→u_cursor_depth_tuning_defaults()), so the D3D draws take 0.015 from the shared constant. feat(cursor): the runtime draws the depth cursor — D3D11 + D3D12 (ADR-046 Amendment 2 §B) #1944's new tests pass with 0.015.min(request, layout tiles), the same cap the draw loop uses), as Metal (below), GL and VK do.comp_cursor_look_win.cmakes the first mirror a process-wide one-time WARN, because INFO never reached the log file. Nothing more to change. On macOS the mirror line is already a WARN, logged once per shape change (seen in the capture run below). Linux has no mirror, so the arrow fallback logs a WARN.cursor_draw: Metal compositor drawing the cursor (…, N views)line printed the locate's view count (4) for a 2-view app. It now prints the views actually drawn (n = min(view_count, tiles)), the same as the GL and Vulkan notices.Evidence
build-tests, macOS):tests_aux_cursor_depthpasses 24521 assertions in 38 test cases.tests_aux_lift_cursorpasses 62 assertions in 7 test cases. The default-margin test now pinsU_CURSOR_DEPTH_DEFAULT_MARGINandtuning().marginto 0.015, and it checks the behaviour too: with default tuning, content at d = −0.2 gives a target of −0.215.tests_aux_cursor_depthfails 1 of 38 test cases (all 3 assertions at lines 475, 476 and 481 fail)../scripts/build_macos.shpasses.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: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.
… (default look, 8.0 mm tall, 2 view(s); …), where it said4 viewsbefore. On macOS the "default look = the current OS cursor" mirror line logs once as expected.Not tested
aux_util displayxr_mcp) passes, but it cannot build the D3D targets.u_cursor_depth_tuning_defaults(), and only the build covers them.🤖 Generated with Claude Code