Skip to content

Update explainer.md (stage 2)#96

Open
m-alkalbani wants to merge 1 commit intomainfrom
m-alkalbani-explainer-2
Open

Update explainer.md (stage 2)#96
m-alkalbani wants to merge 1 commit intomainfrom
m-alkalbani-explainer-2

Conversation

@m-alkalbani
Copy link
Contributor

As outlined in #94, added content for stage 2 of re-writing the explainer. This covers Proposed Approach (basic testing pattern and a few primer JS examples on getting started).

As outlined in #94, added content for stage 2 of re-writing the explainer. This covers Proposed Approach (basic testing pattern and a few primer JS examples on getting started).
@flyingzl flyingzl closed this Feb 26, 2026
@flyingzl flyingzl reopened this Feb 26, 2026
Copy link
Contributor

@alcooper91 alcooper91 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I was unexpectedly OOO the last three weeks. I have one minor concern with the "Next animation frame" logic being described here; relevant to some logic we do in the tests. LMK your thoughts.

1. **Connect a fake device** with the desired capabilities (session types, views, supported features, etc.).
2. **Use WebXR entry points** to obtain a session (e.g. `navigator.xr.requestSession(. . .)`).
3. **Drive device state** (viewer pose, tracking loss, bounds/floor origin, visibility state etc.).
4. **Advance one frame**, then assert on data returned by WebXR (poses, events, hit test results etc.).
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in some cases in the spec we require two frames to pass before state is guaranteed. This is because there may be a delay in getting data updated. e.g. If you submit the data update in the returned animation frame it may not take effect before the next frame has been sent to you, but it should be fixed by that following frame (e.g. an update made during frame N is only guaranteed to be present in the data for frame N+2).

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. Just to make sure I understand correctly, is this referring specifically to cases where the test state is updated from within the XR animation frame callback, so the change may then only be guaranteed in the N+2 frame?

In order to address this, would it be better to change the explainer language throughout from "wait at least one frame" to "wait for up to two frames"? I am thinking of the examples below (and future ones) which are mostly framed around asserting expected outcomes on the next frame.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I guess the comment on the code says only if it's outside of the animation frame that the update method is called, so I guess we may still want it to be the next frame? (And of course there's no guarantees for methods that return promises).

@alcooper91 alcooper91 self-requested a review March 13, 2026 22:41
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.

3 participants