From 7c1af0671809205babbb3a8d8d41a7fc4d8e182d Mon Sep 17 00:00:00 2001 From: statementreply Date: Wed, 29 Jul 2026 23:37:30 +0800 Subject: [PATCH 1/3] Set up test recipe --- azure-devops/cmake-configure-build.yml | 1 + azure-pipelines.yml | 194 +------------------------ 2 files changed, 3 insertions(+), 192 deletions(-) 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 From 52bf72e8a67fca09b4d557ab5f3a68f75a1409bd Mon Sep 17 00:00:00 2001 From: statementreply Date: Wed, 29 Jul 2026 23:38:52 +0800 Subject: [PATCH 2/3] Remove workaround to see what's failing --- tests/std/tests/P0811R3_midpoint_lerp/test.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp index dd27188f1f7..9ea23fdefa9 100644 --- a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp +++ b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp @@ -91,11 +91,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 { From f80c08ec1c6a0a37a81f9a19132bfc8b1acc0045 Mon Sep 17 00:00:00 2001 From: statementreply Date: Sun, 2 Aug 2026 14:48:35 +0800 Subject: [PATCH 3/3] Add randomized test --- .../std/tests/P0811R3_midpoint_lerp/test.cpp | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp index 9ea23fdefa9..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; @@ -1129,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(); @@ -1203,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 }