Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-status-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ">=22.2.0"
node-version: ">=23.9.0"
- name: Install Packages
run: |
npm ci
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.14 Preview 1 or later.
1. Install Visual Studio 2022 17.14 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand All @@ -160,7 +160,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.14 Preview 1 or later.
1. Install Visual Studio 2022 17.14 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand Down Expand Up @@ -379,8 +379,8 @@ steps. Let's assume we want to debug a new feature with tests located in `tests\

As always, build the STL from your branch and run the tests:
```
C:\STL\out\x64> ninja
C:\STL\out\x64> python tests\utils\stl-lit\stl-lit.py -v C:\STL\tests\std\tests\GH_XXXX_meow
C:\Dev\STL\out\x64> ninja
C:\Dev\STL\out\x64> python tests\utils\stl-lit\stl-lit.py -v C:\Dev\STL\tests\std\tests\GH_XXXX_meow
```

Let's assume one of the tests fails an assert and we want to debug that configuration. `stl-lit` will conveniently print
Expand All @@ -390,23 +390,23 @@ provide debug symbols: `/Zi /Fdbark.pdb`.
You can replace `bark` with any descriptive name you like. Add these before the `"-link"` option in the command line
and recompile. Example:
```
C:\STL\out\x64>cl "C:\STL\tests\std\tests\GH_XXXX_meow\test.cpp" [... more arguments ...]
"-FeC:\STL\out\x64\tests\std\tests\GH_XXXX_meow\Output\02\GH_XXXX_meow.exe" /Zi /Fdbark.pdb "-link"
C:\Dev\STL\out\x64>cl "C:\Dev\STL\tests\std\tests\GH_XXXX_meow\test.cpp" [... more arguments ...]
"-FeC:\Dev\STL\out\x64\tests\std\tests\GH_XXXX_meow\Output\02\GH_XXXX_meow.exe" /Zi /Fdbark.pdb "-link"
[... more arguments ...]
```

You can now start debugging the test via:
```
devenv "C:\STL\out\x64\tests\std\tests\GH_XXXX_meow\Output\02\GH_XXXX_meow.exe"
"C:\STL\tests\std\tests\GH_XXXX_meow\test.cpp"
devenv "C:\Dev\STL\out\x64\tests\std\tests\GH_XXXX_meow\Output\02\GH_XXXX_meow.exe"
"C:\Dev\STL\tests\std\tests\GH_XXXX_meow\test.cpp"
```

However, this might not work right away, as Visual Studio may complain about a missing `msvcp140_oss.dll`. The reason
is that the STL builds those and other DLLs itself and we should under no circumstances overwrite the installed ones.
If you are testing one of the configurations with dynamic linkage (`/MD` or `/MDd`) the easiest solution is to add the
build folder to your path:
```
set PATH=C:\STL\out\x64\out\bin\amd64;%PATH%
set PATH=C:\Dev\STL\out\x64\out\bin\amd64;%PATH%
```

## Running Tests With Address Sanitizer (ASan)
Expand Down
1 change: 1 addition & 0 deletions azure-devops/checkout-self.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ steps:
submodules: false
fetchDepth: 1
fetchTags: false
retryCountOnTaskFailure: 4
- script: |
git clean --quiet -x -d -f -f
displayName: 'Clean after checkout'
2 changes: 1 addition & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2025-02-15T0137-Pool'
value: 'StlBuild-2025-03-11T1203-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals false'
Expand Down
92 changes: 80 additions & 12 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ImageSku = '2025-datacenter-azure-edition'

$LogFile = '1es-hosted-pool.log'
$ProgressActivity = 'Preparing STL CI pool'
$TotalProgress = 26
$TotalProgress = 38
$CurrentProgress = 1

<#
Expand Down Expand Up @@ -103,20 +103,54 @@ $AdminPWSecure = New-Password
$Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure)

####################################################################################################
Display-ProgressBar -Status 'Creating virtual network'
Display-ProgressBar -Status 'Creating public IP address'

$PublicIpAddressName = $ResourceGroupName + '-PublicIpAddress'
$PublicIpAddress = New-AzPublicIpAddress `
-Name $PublicIpAddressName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-Sku 'Standard' `
-AllocationMethod 'Static'

####################################################################################################
Display-ProgressBar -Status 'Creating NAT gateway'

$NatGatewayName = $ResourceGroupName + '-NatGateway'
$NatGateway = New-AzNatGateway `
-Name $NatGatewayName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-IdleTimeoutInMinutes 10 `
-Sku 'Standard' `
-PublicIpAddress $PublicIpAddress

####################################################################################################
Display-ProgressBar -Status 'Creating network security group'

$NetworkSecurityGroupName = $ResourceGroupName + '-NetworkSecurity'
$NetworkSecurityGroup = New-AzNetworkSecurityGroup `
-Name $NetworkSecurityGroupName `
-ResourceGroupName $ResourceGroupName `
-Location $Location

####################################################################################################
Display-ProgressBar -Status 'Creating virtual network subnet config'

# TRANSITION, 2025-09-30: "On September 30, 2025, default outbound access for new deployments will be retired."
# https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/default-outbound-access
# We're using `-DefaultOutboundAccess $false` to opt-in early.
$SubnetName = $ResourceGroupName + '-Subnet'
$Subnet = New-AzVirtualNetworkSubnetConfig `
-Name $SubnetName `
-AddressPrefix '10.0.0.0/16' `
-DefaultOutboundAccess $false `
-NatGateway $NatGateway `
-NetworkSecurityGroup $NetworkSecurityGroup

####################################################################################################
Display-ProgressBar -Status 'Creating virtual network'

$VirtualNetworkName = $ResourceGroupName + '-Network'
$VirtualNetwork = New-AzVirtualNetwork `
-Name $VirtualNetworkName `
Expand All @@ -136,7 +170,7 @@ $Nic = New-AzNetworkInterface `
-Subnet $VirtualNetwork.Subnets[0]

####################################################################################################
Display-ProgressBar -Status 'Creating prototype VM'
Display-ProgressBar -Status 'Creating prototype VM config'

# Previously: -Priority 'Spot'
$VM = New-AzVMConfig `
Expand All @@ -145,33 +179,51 @@ $VM = New-AzVMConfig `
-DiskControllerType 'NVMe' `
-Priority 'Regular'

####################################################################################################
Display-ProgressBar -Status 'Setting prototype VM OS'

$VM = Set-AzVMOperatingSystem `
-VM $VM `
-Windows `
-ComputerName $ProtoVMName `
-Credential $Credential `
-ProvisionVMAgent

####################################################################################################
Display-ProgressBar -Status 'Adding prototype VM network interface'

$VM = Add-AzVMNetworkInterface `
-VM $VM `
-Id $Nic.Id

####################################################################################################
Display-ProgressBar -Status 'Setting prototype VM source image'

$VM = Set-AzVMSourceImage `
-VM $VM `
-PublisherName $ImagePublisher `
-Offer $ImageOffer `
-Skus $ImageSku `
-Version 'latest'

####################################################################################################
Display-ProgressBar -Status 'Setting prototype VM boot diagnostic'

$VM = Set-AzVMBootDiagnostic `
-VM $VM `
-Disable

####################################################################################################
Display-ProgressBar -Status 'Creating prototype VM'

New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-VM $VM >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Getting prototype VM OS disk name'

$VM = Get-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName
Expand Down Expand Up @@ -350,25 +402,41 @@ Remove-AzDisk `
Display-ProgressBar -Status 'Deleting unused network interface'

Remove-AzNetworkInterface `
-ResourceGroupName $ResourceGroupName `
-Name $NicName `
-Force >> $LogFile
-ResourceGroupName $ResourceGroupName `
-Name $NicName `
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused virtual network'

Remove-AzVirtualNetwork `
-ResourceGroupName $ResourceGroupName `
-Name $VirtualNetworkName `
-Force >> $LogFile
-ResourceGroupName $ResourceGroupName `
-Name $VirtualNetworkName `
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused network security group'

Remove-AzNetworkSecurityGroup `
-ResourceGroupName $ResourceGroupName `
-Name $NetworkSecurityGroupName `
-Force >> $LogFile
-ResourceGroupName $ResourceGroupName `
-Name $NetworkSecurityGroupName `
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused NAT gateway'

Remove-AzNatGateway `
-ResourceGroupName $ResourceGroupName `
-Name $NatGatewayName `
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused public IP address'

Remove-AzPublicIpAddress `
-ResourceGroupName $ResourceGroupName `
-Name $PublicIpAddressName `
-Force >> $LogFile

####################################################################################################
Write-Progress -Activity $ProgressActivity -Completed
Expand Down
10 changes: 1 addition & 9 deletions azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ $PowerShellArgs = @('/quiet', '/norestart')
$PythonUrl = 'https://www.python.org/ftp/python/3.13.2/python-3.13.2-amd64.exe'
$PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0')

# TRANSITION, GH-5282: Install only nvcc and cudart, then manually add CUDA to the PATH (see below).
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
$CudaArgs = @('-s', '-n', 'nvcc_12.4', 'cudart_12.4')
$CudaPath = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin'
$CudaArgs = @('-s', '-n')

<#
.SYNOPSIS
Expand Down Expand Up @@ -114,12 +112,6 @@ DownloadAndInstall -Name 'CUDA' -Url $CudaUrl -Args $CudaArgs

Write-Host 'Setting environment variables...'

# TRANSITION, GH-5282: Manually add CUDA to the PATH.
# Don't use $Env:PATH here - that's the local path for this running script, captured before we installed anything.
# The machine path was just updated by the installers above.
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
[Environment]::SetEnvironmentVariable('Path', "$machinePath;$CudaPath", 'Machine')

# The STL's PR/CI builds are totally unrepresentative of customer usage.
[Environment]::SetEnvironmentVariable('VSCMD_SKIP_SENDTELEMETRY', '1', 'Machine')

Expand Down
1 change: 1 addition & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ add_benchmark(iota src/iota.cpp)
add_benchmark(locale_classic src/locale_classic.cpp)
add_benchmark(minmax_element src/minmax_element.cpp)
add_benchmark(mismatch src/mismatch.cpp)
add_benchmark(move_only_function src/move_only_function.cpp)
add_benchmark(path_lexically_normal src/path_lexically_normal.cpp)
add_benchmark(priority_queue_push_range src/priority_queue_push_range.cpp)
add_benchmark(random_integer_generation src/random_integer_generation.cpp)
Expand Down
47 changes: 47 additions & 0 deletions benchmarks/src/move_only_function.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <benchmark/benchmark.h>
#include <functional>
#include <utility>

using namespace std;

void mof_none(benchmark::State& state) {
move_only_function<void()> mof;
for (auto _ : state) {
benchmark::DoNotOptimize(mof);
}
}

void mof_construct(benchmark::State& state) {
for (auto _ : state) {
move_only_function<void()> mof;
benchmark::DoNotOptimize(mof);
}
}

void mof_move(benchmark::State& state) {
move_only_function<void()> mof;
for (auto _ : state) {
benchmark::DoNotOptimize(mof);
auto moved_mof = move(mof);
benchmark::DoNotOptimize(moved_mof);
}
}

void mof_construct_and_move(benchmark::State& state) {
for (auto _ : state) {
move_only_function<void()> mof;
benchmark::DoNotOptimize(mof);
auto moved_mof = move(mof);
benchmark::DoNotOptimize(moved_mof);
}
}

BENCHMARK(mof_none);
BENCHMARK(mof_construct);
BENCHMARK(mof_move);
BENCHMARK(mof_construct_and_move);

BENCHMARK_MAIN();
7 changes: 3 additions & 4 deletions stl/inc/__msvc_bit_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ _NODISCARD constexpr int _Countl_zero_fallback(_Ty _Val) noexcept {
return static_cast<int>(_Nx) - static_cast<int>(_Val);
}

#if !defined(_M_CEE_PURE) && !defined(__CUDACC__) && !defined(__INTEL_COMPILER)
#if !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_COUNTL_ZERO_INTRINSICS 1
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _HAS_COUNTL_ZERO_INTRINSICS 0
Expand Down Expand Up @@ -179,7 +179,7 @@ _NODISCARD constexpr int _Popcount_fallback(_Ty _Val) noexcept {
}

#if ((defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))) \
&& !defined(_M_CEE_PURE) && !defined(__CUDACC__) && !defined(__INTEL_COMPILER)
&& !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_TZCNT_BSF_INTRINSICS 1
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _HAS_TZCNT_BSF_INTRINSICS 0
Expand Down Expand Up @@ -273,8 +273,7 @@ _NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept {

#endif // _HAS_TZCNT_BSF_INTRINSICS

#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \
&& !defined(__INTEL_COMPILER)
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_POPCNT_INTRINSICS 1
#if defined(__AVX__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define _POPCNT_INTRINSICS_ALWAYS_AVAILABLE 1
Expand Down
3 changes: 1 addition & 2 deletions stl/inc/__msvc_int128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ _STL_DISABLE_CLANG_WARNINGS

_STD_BEGIN

#if defined(_M_X64) && !defined(_M_ARM64EC) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \
&& !defined(__INTEL_COMPILER)
#if defined(_M_X64) && !defined(_M_ARM64EC) && !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _STL_128_INTRINSICS 1
#ifdef __clang__ // clang doesn't have _udiv128 / _div128
#define _STL_128_DIV_INTRINSICS 0
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct _Iter_traits_category4<false> {

template <class _It>
concept _Cpp17_random_delta =
#if defined(__CUDACC__) && !defined(__clang__) // TRANSITION, CUDA 12.5
#if defined(__CUDACC__) && !defined(__clang__) // TRANSITION, fixed in CUDA 12.5
totally_ordered<_It> && requires(_It __i, typename incrementable_traits<_It>::difference_type __n) {
#else // ^^^ workaround / no workaround vvv
totally_ordered<_It> && requires(_It __i, incrementable_traits<_It>::difference_type __n) {
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/__msvc_ranges_tuple_formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ class basic_format_arg {
}
};

#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-81774 (Clang), VSO-1956558 (EDG)
#if defined(__clang__) || defined(__EDG__) \
|| defined(__CUDACC__) // TRANSITION, LLVM-81774 (Clang), VSO-1956558 (EDG), VSO-2411436 (needed by CUDA 12.8.1)
basic_format_arg() noexcept : _Active_state(_Basic_format_arg_type::_None), _No_state() {}
#else // ^^^ workaround / no workaround vvv
basic_format_arg() noexcept = default;
Expand Down
Loading