Skip to content

Commit

Permalink
OpenXR CTS 1.0.34.0 (2024-02-29)
Browse files Browse the repository at this point in the history
-   Conformance Tests
    -   Fix: Correct the warning for when Wrist Z variance is above the
        14 degree threshold. (internal MR 3043)
    -   Improvement: Code cleanup and documentation in the conformance
        layer. (internal MR 3044)
    -   Improvement: Make the conformance layer throw a distinct error
        when it encounters a handle whose creation it did not wrap.
        (internal MR 3089)
    -   Improvement: Mention in the instructions/README that the
        conformance automation extension may not be used for conformance
        submissions, and write a comment about this to the XML output
        when it is in use for easier identification. (internal MR 3143)
    -   Improvement: Reduce the maximum time allowed for transitioning
        session state in debug mode from 1 hour to 1 minute, and add a
        notice message in debug mode explaining this. (internal MR 3151)
    -   New test: Validate that XrEventDataInteractionProfileChanged is
        only queued during xrSyncActions using the conformance layer.
        (internal MR 3044, internal issue 1883, internal MR 3211)
    -   New test: “SpaceOffset” interactive test validates the results
        of calling xrLocateSpace on spaces created with a non-identity
        pose. This tests some of the same math that Interactive Throw is
        intended to test, but with automatic pass/fail detection and
        better troubleshooting assistance and debugging visualization.
        (internal MR 3058, internal issue 1855)

GitOrigin-RevId: 9488157f6ddbecc8c536ebd6ab13eaf1295a4ba4
  • Loading branch information
rpavlik committed Mar 5, 2024
1 parent d8f51ea commit 62467b1
Show file tree
Hide file tree
Showing 34 changed files with 1,032 additions and 158 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.CTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ particular, since it is primarily software, pull requests may be integrated as
they are accepted even between periodic updates. However, versions that are not
signed tags on the `approved` branch are not valid for conformance submission.

## OpenXR CTS 1.0.34.0 (2024-02-29)

- Conformance Tests
- Fix: Correct the warning for when Wrist Z variance is above the 14 degree
threshold.
([internal MR 3043](https://gitlab.khronos.org/openxr/openxr/merge_requests/3043))
- Improvement: Code cleanup and documentation in the conformance layer.
([internal MR 3044](https://gitlab.khronos.org/openxr/openxr/merge_requests/3044))
- Improvement: Make the conformance layer throw a distinct error when it
encounters a handle whose creation it did not wrap.
([internal MR 3089](https://gitlab.khronos.org/openxr/openxr/merge_requests/3089))
- Improvement: Mention in the instructions/README that the conformance automation
extension may not be used for conformance submissions, and write a comment
about this to the XML output when it is in use for easier identification.
([internal MR 3143](https://gitlab.khronos.org/openxr/openxr/merge_requests/3143))
- Improvement: Reduce the maximum time allowed for transitioning session state in
debug mode from 1 hour to 1 minute, and add a notice message in debug mode
explaining this.
([internal MR 3151](https://gitlab.khronos.org/openxr/openxr/merge_requests/3151))
- New test: Validate that `XrEventDataInteractionProfileChanged` is only queued
during xrSyncActions using the conformance layer.
([internal MR 3044](https://gitlab.khronos.org/openxr/openxr/merge_requests/3044),
[internal issue 1883](https://gitlab.khronos.org/openxr/openxr/issues/1883),
[internal MR 3211](https://gitlab.khronos.org/openxr/openxr/merge_requests/3211))
- New test: "SpaceOffset" interactive test validates the results of calling
xrLocateSpace on spaces created with a non-identity pose. This tests some of
the same math that Interactive Throw is intended to test, but with automatic
pass/fail detection and better troubleshooting assistance and debugging
visualization.
([internal MR 3058](https://gitlab.khronos.org/openxr/openxr/merge_requests/3058),
[internal issue 1855](https://gitlab.khronos.org/openxr/openxr/issues/1855))

## OpenXR CTS 1.0.33.0 (2024-01-18)

- Conformance Tests
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ Conformance Criteria

A conformance run is considered passing if all tests finish with allowed result
codes, and all warnings are acceptably explained to describe why they are not a
conformance failure. Test results are contained in the output XML files, which
conformance failure. XR_EXT_conformance_automation may not be used for conformance
submission. Test results are contained in the output XML files, which
are an extension of the common "*Unit" schema with some custom elements. Each
test case leaf section is reached by a run of its own, and is recorded with a
`testcase` tag, e.g.:
Expand Down
1 change: 0 additions & 1 deletion changes/conformance/mr.3043.gl.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/conformance/mr.3044.gl.1.md

This file was deleted.

4 changes: 0 additions & 4 deletions changes/conformance/mr.3044.gl.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/conformance/mr.3151.gl.md

This file was deleted.

4 changes: 3 additions & 1 deletion src/conformance/conformance_layer/ConformanceHooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ struct ConformanceHooks : ConformanceHooksBase
//XrResult xrDestroyInstance(XrInstance instance) override;
XrResult xrPollEvent(XrInstance instance, XrEventDataBuffer* eventData) override;

XrResult xrGetSystemProperties(XrInstance instance, XrSystemId systemId, XrSystemProperties* properties) override;

// Defined in Session.cpp
XrResult xrCreateSession(XrInstance instance, const XrSessionCreateInfo* createInfo, XrSession* session) override;
//XrResult xrDestroySession(XrSession session) override;
Expand Down Expand Up @@ -107,7 +109,6 @@ struct ConformanceHooks : ConformanceHooksBase
XrResult xrResultToString(XrInstance instance, XrResult value, char buffer[XR_MAX_RESULT_STRING_SIZE]) override;
XrResult xrStructureTypeToString(XrInstance instance, XrStructureType value, char buffer[XR_MAX_STRUCTURE_NAME_SIZE]) override;
XrResult xrGetSystem(XrInstance instance, const XrSystemGetInfo* getInfo, XrSystemId* systemId) override;
XrResult xrGetSystemProperties(XrInstance instance, XrSystemId systemId, XrSystemProperties* properties) override;
XrResult xrEnumerateEnvironmentBlendModes(XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t environmentBlendModeCapacityInput, uint32_t* environmentBlendModeCountOutput, XrEnvironmentBlendMode* environmentBlendModes) override;
XrResult xrGetReferenceSpaceBoundsRect(XrSession session, XrReferenceSpaceType referenceSpaceType, XrExtent2Df* bounds) override;
XrResult xrEnumerateViewConfigurations(XrInstance instance, XrSystemId systemId, uint32_t viewConfigurationTypeCapacityInput, uint32_t* viewConfigurationTypeCountOutput, XrViewConfigurationType* viewConfigurationTypes) override;
Expand Down Expand Up @@ -140,4 +141,5 @@ struct ConformanceHooks : ConformanceHooksBase
void checkEventPayload(const XrEventDataVisibilityMaskChangedKHR* data);
void checkEventPayload(const XrEventDataPerfSettingsEXT* data);
void checkEventPayload(const XrEventDataSpatialAnchorCreateCompleteFB* data);
void checkEventPayload(const XrEventDataUserPresenceChangedEXT* data);
};
4 changes: 2 additions & 2 deletions src/conformance/conformance_layer/HandleState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ HandleState* GetHandleState(HandleStateKey key)
std::unique_lock<std::mutex> lock(g_handleStatesMutex);
auto it = g_handleStates.find(key);
if (it == g_handleStates.end()) {
throw HandleException(std::string("Encountered unknown ") + to_string(key.second) + " handle with value " +
std::to_string(key.first));
throw HandleNotFoundException(std::string("Encountered unknown ") + to_string(key.second) + " handle with value " +
std::to_string(key.first));
}
return it->second.get();
}
7 changes: 7 additions & 0 deletions src/conformance/conformance_layer/HandleState.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ struct HandleException : public std::runtime_error
}
};

struct HandleNotFoundException : public HandleException
{
HandleNotFoundException(const std::string& message) : HandleException(message)
{
}
};

using HandleStateKey = std::pair<IntHandle, XrObjectType>;

void UnregisterHandleStateInternal(std::unique_lock<std::mutex>& lockProof, HandleStateKey key);
Expand Down
56 changes: 53 additions & 3 deletions src/conformance/conformance_layer/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ XrResult ConformanceHooks::xrPollEvent(XrInstance instance, XrEventDataBuffer* e
// caveat: it is technically possible but unlikely that an entire xrSyncActions has happened
// since this function forwarded the xrPollEvent call
session::SyncActionsState exchangeIfState = session::SyncActionsState::CALLED_SINCE_QUEUE_EXHAUST;
customSessionState->syncActionsState.compare_exchange_strong(
exchangeIfState, session::SyncActionsState::NOT_CALLED_SINCE_QUEUE_EXHAUST, //
std::memory_order::memory_order_seq_cst, std::memory_order::memory_order_seq_cst);
customSessionState->syncActionsState.compare_exchange_strong(exchangeIfState,
session::SyncActionsState::NOT_CALLED_SINCE_QUEUE_EXHAUST, //
#if __cplusplus >= 202000L
std::memory_order_seq_cst, std::memory_order_seq_cst
#else
std::memory_order::memory_order_seq_cst,
std::memory_order::memory_order_seq_cst
#endif // __cpluscplus >= 202000L
);
}
}

Expand Down Expand Up @@ -165,3 +171,47 @@ void ConformanceHooks::checkEventPayload(const XrEventDataSpatialAnchorCreateCom
(void)data;
// Event data used in gen_dispatch.cpp
}

void ConformanceHooks::checkEventPayload(const XrEventDataUserPresenceChangedEXT* data)
{
VALIDATE_EVENT_XRBOOL32(data->isUserPresent);
}

XrResult ConformanceHooks::xrGetSystemProperties(XrInstance instance, XrSystemId systemId, XrSystemProperties* properties)
{
const XrResult result = ConformanceHooksBase::xrGetSystemProperties(instance, systemId, properties);

if (result == XR_SUCCESS) {
// validate some structs?
auto nextStruct = properties->next;

ForEachExtension(properties->next, [&](const XrBaseInStructure* ext) {
switch (ext->type) {
case XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT: {
auto testStruct = reinterpret_cast<const XrSystemHandTrackingPropertiesEXT*>(ext);
// The runtime is only required to validate this if EXT_hand_tracking is enabled
// but we don't supply invalid values for this in our tests so this is a
// a reasonable thing to check here.
VALIDATE_EVENT_XRBOOL32(testStruct->supportsHandTracking);
break;
}
case XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT: {
// The runtime is only required to validate this if EXT_hand_tracking is enabled
// but we don't supply invalidate values for this in our tests so this is a
// a reasonable thing to check here.

auto testStruct = reinterpret_cast<const XrSystemUserPresencePropertiesEXT*>(ext);
// The runtime is only required to validate this if EXT_user_presence is enabled
// but we don't supply invalid values for this in the tests so this is a
// a reasonable thing to check here.
VALIDATE_EVENT_XRBOOL32(testStruct->supportsUserPresence);
break;
}
default:
break;
}
});
}

return result;
}
8 changes: 7 additions & 1 deletion src/conformance/conformance_layer/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ namespace session
session::CustomSessionState* const customSessionState = GetCustomSessionState(interactionProfileChanged->session);
// Cannot clear here because you may have gotten several of these events queued.
// Not very useful, but the spec doesn't forbid it.
session::SyncActionsState syncActionsState = customSessionState->syncActionsState.load(std::memory_order::memory_order_seq_cst);
session::SyncActionsState syncActionsState = customSessionState->syncActionsState.load(
#if __cplusplus >= 202000L
std::memory_order_seq_cst
#else
std::memory_order::memory_order_seq_cst
#endif // __cpluscplus >= 202000L
);
if (syncActionsState == SyncActionsState::NOT_CALLED_SINCE_QUEUE_EXHAUST) {
conformanceHooks->ConformanceFailure(
XR_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, "xrPollEvent",
Expand Down
3 changes: 2 additions & 1 deletion src/conformance/conformance_test/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ Conformance Criteria

A conformance run is considered passing if all tests finish with allowed result
codes, and all warnings are acceptably explained to describe why they are not a
conformance failure. Test results are contained in the output XML files, which
conformance failure. XR_EXT_conformance_automation may not be used for conformance
submission. Test results are contained in the output XML files, which
are an extension of the common "*Unit" schema with some custom elements. Each
test case leaf section is reached by a run of its own, and is recorded with a
`testcase` tag, e.g.:
Expand Down
53 changes: 8 additions & 45 deletions src/conformance/conformance_test/test_InteractiveThrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "common/xr_linear.h"
#include "composition_utils.h"
#include "conformance_framework.h"
#include "utilities/ballistics.h"
#include "utilities/throw_helpers.h"
#include "utilities/utils.h"

Expand Down Expand Up @@ -150,14 +151,7 @@ namespace Conformance
throwSpaces.push_back(std::move(handThrowSpaces));
}

struct ThrownCube
{
XrSpaceVelocity velocity; // Velocity of space that was captured when a throw happened.
XrPosef pose;
XrTime updateTime;
XrTime createTime;
};
std::vector<ThrownCube> thrownCubes;
std::vector<BodyInMotion> thrownCubes;

// Three fixed cubes which must be reached by the thrown cubes to pass the test.
std::vector<XrVector3f> targetCubes{{-1, -1, -3.0f}, {1, -1, -4.0f}, {0, 1.0f, -5.0f}};
Expand Down Expand Up @@ -202,39 +196,8 @@ namespace Conformance
++it;
}

// Apply velocities to thrown cubes.
auto simulateThrownCubeAtTime = [](ThrownCube& thrownCube, XrTime predictedDisplayTime) {
const XrDuration timeSinceLastTick = predictedDisplayTime - thrownCube.updateTime;
CHECK_MSG(timeSinceLastTick > 0, "Unexpected old frame state predictedDisplayTime or future action state lastChangeTime");
thrownCube.updateTime = predictedDisplayTime;

const float secondSinceLastTick = timeSinceLastTick / (float)1'000'000'000;

// Apply gravity to velocity.
thrownCube.velocity.linearVelocity.y += -9.8f * secondSinceLastTick;

// Apply velocity to position.
XrVector3f deltaVelocity;
XrVector3f_Scale(&deltaVelocity, &thrownCube.velocity.linearVelocity, secondSinceLastTick);
XrVector3f_Add(&thrownCube.pose.position, &thrownCube.pose.position, &deltaVelocity);

// Convert angular velocity to quaternion with the appropriate amount of rotation for the delta time.
XrQuaternionf angularRotation;
{
const float radiansPerSecond = XrVector3f_Length(&thrownCube.velocity.angularVelocity);
XrVector3f angularAxis = thrownCube.velocity.angularVelocity;
XrVector3f_Normalize(&angularAxis);
XrQuaternionf_CreateFromAxisAngle(&angularRotation, &angularAxis, radiansPerSecond * secondSinceLastTick);
}

// Update the orientation given the computed angular rotation.
XrQuaternionf newOrientation;
XrQuaternionf_Multiply(&newOrientation, &thrownCube.pose.orientation, &angularRotation);
thrownCube.pose.orientation = newOrientation;
};

for (ThrownCube& thrownCube : thrownCubes) {
simulateThrownCubeAtTime(thrownCube, frameState.predictedDisplayTime);
for (BodyInMotion& thrownCube : thrownCubes) {
thrownCube.doSimulationStep({0.f, -9.8f, 0.f}, frameState.predictedDisplayTime);
cubes.push_back({thrownCube.pose, activateCubeScale});

// Remove any target cubes which are hit by the thrown cube.
Expand Down Expand Up @@ -279,11 +242,11 @@ namespace Conformance
// Draw an instantaneous indication of the linear & angular velocity
if (spaceVelocity.velocityFlags & XR_SPACE_VELOCITY_LINEAR_VALID_BIT) {
auto gnomonTime = frameState.predictedDisplayTime;
ThrownCube gnomon{spaceVelocity, spaceLocation.pose, gnomonTime, gnomonTime};
BodyInMotion gnomon{spaceVelocity, spaceLocation.pose, gnomonTime, gnomonTime};
for (int step = 1; step < 20; ++step) {
auto predictedDisplayTimeAtStep =
frameState.predictedDisplayTime + step * frameState.predictedDisplayPeriod;
simulateThrownCubeAtTime(gnomon, predictedDisplayTimeAtStep);
gnomon.doSimulationStep({0.f, -9.8f, 0.f}, predictedDisplayTimeAtStep);
meshes.push_back(MeshDrawable{gnomonMesh, gnomon.pose, gnomonScale});
}
}
Expand All @@ -299,8 +262,8 @@ namespace Conformance
releaseSpaceLocation.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT &&
releaseSpaceVelocity.velocityFlags & XR_SPACE_VELOCITY_ANGULAR_VALID_BIT &&
releaseSpaceVelocity.velocityFlags & XR_SPACE_VELOCITY_LINEAR_VALID_BIT) {
thrownCubes.emplace_back(ThrownCube{releaseSpaceVelocity, releaseSpaceLocation.pose,
boolState.lastChangeTime, boolState.lastChangeTime});
thrownCubes.emplace_back(BodyInMotion{releaseSpaceVelocity, releaseSpaceLocation.pose,
boolState.lastChangeTime, boolState.lastChangeTime});
}
}
}
Expand Down
Loading

0 comments on commit 62467b1

Please sign in to comment.