Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@StephanTLavavej
Copy link
Member

Fixes internal VSO-2431296, where P2321R2_views_adjacent is sporadically running out of memory for x86-native /analyze:only configurations. (Internal builds of the compiler have a bit more debug logic than retail builds, which is why we haven't seen these failures in our GitHub PR/CI system.)

Related:

Our stressful ranges/views tests, combined with Static Analysis's increased compiler memory consumption, interact poorly with the ABSOLUTE ABOMINATION of x86-hosted toolsets in the year 2025.

I modified #3567's incantations to find all of the tests that were consuming 3+ GB for x86-native /analyze:only, then added our usual workarounds, reducing the peak working set sizes (in bytes) to reasonable levels:

Test Before After
P0896R4_ranges_alg_copy 3,036,147,712 657,166,336
P0896R4_ranges_alg_transform_unary 3,199,823,872 695,132,160
P2321R2_views_adjacent 3,887,595,520 1,020,297,216
P2321R2_views_adjacent_transform 3,404,570,624 940,150,784
P2441R2_views_join_with 3,391,266,816 892,010,496

As usual, the workarounds are architecture-independent, since consuming tons of memory isn't great even for properly x64-hosted compilers.

I also checked the plain configurations (original recipe C1XX, not extra crispy /analyze:only). There are only a few at 2+ GB for x86-native, and none over 3 GB, so while they're still concerning, they aren't risking OOM:

Test x86-native C1XX
P2374R4_views_cartesian_product_recommended_practices 2,067,791,872
P0896R4_ranges_alg_mismatch 2,132,271,104
P2321R2_views_adjacent 2,138,755,072
P2374R4_views_cartesian_product 2,359,115,776

(Note that /analyze:only is just a variant of /analyze that skips codegen.)

This addresses all of the tests that were consuming 3+ GB for x86 /analyze:only:

Test                                 |     Before    |        After  |
-------------------------------------|--------------:|--------------:|
`P0896R4_ranges_alg_copy`            | 3,036,147,712 |   657,166,336 |
`P0896R4_ranges_alg_transform_unary` | 3,199,823,872 |   695,132,160 |
`P2321R2_views_adjacent`             | 3,887,595,520 | 1,020,297,216 |
`P2321R2_views_adjacent_transform`   | 3,404,570,624 |   940,150,784 |
`P2441R2_views_join_with`            | 3,391,266,816 |   892,010,496 |
@StephanTLavavej StephanTLavavej added test Related to test code ranges C++20/23 ranges labels Mar 31, 2025
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 31, 2025 20:36
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Mar 31, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Mar 31, 2025
@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in STL Code Reviews Mar 31, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Apr 9, 2025
@StephanTLavavej StephanTLavavej self-assigned this Apr 9, 2025
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit a3c23e1 into microsoft:main Apr 10, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Apr 10, 2025
@StephanTLavavej StephanTLavavej deleted the x86-is-an-abomination branch April 10, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ranges C++20/23 ranges test Related to test code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants