Fields

hardware None
os None

Parameters

Fields

NameValue

Parameters

NameValue
git_commit commit efa287dd8a0920b20c3fe69253d8438ec8944383
Author: Peng Liu <winner245@hotmail.com>
Date: Wed Feb 5 22:38:32 2025 -0500

[libc++] Slightly simplify max_size and add new tests for vector (#119990)

This PR slightly simplifies the implementation of `vector<bool>::max_size`
and adds extensive tests for the `max_size()` function for both `vector<bool>`
and `vector<T>`. The main purposes of the new tests include:

- Verify correctness of `max_size()` under various `size_type` and
`difference_type` definitions: check that `max_size()` works properly
with allocators that have custom `size_type` and `difference_type`. This
is particularly useful for `vector<bool>`, as different `size_type` lead
to different `__storage_type` of different word lengths, resulting in
varying `max_size()` values for `vector<bool>`. Additionally, different
`difference_type` also sets different upper limit of `max_size()` for
both `vector<bool>` and `std::vector`. These tests were previously
missing.

- Eliminate incorrect implementations: Special tests are added to identify and
reject incorrect implementations of `vector<bool>::max_size` that unconditionally
return `std::min<size_type>(size-max, __internal_cap_to_external(allocator-max-size))`.
This can cause overflow in the `__internal_cap_to_external()` call and lead
to incorrect results. The new tests ensure that such incorrect
implementations are identified.
Filter

ldionne-old-macbook-results test results

Run Order Start Time Duration
Current 526443 2025-12-16T16:40:01 0:00:00
Previous 526441 2025-12-16T16:40:01 0:00:00
Baseline 485288 2025-12-16T16:40:01 0:00:00


Tests Summary

Status Group # # (B)
Performance Regressions 1 0
Performance Improvements 2 0
Added Tests 0 18
Unchanged Tests 87 72
Total Tests 90

Performance Regressions - execution_time Δ Previous Current σ Δ (B) σ (B)
735_gem5_r 1.16% 13.770 13.929 - 0.00% -

Performance Improvements - execution_time Δ Previous Current σ Δ (B) σ (B)
721_gcc_r -3.05% 13.428 13.019 - 0.00% -
710_omnetpp_r -1.03% 8.661 8.572 - 0.00% -

Added Tests - execution_time
706_stockfish_r
707_ntest_r
709_cactus_r
710_omnetpp_r
721_gcc_r
723_llvm_r
727_cppcheck_r
729_abc_r
731_astcenc_r
734_vpr_r
735_gem5_r
736_ocio_r
737_gmsh_r
748_flightdm_r
750_sealcrypto_r
753_ns3_r
766_femflow_r
767_nest_r


Report Time: 0.06s
Name Current %
706_stockfish_r 22.052 -
707_ntest_r 17.753 -
709_cactus_r 19.772 -
710_omnetpp_r 8.572 -1.03%
721_gcc_r 13.019 -3.05%
723_llvm_r 11.569 -
727_cppcheck_r 24.748 -
729_abc_r 18.583 -
731_astcenc_r 10.030 -
734_vpr_r 15.463 -
735_gem5_r 13.929 1.16%
736_ocio_r 16.226 -
737_gmsh_r 13.029 -
748_flightdm_r 8.975 -
750_sealcrypto_r 18.432 -
753_ns3_r 10.632 -
766_femflow_r 12.816 -
767_nest_r 14.201 -
Geometric Mean 14.357 -