Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranges tests consuming excessive compiler memory #3567

Open
StephanTLavavej opened this issue Mar 13, 2023 · 1 comment
Open

Ranges tests consuming excessive compiler memory #3567

StephanTLavavej opened this issue Mar 13, 2023 · 1 comment
Labels
ranges C++20/23 ranges test Related to test code

Comments

@StephanTLavavej
Copy link
Member

Here's the C1XX compiler memory consumption of all tests named *ranges*, as reported by VS 2022 17.6 Preview 1 x64 /d1reportMemorySummary. There are 4 tests that exceed 2 GB of RAM, which we should investigate reducing (either by pruning their tested type combinations, or by splitting the test up into multiple parts as we've done elsewhere).

This was brought to my attention by Russell Johnston in MS; while working with EDG to investigate and fix issues for the STL (:heart_eyes_cat:), the top 3 tests here were failing due to out-of-memory errors (and presumably the others in the ~1.8 to 2.2 GB range for C1XX were perilously close to OOM for EDG). This doesn't indicate anything pathological or undesirable about what EDG is doing; we should simply avoid writing such enormously expensive tests. This is problematic even for C1XX, since it means that x86-hosted test runs (internally) run close to OOM, and multithreaded test runs can come close to swapping (e.g. I have "only" 64 GB for 32 cores).

Peak Working
Set Size (> 2 GB)
Test
3,177,598,976 P0896R4_ranges_alg_mismatch
2,631,102,464 P1659R3_ranges_alg_ends_with
2,321,670,144 P0896R4_ranges_alg_equal
2,204,807,168 P1659R3_ranges_alg_starts_with
Peak Working
Set Size (< 2 GB)
Test
1,970,331,648 P0896R4_ranges_alg_replace_copy_if
1,950,568,448 P0896R4_ranges_alg_replace_copy
1,811,857,408 P0896R4_ranges_alg_move
1,650,929,664 P0896R4_ranges_alg_transform_unary
1,642,221,568 P0896R4_ranges_alg_copy_if
1,512,505,344 P0896R4_ranges_alg_copy
1,423,818,752 P0896R4_ranges_alg_find_end
1,387,089,920 P0896R4_ranges_alg_rotate_copy
1,235,529,728 P0896R4_ranges_alg_copy_backward
1,184,952,320 P0896R4_ranges_alg_move_backward
1,157,095,424 P0896R4_ranges_alg_reverse_copy
Click to expand smaller (< 1 GB) tests:
Peak Working
Set Size (< 1 GB)
Test
928,116,736 P0896R4_ranges_alg_set_intersection
897,142,784 P1206R7_ranges_to_sequence
827,510,784 P0896R4_ranges_alg_search_n
822,951,936 P0896R4_ranges_alg_copy_n
705,875,968 P0896R4_ranges_alg_partial_sort_copy
688,574,464 P1206R7_ranges_to_settish
653,447,168 P2322R6_ranges_alg_fold
636,481,536 P0896R4_ranges_alg_remove
628,056,064 P0896R4_ranges_alg_remove_if
627,216,384 P0896R4_ranges_alg_is_sorted
593,985,536 P0896R4_ranges_alg_is_permutation
543,440,896 P0896R4_ranges_alg_partition_point
536,162,304 P2302R4_ranges_alg_contains
527,966,208 P0896R4_ranges_alg_permutations
524,115,968 P0896R4_ranges_alg_partition
516,169,728 P0896R4_ranges_ref_view
515,088,384 P0896R4_ranges_alg_nth_element
509,476,864 P2440R1_ranges_alg_shift_right
498,925,568 P0896R4_ranges_alg_find
495,144,960 P1223R5_ranges_alg_find_last_if
495,112,192 P1223R5_ranges_alg_find_last_if_not
487,632,896 P1223R5_ranges_alg_find_last
486,735,872 P0896R4_ranges_alg_find_if_not
484,347,904 P0896R4_ranges_alg_unique
480,501,760 P0896R4_ranges_alg_partial_sort
478,457,856 P0896R4_ranges_alg_find_if
472,842,240 P0896R4_ranges_alg_all_of
471,687,168 P0896R4_ranges_alg_none_of
471,687,168 P0896R4_ranges_alg_any_of
466,657,280 P1206R7_ranges_to_mappish
465,833,984 P0896R4_ranges_alg_replace_if
465,485,824 P2408R5_ranges_iterators_to_classic_algorithms
464,904,192 P0896R4_ranges_alg_replace
462,905,344 P0896R4_ranges_alg_rotate
459,644,928 P0896R4_ranges_alg_partition_copy
458,719,232 P2440R1_ranges_alg_shift_left
450,936,832 P0896R4_ranges_alg_for_each
449,986,560 P0896R4_ranges_alg_binary_search
437,530,624 P0896R4_ranges_alg_sample
431,513,600 P0896R4_ranges_alg_minmax
420,085,760 P0896R4_ranges_alg_search
406,945,792 P0896R4_ranges_alg_count
386,035,712 P0896R4_ranges_alg_count_if
381,431,808 P2278R4_ranges_const_range_machinery
358,924,288 P2440R1_ranges_numeric_iota
355,332,096 P0896R4_ranges_alg_generate
334,675,968 P0896R4_ranges_alg_reverse
333,987,840 P0896R4_ranges_range_machinery
323,301,376 P0896R4_ranges_test_machinery
315,604,992 P0896R4_ranges_alg_generate_n
281,296,896 P0896R4_ranges_alg_sort
266,866,688 P0896R4_ranges_alg_set_union
263,593,984 P0896R4_ranges_alg_set_symmetric_difference
251,592,704 P0896R4_ranges_alg_heap
247,185,408 P0896R4_ranges_alg_merge
241,840,128 P0896R4_ranges_alg_set_difference
232,374,272 P2302R4_ranges_alg_contains_subrange
227,975,168 P0896R4_ranges_iterator_machinery
220,770,304 P0896R4_ranges_subrange
210,722,816 P0896R4_ranges_alg_stable_partition
199,802,880 P0896R4_ranges_alg_includes
193,175,552 P0896R4_ranges_alg_swap_ranges
192,323,584 P0896R4_ranges_alg_inplace_merge
185,147,392 P0896R4_ranges_alg_for_each_n
182,960,128 P0896R4_ranges_alg_adjacent_find
177,213,440 P0896R4_ranges_alg_lexicographical_compare
167,768,064 P0896R4_ranges_alg_stable_sort
163,201,024 P0896R4_ranges_alg_unique_copy
157,863,936 P0896R4_ranges_alg_shuffle
136,773,632 P0896R4_ranges_alg_fill_n
135,954,432 P0896R4_ranges_alg_uninitialized_move_n
135,917,568 P0896R4_ranges_alg_uninitialized_copy_n
133,931,008 P0896R4_ranges_alg_uninitialized_move
132,952,064 P0896R4_ranges_algorithm_machinery
131,866,624 P0896R4_ranges_alg_uninitialized_copy
128,450,560 P0896R4_ranges_alg_find_first_of
127,422,464 P0896R4_ranges_alg_transform_binary
126,824,448 P0896R4_ranges_alg_uninitialized_fill
126,595,072 P1206R7_ranges_to_misc
126,210,048 P0896R4_ranges_alg_uninitialized_fill_n
125,927,424 P0896R4_ranges_alg_fill
124,760,064 P0896R4_ranges_alg_remove_copy
124,588,032 P0896R4_ranges_alg_remove_copy_if
124,166,144 P0896R4_ranges_alg_uninitialized_value_construct
124,116,992 P0896R4_ranges_alg_uninitialized_value_construct_n
123,838,464 P2278R4_ranges_const_iterator_machinery
122,580,992 P0896R4_ranges_alg_uninitialized_default_construct
122,286,080 P0896R4_ranges_alg_uninitialized_default_construct_n
111,251,456 P2609R3_relaxing_ranges_just_a_smidge
102,404,096 P0896R4_ranges_to_address
Click to expand repro incantations:
D:\GitHub\STL\out\x64>type ranges_tests.txt
P0896R4_ranges_algorithm_machinery\test.compile.pass.cpp
P0896R4_ranges_alg_adjacent_find\test.cpp
P0896R4_ranges_alg_all_of\test.cpp
P0896R4_ranges_alg_any_of\test.cpp
P0896R4_ranges_alg_binary_search\test.cpp
P0896R4_ranges_alg_copy\test.cpp
P0896R4_ranges_alg_copy_backward\test.cpp
P0896R4_ranges_alg_copy_if\test.cpp
P0896R4_ranges_alg_copy_n\test.cpp
P0896R4_ranges_alg_count\test.cpp
P0896R4_ranges_alg_count_if\test.cpp
P0896R4_ranges_alg_equal\test.cpp
P0896R4_ranges_alg_fill\test.cpp
P0896R4_ranges_alg_fill_n\test.cpp
P0896R4_ranges_alg_find\test.cpp
P0896R4_ranges_alg_find_end\test.cpp
P0896R4_ranges_alg_find_first_of\test.cpp
P0896R4_ranges_alg_find_if\test.cpp
P0896R4_ranges_alg_find_if_not\test.cpp
P0896R4_ranges_alg_for_each\test.cpp
P0896R4_ranges_alg_for_each_n\test.cpp
P0896R4_ranges_alg_generate\test.cpp
P0896R4_ranges_alg_generate_n\test.cpp
P0896R4_ranges_alg_heap\test.cpp
P0896R4_ranges_alg_includes\test.cpp
P0896R4_ranges_alg_inplace_merge\test.cpp
P0896R4_ranges_alg_is_permutation\test.cpp
P0896R4_ranges_alg_is_sorted\test.cpp
P0896R4_ranges_alg_lexicographical_compare\test.cpp
P0896R4_ranges_alg_merge\test.cpp
P0896R4_ranges_alg_minmax\test.cpp
P0896R4_ranges_alg_mismatch\test.cpp
P0896R4_ranges_alg_move\test.cpp
P0896R4_ranges_alg_move_backward\test.cpp
P0896R4_ranges_alg_none_of\test.cpp
P0896R4_ranges_alg_nth_element\test.cpp
P0896R4_ranges_alg_partial_sort\test.cpp
P0896R4_ranges_alg_partial_sort_copy\test.cpp
P0896R4_ranges_alg_partition\test.cpp
P0896R4_ranges_alg_partition_copy\test.cpp
P0896R4_ranges_alg_partition_point\test.cpp
P0896R4_ranges_alg_permutations\test.cpp
P0896R4_ranges_alg_remove\test.cpp
P0896R4_ranges_alg_remove_copy\test.cpp
P0896R4_ranges_alg_remove_copy_if\test.cpp
P0896R4_ranges_alg_remove_if\test.cpp
P0896R4_ranges_alg_replace\test.cpp
P0896R4_ranges_alg_replace_copy\test.cpp
P0896R4_ranges_alg_replace_copy_if\test.cpp
P0896R4_ranges_alg_replace_if\test.cpp
P0896R4_ranges_alg_reverse\test.cpp
P0896R4_ranges_alg_reverse_copy\test.cpp
P0896R4_ranges_alg_rotate\test.cpp
P0896R4_ranges_alg_rotate_copy\test.cpp
P0896R4_ranges_alg_sample\test.cpp
P0896R4_ranges_alg_search\test.cpp
P0896R4_ranges_alg_search_n\test.cpp
P0896R4_ranges_alg_set_difference\test.cpp
P0896R4_ranges_alg_set_intersection\test.cpp
P0896R4_ranges_alg_set_symmetric_difference\test.cpp
P0896R4_ranges_alg_set_union\test.cpp
P0896R4_ranges_alg_shuffle\test.cpp
P0896R4_ranges_alg_sort\test.cpp
P0896R4_ranges_alg_stable_partition\test.cpp
P0896R4_ranges_alg_stable_sort\test.cpp
P0896R4_ranges_alg_swap_ranges\test.cpp
P0896R4_ranges_alg_transform_binary\test.cpp
P0896R4_ranges_alg_transform_unary\test.cpp
P0896R4_ranges_alg_uninitialized_copy\test.cpp
P0896R4_ranges_alg_uninitialized_copy_n\test.cpp
P0896R4_ranges_alg_uninitialized_default_construct\test.cpp
P0896R4_ranges_alg_uninitialized_default_construct_n\test.cpp
P0896R4_ranges_alg_uninitialized_fill\test.cpp
P0896R4_ranges_alg_uninitialized_fill_n\test.cpp
P0896R4_ranges_alg_uninitialized_move\test.cpp
P0896R4_ranges_alg_uninitialized_move_n\test.cpp
P0896R4_ranges_alg_uninitialized_value_construct\test.cpp
P0896R4_ranges_alg_uninitialized_value_construct_n\test.cpp
P0896R4_ranges_alg_unique\test.cpp
P0896R4_ranges_alg_unique_copy\test.cpp
P0896R4_ranges_iterator_machinery\test.cpp
P0896R4_ranges_range_machinery\test.cpp
P0896R4_ranges_ref_view\test.cpp
P0896R4_ranges_subrange\test.compile.pass.cpp
P0896R4_ranges_test_machinery\test.compile.pass.cpp
P0896R4_ranges_to_address\test.cpp
P1206R7_ranges_to_mappish\test.cpp
P1206R7_ranges_to_misc\test.cpp
P1206R7_ranges_to_sequence\test.cpp
P1206R7_ranges_to_settish\test.cpp
P1223R5_ranges_alg_find_last\test.cpp
P1223R5_ranges_alg_find_last_if\test.cpp
P1223R5_ranges_alg_find_last_if_not\test.cpp
P1659R3_ranges_alg_ends_with\test.cpp
P1659R3_ranges_alg_starts_with\test.cpp
P2278R4_ranges_const_iterator_machinery\test.compile.pass.cpp
P2278R4_ranges_const_range_machinery\test.cpp
P2302R4_ranges_alg_contains\test.cpp
P2302R4_ranges_alg_contains_subrange\test.cpp
P2322R6_ranges_alg_fold\test.cpp
P2408R5_ranges_iterators_to_classic_algorithms\test.cpp
P2440R1_ranges_alg_shift_left\test.cpp
P2440R1_ranges_alg_shift_right\test.cpp
P2440R1_ranges_numeric_iota\test.cpp
P2609R3_relaxing_ranges_just_a_smidge\test.compile.pass.cpp

D:\GitHub\STL\out\x64>for /F %I in (ranges_tests.txt) do @(echo %I && cl /EHsc /nologo /W4 /MTd /Od /std:c++latest /I %STL%\tests\std\include %STL%\tests\std\tests\%I /bigobj /c /d1reportMemorySummary && echo -----)
@StephanTLavavej StephanTLavavej added test Related to test code ranges C++20/23 ranges labels Mar 13, 2023
@StephanTLavavej
Copy link
Member Author

Vaguely related: #1030

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
None yet
Development

No branches or pull requests

1 participant