diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 8f324caa0f8..57a5771a6e4 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -25,6 +25,7 @@ parameters: - '--order=lexical' - '--num-shards=$(System.TotalJobsInPhase)' - '--run-shard=$(System.JobPositionInPhase)' + - '--filter=P0811R3_midpoint_lerp' steps: - task: PowerShell@2 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1979b1b2cd6..493037119b0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,160 +10,8 @@ pr: drafts: false stages: -##### Phase 1: Initial Builds ##### - - stage: Code_Format - dependsOn: [] - displayName: 'Code Format' - pool: - name: ${{ variables.x64MediumPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64MediumPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/format-validation.yml - - - stage: Build_x64 - dependsOn: [] - displayName: 'Build x64' - pool: - name: ${{ variables.x64MediumPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64MediumPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: x64 - targetArch: x64 - targetPlatform: x64 - analyzeBuild: true - buildBenchmarks: true - numShards: 1 - configureTesting: false - runTesting: false - - - stage: Build_x86 - dependsOn: [] - displayName: 'Build x86' - pool: - name: ${{ variables.x64MediumPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64MediumPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: x86 - targetArch: x86 - targetPlatform: x86 - analyzeBuild: true - buildBenchmarks: true - numShards: 1 - configureTesting: false - runTesting: false - - - stage: Build_ARM64 - dependsOn: [] - displayName: 'Build ARM64' - pool: - name: ${{ variables.arm64PoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(arm64PoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: arm64 - targetArch: arm64 - targetPlatform: arm64 - analyzeBuild: true - buildBenchmarks: true - numShards: 1 - configureTesting: false - runTesting: false - - - stage: Build_ARM64EC - dependsOn: [] - displayName: 'Build ARM64EC' - pool: - name: ${{ variables.arm64PoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(arm64PoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: arm64 - targetArch: arm64 - targetPlatform: arm64ec - analyzeBuild: true - buildBenchmarks: true - numShards: 1 - configureTesting: false - runTesting: false - - - stage: Configure_Tests - dependsOn: [] - displayName: 'Configure Tests' - pool: - name: ${{ variables.x64MediumPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64MediumPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: x64 - targetArch: x64 - targetPlatform: x64 - numShards: 1 - buildStl: false - runTesting: false - -##### Phase 2: Primary Test Architectures ##### - - stage: Test_x64 - dependsOn: - - Code_Format - - Build_x64 - - Build_x86 - - Build_ARM64 - - Build_ARM64EC - - Configure_Tests - displayName: 'Test x64' - pool: - name: ${{ variables.x64FastPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64FastPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: x64 - targetArch: x64 - targetPlatform: x64 - - stage: Test_ARM64 - dependsOn: - - Code_Format - - Build_x64 - - Build_x86 - - Build_ARM64 - - Build_ARM64EC - - Configure_Tests + dependsOn: [] displayName: 'Test ARM64' pool: name: ${{ variables.arm64PoolName }} @@ -178,42 +26,4 @@ stages: hostArch: arm64 targetArch: arm64 targetPlatform: arm64 - -##### Phase 3: Secondary Test Architectures ##### - - stage: Test_x86 - dependsOn: - - Test_x64 - - Test_ARM64 - displayName: 'Test x86' - pool: - name: ${{ variables.x64SlowPoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(x64SlowPoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: x86 - targetArch: x86 - targetPlatform: x86 - - - stage: Test_ARM64EC - dependsOn: - - Test_x64 - - Test_ARM64 - displayName: 'Test ARM64EC' - pool: - name: ${{ variables.arm64PoolName }} - demands: ${{ variables.poolDemands }} - variables: - - name: workRoot - value: '$(arm64PoolWorkRoot)' - readonly: true - jobs: - - template: azure-devops/build-and-test.yml - parameters: - hostArch: arm64 - targetArch: arm64 - targetPlatform: arm64ec + numShards: 2 diff --git a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp index dd27188f1f7..1d70cea7dbf 100644 --- a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp +++ b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include using namespace std; @@ -91,11 +92,7 @@ constexpr int fe_major_except = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW; bool check_feexcept( [[maybe_unused]] const int expected_excepts, [[maybe_unused]] const int except_mask = fe_major_except) { -#if defined(_M_ARM64) || defined(_M_ARM64EC) // TRANSITION, GH-5685 - return true; -#else // ^^^ workaround / no workaround vvv return fetestexcept(except_mask) == (expected_excepts & except_mask); -#endif // ^^^ no workaround ^^^ } #else // ^^^ defined(_M_FP_STRICT) / !defined(_M_FP_STRICT) vvv class ExceptGuard { @@ -1133,6 +1130,38 @@ constexpr bool test_gh_2112() { return true; } +#ifdef _M_FP_STRICT +template +void test_lerp_exception() { + mt19937_64 rng(20260802'064821); + uniform_int_distribution dist_ab(-1LL << 58, (1LL << 58) - 1); + uniform_int_distribution dist_t(-3LL << 52, (5LL << 52) - 1); + + for (int i = 0; i < 1'000'000; ++i) { + const long long ia = dist_ab(rng); + const long long ib = dist_ab(rng); + const long long it = dist_t(rng); + const Ty a = static_cast(_Bit_cast(ia ^ (ia >> 63)) * 0x1p+991); + const Ty b = static_cast(_Bit_cast(ib ^ (ib >> 63)) * 0x1p+991); + const Ty t = static_cast(it * 0x1p-53); + + feclearexcept(FE_ALL_EXCEPT); + const Ty result = lerp(a, b, t); + const int exceptions = fetestexcept(FE_ALL_EXCEPT); + + if ((exceptions & ~FE_INEXACT) != 0) { + constexpr int hex_precision = (numeric_limits::digits - 1 + 3) / 4; + printf(" a: %+.*a\n", hex_precision, a); + printf(" b: %+.*a\n", hex_precision, b); + printf(" t: %+.*a\n", hex_precision, t); + printf(" result: %+.*a\n", hex_precision, result); + printf("exceptions: %#x\n", exceptions); + exit(1); + } + } +} +#endif // _M_FP_STRICT + int main() { test_constants(); test_constants(); @@ -1207,4 +1236,9 @@ int main() { test_gh_1917(); test_gh_2112(); STATIC_ASSERT(test_gh_2112()); + +#ifdef _M_FP_STRICT + test_lerp_exception(); + test_lerp_exception(); +#endif // _M_FP_STRICT }