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

[DEV-master-smart_holder] Bake smart_holder functionality into class_ and type_caster_base #5213

Closed
wants to merge 155 commits into from

Commits on Jun 29, 2024

  1. Configuration menu
    Copy the full SHA
    8b0b377 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ced85c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e590748 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    97a3a49 View commit details
    Browse the repository at this point in the history
  5. fix build failure by introducing init_instance() specialization for s…

    …mart_holder (test fails)
    rwgk committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    00a9157 View commit details
    Browse the repository at this point in the history
  6. Bring smart_holder init_instance_for_type<> directly into the init_in…

    …stance() specialization. Also bring in dynamic_raw_ptr_cast_if_possible.h. Does not build because try_initialization_using_shared_from_this() is still missing.
    rwgk committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    fbf88cb View commit details
    Browse the repository at this point in the history
  7. Also bring in try_initialization_using_shared_from_this() from smart_…

    …holder_type_casters.h. With this test_wip builds and succeeds.
    rwgk committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    144ae8b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9a88c09 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a1e312e View commit details
    Browse the repository at this point in the history
  10. Comment out or skip: with this test_factory_constructors passes.

    skip-checks: true
    rwgk committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    bcc3b87 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    33b0b38 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2024

  1. Bring in pybind11/detail/class.h, init.h as-is from smart_holder bran…

    …ch (does not build).
    rwgk committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    dfaa49b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    03e6a93 View commit details
    Browse the repository at this point in the history
  3. pybind11/detail/init.h: replace type_uses_smart_holder_type_caster<> …

    …with is_same<Holder<Class>, smart_holder> (still does not build).
    rwgk committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    e8cd429 View commit details
    Browse the repository at this point in the history
  4. Bring in smart_holder_from_unique_ptr(), smart_holder_from_shared_ptr…

    …() from smart_holder_type_casters.h (with this test_wip builds and runs successfully).
    rwgk committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    381fdc5 View commit details
    Browse the repository at this point in the history
  5. Remove all (3) BAKEIN_BREAK from test_factory_constructors.cpp and al…

    …l (4) BAKEIN_BREAK from test_factory_constructors.py (test_factory_constructors builds and runs successfully).
    rwgk committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    8fe75ff View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c6a917e View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    e4d0a55 View commit details
    Browse the repository at this point in the history
  2. Copy-paste-and-specialize copyable_holder_caster<shared_ptr>, move_on…

    …ly_holder_caster<unique_ptr>. No functional changes.
    rwgk committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    5518e01 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6ff547e View commit details
    Browse the repository at this point in the history
  4. Start pybind11/detail/smart_holder_type_caster_support.h, move unique…

    …_ptr_to_python() there, add smart_holder_from_unique_ptr()
    rwgk committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    ae08f51 View commit details
    Browse the repository at this point in the history
  5. Add pytest.skip("BAKEIN_BREAK: ...") in test_smart_ptr.py (all non-sk…

    …ipped tests pass locally with C++17).
    rwgk committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    8254d77 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Configuration menu
    Copy the full SHA
    7de474f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b0cfeec View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6c227c7 View commit details
    Browse the repository at this point in the history
  4. test_class.cpp: transfer CHECK_SMART_HOLDER from smart_holder branch …

    …(replaces BAKEIN_BREAK).
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    6b89ca0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    107bcf9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9e3cdf7 View commit details
    Browse the repository at this point in the history
  7. Insert PYBIND11_SMART_HOLDER_PADDING (with the idea to catch undefine…

    …d behavior sooner rather than later).
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    c92b4d8 View commit details
    Browse the repository at this point in the history
  8. Remove all BAKEIN_BREAK in test_pickling.cpp,py (tests pass without a…

    …ny production code changes).
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    f84be2e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    66a775e View commit details
    Browse the repository at this point in the history
  10. Bring in tests/test_class_sh_basic.cpp,py from smart_holder branch as…

    …-is (does not build).
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    b6171bc View commit details
    Browse the repository at this point in the history
  11. Add no-op pybind11/smart_holder.h, 21 BAKEIN_BREAK in test_class_sh_b…

    …asic.cpp, 26 BAKEIN_BREAK in test_class_sh_basic.py
    
    ```
    ========================================================= short test summary info ==========================================================
    SKIPPED [1] test_class_sh_basic.py:59: got empty parameter set ('pass_f', 'rtrn_f', 'expected'), function test_load_with_rtrn_f at /usr/local/google/home/rwgk/forked/pybind11/tests/test_class_sh_basic.py:58
    SKIPPED [1] test_class_sh_basic.py:70: got empty parameter set ('pass_f', 'rtrn_f', 'regex_expected'), function test_deleter_roundtrip at /usr/local/google/home/rwgk/forked/pybind11/tests/test_class_sh_basic.py:69
    SKIPPED [1] test_class_sh_basic.py:99: got empty parameter set ('pass_f', 'rtrn_f', 'expected'), function test_pass_unique_ptr_disowns at /usr/local/google/home/rwgk/forked/pybind11/tests/test_class_sh_basic.py:98
    SKIPPED [1] test_class_sh_basic.py:120: got empty parameter set ('pass_f', 'rtrn_f'), function test_cannot_disown_use_count_ne_1 at /usr/local/google/home/rwgk/forked/pybind11/tests/test_class_sh_basic.py:119
    SKIPPED [1] test_class_sh_basic.py:145: BAKEIN_BREAK: AttributeError unique_ptr_roundtrip
    SKIPPED [1] test_class_sh_basic.py:157: unconditional skip
    SKIPPED [1] test_class_sh_basic.py:169: got empty parameter set ('pass_f', 'rtrn_f', 'moved_out', 'moved_in'), function test_unique_ptr_consumer_roundtrip at /usr/local/google/home/rwgk/forked/pybind11/tests/test_class_sh_basic.py:168
    SKIPPED [1] test_class_sh_basic.py:210: BAKEIN_BREAK: AttributeError args_unique_ptr
    ====================================================== 17 passed, 8 skipped in 0.04s =======================================================```
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    12b0130 View commit details
    Browse the repository at this point in the history
  12. Fix oversights: Add pybind11/smart_holder.h in CMakeLists.txt, tests/…

    …extra_python_package/test_files.py
    rwgk committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a332fe8 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. Fix rtrn_shmp, rtrn_shmp by transferring `smart_holder_from_share…

    …d_ptr()` functionality from smart_holder branch.
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    7a6d30c View commit details
    Browse the repository at this point in the history
  2. Add smart_holder_from_unique_ptr() specialization for `std::unique_…

    …ptr<T const, D>`
    
    Enables removing:
    4 BAKEIN_BREAK in test_class_sh_basic.cpp
    2 BAKEIN_BREAK in test_class_sh_basic.py
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    5957133 View commit details
    Browse the repository at this point in the history
  3. Add smart_holder_from_shared_ptr() specialization for `std::shared_…

    …ptr<T const>`
    
    Resolves one `// BAKEIN_WIP: Better Const2Mutbl`.
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    556f28a View commit details
    Browse the repository at this point in the history
  4. copyable_holder_caster<type, std::shared_ptr<type>>: split `load_va…

    …lue_shared_ptr()`, `load_value_smart_holder()` (the latter just throws right now)
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    17c0354 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2837df1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fc5678b View commit details
    Browse the repository at this point in the history
  7. Resolve clang-tidy errors:

    ```
    /__w/pybind11/pybind11/include/pybind11/cast.h:918:44: error: std::move of the variable 'v_h' of the trivially-copyable type 'pybind11::detail::value_and_holder' has no effect [performance-move-const-arg,-warnings-as-errors]
                return load_value_smart_holder(std::move(v_h));
                                               ^
    /__w/pybind11/pybind11/include/pybind11/cast.h:911:53: note: consider changing the 1st parameter of 'load_value_smart_holder' from 'pybind11::detail::value_and_holder &&' to 'const pybind11::detail::value_and_holder &'
        bool load_value_smart_holder(value_and_holder &&v_h) {
                                                        ^
    /__w/pybind11/pybind11/include/pybind11/cast.h:920:38: error: std::move of the variable 'v_h' of the trivially-copyable type 'pybind11::detail::value_and_holder' has no effect [performance-move-const-arg,-warnings-as-errors]
            return load_value_shared_ptr(std::move(v_h));
                                         ^
    /__w/pybind11/pybind11/include/pybind11/cast.h:895:51: note: consider changing the 1st parameter of 'load_value_shared_ptr' from 'pybind11::detail::value_and_holder &&' to 'const pybind11::detail::value_and_holder &'
        bool load_value_shared_ptr(value_and_holder &&v_h) {
                                                      ^
    ```
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    af66246 View commit details
    Browse the repository at this point in the history
  8. Implement operator std::shared_ptr<type> &(), remove 2 BAKEIN_BREAK…

    …: pass_shmp, pass_shcp
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    224e934 View commit details
    Browse the repository at this point in the history
  9. move_only_holder_caster<type, std::unique_ptr<T, D>>: inherit from …

    …`type_caster_base<T>`
    
    CRUDE INTERMEDIATE STATE, just to see if this builds on all platforms.
    rwgk committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    d4fc392 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2024

  1. Configuration menu
    Copy the full SHA
    391d772 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0eb23f2 View commit details
    Browse the repository at this point in the history
  3. Implement operator std::unique_ptr<type, deleter>(). Resolves all b…

    …ut 1 block of 4 BAKEIN_BREAK in test_class_sh_basic.py
    rwgk committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    ebbe066 View commit details
    Browse the repository at this point in the history
  4. Add cast(const std::unique_ptr<type, deleter> &, ...). Remove the l…

    …ast 3 remaining BAKEIN_BREAK in test_class_sh_basic.cpp
    rwgk committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    874f69d View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Configuration menu
    Copy the full SHA
    66fb5c9 View commit details
    Browse the repository at this point in the history
  2. move_only_holder_caster<...unique_ptr...>::load_value(): throw in…

    …stead of `return false` (i.e. prefer noisy failure over potentially silent failure).
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    fd1afdb View commit details
    Browse the repository at this point in the history
  3. Check for Python instance is uninitialized/disowned in type_caster_ba…

    …se.h. CRUDE intermediate state, needs refactoring.
    
    All 4 remaining BAKEIN_BREAK removed from test_class_sh_basic.py. With that both test_class_sh_basic.cpp and test_class_sh_basic.py are identical to the smart_holder branch.
    
    All unit tests pass ASAN and MSAN testing with the Google-internal toolchain.
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    0b7a628 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    12c0eb3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e593589 View commit details
    Browse the repository at this point in the history
  6. Factor out smart_holder_value_and_holder_support.h to avoid code dupl…

    …ication.
    
    All unit tests pass ASAN and MSAN testing with the Google-internal toolchain.
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    c84dacc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    46ab14e View commit details
    Browse the repository at this point in the history
  8. Bring in tests/test_class_sh_factory_constructors.cpp,py from smart_h…

    …older branch as-is (tests pass without any further changes).
    
    All unit tests pass ASAN and MSAN testing with the Google-internal toolchain.
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    470a765 View commit details
    Browse the repository at this point in the history
  9. Bring in all tests/test_class_*.cpp,py from smart_holder branch as-is…

    … that pass without any further changes.
    
    All unit tests pass ASAN and MSAN testing with the Google-internal toolchain.
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    d9d9611 View commit details
    Browse the repository at this point in the history
  10. Bring in tests/test_class_sh_shared_ptr_copy_move.cpp,py from smart_h…

    …older branch as-is (does not build).
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    4ce1524 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    fcc868d View commit details
    Browse the repository at this point in the history
  12. Add more test_class_sh_* in tests/CMakeLists.txt

    All unit tests pass ASAN and MSAN testing with the Google-internal toolchain.
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    288442c View commit details
    Browse the repository at this point in the history
  13. Bring in tests/test_class_sh_mi_thunks.cpp,py from smart_holder branc…

    …h as-is (Segmentation fault).
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    25c8edf View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    3466ce5 View commit details
    Browse the repository at this point in the history
  15. Bring in tests/test_class_sh_disowning_mi.cpp,py from smart_holder br…

    …anch as-is (AssertionError).
    rwgk committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    7173a3a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    34b8d36 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    2180dd4 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2024

  1. Inline smart_holder_type_caster_support, trampoline_self_life_support…

    … in type_caster_base.h: the organization of the existing code makes it very difficult to factor the added code properly.
    rwgk committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    70ba91f View commit details
    Browse the repository at this point in the history
  2. WIP

    rwgk committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    af467ea View commit details
    Browse the repository at this point in the history
  3. throw from convert_type() to expose bug.

    ```
    ========================================================= short test summary info ==========================================================
    SKIPPED [4] test_class_sh_disowning_mi.py:67: BAKEIN_BREAK: AssertionError
    SKIPPED [2] test_class_sh_disowning_mi.py:43: BAKEIN_BREAK: AssertionError
    SKIPPED [2] test_class_sh_disowning_mi.py:54: BAKEIN_BREAK: AssertionError
    SKIPPED [1] test_class_sh_basic.py:156: unconditional skip
    SKIPPED [6] test_class_sh_mi_thunks.py:34: BAKEIN_BREAK: Segmentation fault
    SKIPPED [2] test_class_sh_mi_thunks.py:43: BAKEIN_BREAK: AssertionError
    SKIPPED [1] test_class_sh_mi_thunks.py:51: BAKEIN_BREAK: Failed: DID NOT RAISE <class 'ValueError'>
    SKIPPED [1] test_stl.py:149: no <experimental/optional>
    SKIPPED [1] test_smart_ptr.py:301: BAKEIN_EXPECTED: Failed: DID NOT RAISE <class 'RuntimeError'>
    FAILED test_class_sh_basic.py::test_load_with_mtxt[pass_shmp-Shmp-pass_shmp:Shmp(_MvCtor)*_MvCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_b - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_unique_ptr_consumer_roundtrip[pass_valu-rtrn_lref-True-False] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_cannot_disown_use_count_ne_1[pass_udcp-rtrn_udcp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_unique_ptr_roundtrip - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_unique_ptr_consumer_roundtrip[pass_valu-rtrn_cref-True-False] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_load_with_mtxt[pass_uqmp-Uqmp-pass_uqmp:Uqmp(_MvCtor)*_MvCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_load_with_mtxt[pass_uqcp-Uqcp-pass_uqcp:Uqcp(_MvCtor)*_MvCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_load_with_rtrn_f[pass_udmp-rtrn_udmp-pass_udmp:rtrn_udmp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_load_with_rtrn_f[pass_udcp-rtrn_udcp-pass_udcp:rtrn_udcp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_deleter_roundtrip[pass_udcp_del-rtrn_udcp_del-pass_udcp_del:rtrn_udcp_del,udcp_deleter(_MvCtorTo)*_MvCtorTo] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_deleter_roundtrip[pass_udmp_del_nd-rtrn_udmp_del_nd-pass_udmp_del_nd:rtrn_udmp_del_nd,udmp_deleter_nd(_MvCtorTo)*_MvCtorTo] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_deleter_roundtrip[pass_udcp_del_nd-rtrn_udcp_del_nd-pass_udcp_del_nd:rtrn_udcp_del_nd,udcp_deleter_nd(_MvCtorTo)*_MvCtorTo] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning.py::test_same_twice - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning.py::test_mixed - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning.py::test_overloaded - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_pass_unique_ptr_disowns[pass_udmp-rtrn_udmp-pass_udmp:rtrn_udmp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_pass_unique_ptr_disowns[pass_udcp-rtrn_udcp-pass_udcp:rtrn_udcp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_cannot_disown_use_count_ne_1[pass_uqmp-rtrn_uqmp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_cannot_disown_use_count_ne_1[pass_uqcp-rtrn_uqcp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_unique_ptr_consumer_roundtrip[pass_valu-rtrn_valu-True-True] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_pass_unique_ptr_disowns[pass_uqmp-rtrn_uqmp-pass_uqmp:rtrn_uqmp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base1_first[MI1-1-2-None] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_pure_cpp_sft_raw_ptr[make_pure_cpp_sft_unq_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_pure_cpp_sft_raw_ptr[make_pure_cpp_sft_shd_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_basic.py::test_drvd0_add_in_cpp_unique_ptr - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_basic.py::test_drvd1_add_in_cpp_unique_ptr - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_self_life_support.py::test_m_big5 - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_self_life_support.py::test_py_big5[0-Seed_CpCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_virtual_py_cpp_mix.py::test_get_from_cpp_unique_ptr[Base-5101] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_virtual_py_cpp_mix.py::test_get_from_cpp_unique_ptr[PyBase-5323] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2_first[MI1-1-2-None] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2_first[MI2-3-4-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2_first[MI3-5-6-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2_first[MI4-7-8-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_inheritance.py::test_rtrn_shmp_drvd_pass_shcp_base - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_inheritance.py::test_rtrn_shmp_drvd_up_cast_pass_shcp_drvd - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_std_make_shared_factory - AssertionError: assert 'BEAKIN_WIP: ...ype() called.' == 'smart_holder...ed_from_this.'
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_shared_ptr_cpp_arg - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_shared_ptr_cpp_prop - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_shared_ptr_arg_identity - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2[MI6-12-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2[MI7-13-4] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2[MI8-14-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2[MI8b-15-3] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_multiple_registered_instances_for_same_pointee - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_multiple_registered_instances_for_same_pointee_leak - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_virtual_py_cpp_mix.py::test_get_from_cpp_unique_ptr[CppDerivedPlain-5202] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_virtual_py_cpp_mix.py::test_get_from_cpp_unique_ptr[CppDerived-5212] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_stash_leak - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_stash_via_shared_from_this - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_stash_via_shared_from_this_leak - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_pass_released_shared_ptr_as_unique_ptr - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_shared_ptr_goaway - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_infinite - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_std_make_shared_factory[pass_through_shd_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_std_make_shared_factory[pass_through_shd_ptr_release_gil] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_unique_ptr.py::test_m_clone_and_foo - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_unique_ptr_member.py::test_pointee_and_ptr_owner[give_up_ownership_via_unique_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_self_life_support.py::test_py_big5[2-Seed_OpEqLv] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_self_life_support.py::test_py_big5[3-Seed_OpEqRv] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_shared_from_this - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_shared_from_this_leak - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_load_with_mtxt[pass_shcp-Shcp-pass_shcp:Shcp(_MvCtor)*_MvCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base1_first[MI2-3-4-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_unique_ptr_consumer_roundtrip[pass_rref-rtrn_valu-True-True] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base1_first[MI3-5-6-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base1_first[MI4-7-8-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_pass_unique_ptr_disowns[pass_uqcp-rtrn_uqcp-pass_uqcp:rtrn_uqcp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_cannot_disown_use_count_ne_1[pass_udmp-rtrn_udmp] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_unique_ptr.py::test_m_clone - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base2_first[MI5-10-11-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_self_life_support.py::test_py_big5[1-Seed_MvCtor] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_multiple_registered_instances_for_same_pointee_recursive - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_virtual_py_cpp_mix.py::test_get_from_cpp_unique_ptr[PyCppDerived-5434] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_basic.py::test_drvd0_add_in_cpp_shared_ptr - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_release_and_stash - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_basic.py::test_deleter_roundtrip[pass_udmp_del-rtrn_udmp_del-pass_udmp_del:rtrn_udmp_del,udmp_deleter(_MvCtorTo)*_MvCtorTo] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_unique_ptr_member.py::test_pointee_and_ptr_owner[give_up_ownership_via_shared_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_from_this.py::test_pure_cpp_sft_raw_ptr[make_pure_cpp_sft_raw_ptr] - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_shared_ptr_alias_nonpython - RuntimeError: BEAKIN_WIP: convert_type() called.
    FAILED test_class_sh_disowning_mi.py::test_disown_base1_first[MI5-10-11-1] - RuntimeError: BEAKIN_WIP: convert_type() called.
    ================================================ 82 failed, 939 passed, 20 skipped in 4.02s ================================================
    ```
    rwgk committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    4114e97 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b201eec View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eb15f1a View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2024

  1. MESSY but success for: test_get_vec_size_raw_shared[get_drvd_as_base0…

    …_raw_ptr-vec_size_base0_shared_ptr]
    
    scons -j 48 selected_test_cpp=test_class_sh_mi_thunks.cpp && "$(cat PYROOT)"/bin/python3 $HOME/clone/pybind11_scons/run_tests.py ../pybind11 test_class_sh_mi_thunks.py -s -vv -k 'test_get_vec_size_raw_shared[get_drvd_as_base0_raw_ptr-vec_size_base0_shared_ptr]'
    
    ```
    =========================================================== test session starts ============================================================
    platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.5.0 -- /usr/bin/python3
    cachedir: .pytest_cache
    C++ Info: 13.2.0 C++20 __pybind11_internals_v10000000_gcc_libstdcpp_cxxabi1018__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False PYBIND11_NUMPY_1_ONLY=False
    rootdir: /usr/local/google/home/rwgk/forked/pybind11/tests
    configfile: pytest.ini
    plugins: xdist-3.5.0
    collected 10 items / 9 deselected / 1 selected
    
    test_class_sh_mi_thunks.py::test_get_vec_size_raw_shared[get_drvd_as_base0_raw_ptr-vec_size_base0_shared_ptr]
    LOOOK A
    
    LOOOK get raw drvd 47927280
    
    LOOOK get raw base 47927312
    
    LOOOK B
    
    LOOOK shd load(src, convert) X
    
    LOOOK shd try_implicit_casts(src, convert) Q
    
    LOOOK shd try_implicit_casts(src, convert) R
    
    LOOOK shd load(src, convert) X
    
    LOOOK shd load_value(v_h) ENTRY
    
    LOOOK shd load_value(v_h) A
    
    LOOOK shd load_value(v_h) B
    
    LOOOK shd load(src, convert) Y 47927280
    
    LOOOK shd try_implicit_casts(src, convert) S
    
    LOOOK shd load(src, convert) Y 47927312
    
    LOOOK operator std::shared_ptr<type> & A 47927312 /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/detail/../cast.h:891
    
    LOOOK /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/detail/../detail/type_caster_base.h:838
    
    LOOOK /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/detail/../detail/type_caster_base.h:842
    
    LOOOK operator std::shared_ptr<type> & B 47927312 /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/detail/../cast.h:893
    
    LOOOK shd const Base0 *obj 47927312
    
    LOOOK shd const auto *obj_der 47927280
    
    LOOOK C
    PASSED
    
    ===================================================== 1 passed, 9 deselected in 0.01s ======================================================
    ```
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    bb6b429 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1fbc4a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    103666a View commit details
    Browse the repository at this point in the history
  4. Pass thunk-corrected pointer to loaded_as_unique_ptr(). With this all…

    … test_class_sh_mi_thunks tests pass.
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    042ea81 View commit details
    Browse the repository at this point in the history
  5. Remove pytest.skip("BAKEIN_BREAK: ...") in test_class_sh_disowning_…

    …mi.py (tests pass without any further changes).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    1158dbc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bd37d69 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    011c795 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    56019a2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b82892a View commit details
    Browse the repository at this point in the history
  10. Add pytest.skip("BAKEIN_BREAK: ...) in test_class_sh_shared_ptr_cop…

    …y_move.py `test_properties()` (appears to fail on ~17 platforms).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    89c58c4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7fc2ef4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f1f0eef View commit details
    Browse the repository at this point in the history
  13. Move pytest.skip("BAKEIN_BREAK: ...) in test_class_sh_shared_ptr_co…

    …py_move.py to top level (still appears to fail on ~17 platforms).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    c453013 View commit details
    Browse the repository at this point in the history
  14. Bring in tests/test_class_sh_property.cpp,py from smart_holder branch…

    … as-is (does not build).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    c7bd78c View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    b89ec00 View commit details
    Browse the repository at this point in the history
  16. Bring in tests/test_class_sh_property_non_owning.cpp,py from smart_ho…

    …lder branch as-is (does not build).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    f52456e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    ac055a4 View commit details
    Browse the repository at this point in the history
  18. Bring in tests/test_classh_mock.cpp,py from smart_holder branch as-is…

    … (tests pass without any further changes).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    9e3bee0 View commit details
    Browse the repository at this point in the history
  19. Bring in tests/*class_sh_module_local* from smart_holder branch as-is…

    … (tests pass without any further changes).
    rwgk committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    68c9d13 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    91d4003 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. test_class_sh_property_non_owning.py appears to cause memory corrupti…

    …on leading to failures in test_class_sh_shared_ptr_copy_move.py:
    
    * Disable all tests in test_class_sh_property_non_owning.py
    
    * Disable only `test_properties()` in test_class_sh_shared_ptr_copy_move.py
    
    * Go back to original .github/workflows/ci.yml
    rwgk committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    cc86fb3 View commit details
    Browse the repository at this point in the history
  2. Add two pytest.skip("BAKEIN_BREAK: Segmentation fault") in test_cla…

    …ss_sh_shared_ptr_copy_move.py (suspected (!) holder mismatch).
    rwgk committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    3ddfc58 View commit details
    Browse the repository at this point in the history
  3. Add two more pytest.skip("BAKEIN_BREAK: Segmentation fault") in tes…

    …t_class_sh_shared_ptr_copy_move.py
    rwgk committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    625c88b View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Configuration menu
    Copy the full SHA
    0296d33 View commit details
    Browse the repository at this point in the history
  2. SegFault 20.04 C++11 MinSizeRel all tests, but only first pass after …

    …git clean -fdx
    
    NO SegFault 20.04 C++11 Debug all tests, even in first pass after git clean -fdx
    BUT then suddenly SegFaults not reproducible anymore even with MinSizeRel!?
    
    Current thread 0x00007f6c7165e740 (most recent call first):
      File "/mounted_pybind11/tests/test_class_sh_shared_ptr_copy_move.py", line 9 in test_shptr_copy
    
    line 9:
        lst = m.test_ShPtr_copy()
    
    This line was added after last observed SegFault
        del mth
    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    752626d View commit details
    Browse the repository at this point in the history
  3. pytest.skip() right before m.disown_b(...) in test_class_sh_property_…

    …non_owning.py. Remove pytest.skip() in test_class_sh_shared_ptr_copy_move.py and test_class_sh_property_non_owning.py
    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    5a4442f View commit details
    Browse the repository at this point in the history
  4. Pull in from smart_holder branch: Additional assert is_disowned() i…

    …n test_class_sh_disowning.py (pybind#5234)
    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    c0f5078 View commit details
    Browse the repository at this point in the history
  5. Transfer test_mixed from test_class_sh_disowning to test_wip (prepara…

    …tion for debugging behavior difference).
    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    c527814 View commit details
    Browse the repository at this point in the history
  6. LOOOK to trace disowning

    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    36bbac1 View commit details
    Browse the repository at this point in the history
  7. Call new load_helper.get_void_ptr_or_nullptr() instead of calling typ…

    …e_caster_generic::load_value() in shared_ptr and unique_ptr casters.
    rwgk committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    c6a87e8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e254264 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5759190 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. Reducing 1.

    rwgk committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    1ea3855 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d3537e4 View commit details
    Browse the repository at this point in the history
  3. test_ccccccccccccccccccccc

    rwgk committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    7e1eced View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f855283 View commit details
    Browse the repository at this point in the history
  5. Replace loaded_v_h.type = get_type_info(typeid(type)) with `loaded_…

    …v_h.type = typeinfo` in `unique_ptr` `type_caster` and remove `pytest.skip()` in test_class_sh_disowning_mi.py
    rwgk committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    127058c View commit details
    Browse the repository at this point in the history
  6. Copy code property_cpp_function<> code from smart_holder branch as-…

    …is. Ifdef out all but the "classic" implementation.
    rwgk committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    f852cf5 View commit details
    Browse the repository at this point in the history
  7. First pass adapting all property_cpp_function<> implementations. St…

    …ill needs debugging and more testing:
    
    ```
    ========================================================= short test summary info ==========================================================
    SKIPPED [2] test_class_sh_property.py:19: BAKEIN_BREAK: Failed: DID NOT RAISE <class 'ValueError'>
    SKIPPED [1] test_class_sh_property.py:87: BAKEIN_BREAK: m_uqcp_readwrite does not build
    SKIPPED [1] test_class_sh_property.py:140: BAKEIN_BREAK: m_uqmp_readwrite does not build
    SKIPPED [1] test_class_sh_property.py:140: BAKEIN_BREAK: m_uqcp_readwrite does not build
    SKIPPED [1] test_class_sh_basic.py:156: unconditional skip
    SKIPPED [1] test_class_sh_property.py:87: BAKEIN_BREAK: m_uqmp_readwrite does not build
    SKIPPED [1] test_stl.py:149: no <experimental/optional>
    SKIPPED [1] test_smart_ptr.py:301: BAKEIN_EXPECTED: Failed: DID NOT RAISE <class 'RuntimeError'>
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_rw-expected1-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_rw-expected1-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_ro-expected0-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_ro-expected4-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_ro-expected4-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_rw-expected5-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_ro-expected0-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_rw-expected5-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    ================================================ 8 failed, 1056 passed, 9 skipped in 3.96s =================================================
    ```
    rwgk committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    1bcf572 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Bring in shared_ptr_with_responsible_parent() from smart_holder bra…

    …nch:
    
    smart_holder branch:
    
    ```
        static std::shared_ptr<type> shared_ptr_from_python(handle responsible_parent)
    ```
    
    Renamed in this commit:
    
    ```
        static std::shared_ptr<type> shared_ptr_with_responsible_parent(handle responsible_parent)
    ```
    
    Use in `property_cpp_function<>` specializations.
    
    Fixes all 8 test failures introduced with the previous commit (1bcf572):
    
    ```
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_ro-expected0-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_rw-expected1-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_rw-expected1-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_ro-expected4-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_ro-expected4-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_rw-expected5-True] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_value_ro-expected0-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    FAILED test_class_sh_property_non_owning.py::test_core_fld_common[core_fld_raw_ptr_rw-expected5-False] - RuntimeError: Non-owning holder (loaded_as_shared_ptr).
    ```
    rwgk committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    048e36d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b14d5b View commit details
    Browse the repository at this point in the history
  3. Remove remaining BAKEIN_BREAK in test_class_sh_property.cpp,py and ad…

    …just (simplify) the `property_cpp_function<...unique_ptr...>::write` implementation (all tests pass).
    
    This PR (pybind#5213) at this commit also passes ASAN, MSAN, UBSAN testing with the Google-internal toolchain.
    rwgk committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    d373a08 View commit details
    Browse the repository at this point in the history
  4. Bring in default_holder_type from smart_holder branch including usi…

    …ng it in pybind11/stl_bind.h
    rwgk committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    63044cc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d021bb1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    092d236 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2024

  1. PYBIND11_HAVE_HOLDER_CASTER_WITH_SMART_HOLDER_SUPPORT

    Introduce two helper types:
    
    * copyable_holder_caster_shared_ptr_with_smart_holder_support_enabled
    
    * move_only_holder_caster_unique_ptr_with_smart_holder_support_enabled
    rwgk committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    6fa0a2e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2600bb6 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2024

  1. Configuration menu
    Copy the full SHA
    3406be6 View commit details
    Browse the repository at this point in the history
  2. Systematically use is_base_of<type_caster_generic, make_caster<D>>

    …in `property_cpp_function<>` specializations.
    rwgk committed Jul 14, 2024
    Configuration menu
    Copy the full SHA
    c65d5df View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    89da1e2 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. Introduce detail::both_t_and_d_use_type_caster_base<T, D> helper an…

    …d use systematically in all `property_cpp_function<>` specializations.
    
    This fixes a PyTorch build error (using the Google-internal toolchain):
    
    ```
    In file included from third_party/py/torch/torch/csrc/distributed/c10d/init.cpp:15:
    In file included from third_party/py/torch/torch/csrc/distributed/c10d/PyProcessGroup.hpp:4:
    In file included from third_party/py/torch/torch/csrc/jit/python/pybind_utils.h:7:
    In file included from third_party/pybind11/include/pybind11/complex.h:14:
    In file included from third_party/pybind11/include/pybind11/pybind11.h:14:
    In file included from third_party/pybind11/include/pybind11/detail/class.h:14:
    In file included from third_party/pybind11/include/pybind11/detail/../attr.h:16:
    third_party/pybind11/include/pybind11/detail/../cast.h:856:19: error: static assertion failed due to requirement 'std::is_base_of<pybind11::detail::type_caster_base<c10::intrusive_ptr<c10d::Store, c10::detail::intrusive_target_default_null_type<c10d::Store>>>, pybind11::detail::type_caster<c10::intrusive_ptr<c10d::Store, c10::detail::intrusive_target_default_null_type<c10d::Store>>, void>>::value': Holder classes are only supported for custom types
      856 |     static_assert(std::is_base_of<base, type_caster<type>>::value,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    third_party/pybind11/include/pybind11/detail/../cast.h:982:48: note: in instantiation of template class 'pybind11::detail::copyable_holder_caster<c10::intrusive_ptr<c10d::Store>, std::shared_ptr<c10::intrusive_ptr<c10d::Store>>>' requested here
      982 | class type_caster<std::shared_ptr<T>> : public copyable_holder_caster<T, std::shared_ptr<T>> {};
          |                                                ^
    third_party/crosstool/v18/stable/src/libcxx/include/__type_traits/is_base_of.h:22:91: note: in instantiation of template class 'pybind11::detail::type_caster<std::shared_ptr<c10::intrusive_ptr<c10d::Store>>>' requested here
       22 | struct _LIBCPP_TEMPLATE_VIS is_base_of : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
          |                                                                                           ^
    third_party/pybind11/include/pybind11/detail/../cast.h:1382:30: note: in instantiation of template class 'std::is_base_of<pybind11::detail::type_caster_generic, pybind11::detail::type_caster<std::shared_ptr<c10::intrusive_ptr<c10d::Store>>>>' requested here
     1382 |     detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>> {
          |                              ^
    third_party/pybind11/include/pybind11/pybind11.h:287:19: note: during template argument deduction for class template partial specialization 'return_value_policy_override<Return, detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>>' [with Return = std::shared_ptr<c10::intrusive_ptr<c10d::Store>>]
      287 |                 = return_value_policy_override<Return>::policy(call.func.policy);
          |                   ^
    third_party/pybind11/include/pybind11/pybind11.h:287:19: note: in instantiation of template class 'pybind11::detail::return_value_policy_override<std::shared_ptr<c10::intrusive_ptr<c10d::Store>>>' requested here
    third_party/pybind11/include/pybind11/pybind11.h:269:55: note: while substituting into a lambda expression here
      269 |         rec->impl = [](function_call &call) -> handle {
          |                                                       ^
    third_party/pybind11/include/pybind11/pybind11.h:147:9: note: in instantiation of function template specialization 'pybind11::cpp_function::initialize<(lambda at third_party/pybind11/include/pybind11/pybind11.h:1714:17), std::shared_ptr<c10::intrusive_ptr<c10d::Store>>, pybind11::handle, pybind11::is_method>' requested here
      147 |         initialize(
          |         ^
    third_party/pybind11/include/pybind11/pybind11.h:1713:20: note: in instantiation of function template specialization 'pybind11::cpp_function::cpp_function<(lambda at third_party/pybind11/include/pybind11/pybind11.h:1714:17), pybind11::is_method, void>' requested here
     1713 |             return cpp_function(
          |                    ^
    third_party/pybind11/include/pybind11/pybind11.h:1964:54: note: in instantiation of function template specialization 'pybind11::property_cpp_function<c10d::DistributedBackendOptions, c10::intrusive_ptr<c10d::Store>>::read<c10::intrusive_ptr<c10d::Store> c10d::DistributedBackendOptions::*, 0>' requested here
     1964 |                      property_cpp_function<type, D>::read(pm, *this),
          |                                                      ^
    third_party/py/torch/torch/csrc/distributed/c10d/init.cpp:945:8: note: in instantiation of function template specialization 'pybind11::class_<c10d::DistributedBackendOptions>::def_readwrite<c10d::DistributedBackendOptions, c10::intrusive_ptr<c10d::Store>>' requested here
      945 |       .def_readwrite("store", &::c10d::DistributedBackendOptions::store)
          |        ^
    1 error generated.
    ```
    rwgk committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    ff3693f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f874de View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    884305e View commit details
    Browse the repository at this point in the history
  4. smart_holder_from_unique_ptr: also accept `return_value_policy::ref…

    …erence`
    
    There are no strong reasons for accepting or rejecting `return_value_policy::reference`.
    
    Accepting to accommodate existing use cases in the wild.
    rwgk committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    12f384b View commit details
    Browse the repository at this point in the history
  5. smart_holder_from_unique_ptr: also accept `return_value_policy::tak…

    …e_ownership`
    
    There are no strong reasons for accepting or rejecting `return_value_policy::take_ownership`.
    
    Accepting to accommodate existing use cases in the wild.
    rwgk committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    ecd01da View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. Configuration menu
    Copy the full SHA
    ed27c37 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Configuration menu
    Copy the full SHA
    8ca5593 View commit details
    Browse the repository at this point in the history
  2. Factor out detail/value_and_holder.h (from detail/type_caster_base.h)

    This is in support of PR pybind#5213:
    
    * trampoline_self_life_support.h depends on value_and_holder.h
    
    * type_caster_base.h depends on trampoline_self_life_support.h
    rwgk committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    5e30064 View commit details
    Browse the repository at this point in the history
  3. Fix a minor and inconsequential inconsistency in `copyable_holder_cas…

    …ter`: the correct `load_value()` return type is `void` (as defined in `type_caster_generic`)
    
    For easy future reference, this is the long-standing inconsistency:
    
    * https://github.com/pybind/pybind11/blob/dbf848aff7c37ef8798bc9459a86193e28b1032f/include/pybind11/detail/type_caster_base.h#L634
    
    * https://github.com/pybind/pybind11/blob/dbf848aff7c37ef8798bc9459a86193e28b1032f/include/pybind11/cast.h#L797
    
    Noticed in passing while working on PR pybind#5213.
    rwgk committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    54fd559 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7fa6dd9 View commit details
    Browse the repository at this point in the history
  5. Leverage PR pybind#5251 to bring back trampoline_self_life_support.h …

    …from smart_holder branch almost as-is.
    
    This ensures IWYU correctness in client code.
    
    The only change in trampoline_self_life_support.h is to replace `#include "detail/type_caster_base.h"` with "#include detail/value_and_holder.h".
    rwgk committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    9a27e29 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1ca810e View commit details
    Browse the repository at this point in the history
  7. Add DANGER ZONE comment in detail/init.h, similar to a comment adde…

    …d on the smart_holder branch (all the way back in 2021).
    rwgk committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    92d7724 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4aa2f6b View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. Configuration menu
    Copy the full SHA
    6d8952a View commit details
    Browse the repository at this point in the history
  2. Remove overlooked BAKEIN_BREAK in test_class_sh_property_non_owning.c…

    …pp,py (tests pass without any further changes).
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    1ea1787 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cd4f5f6 View commit details
    Browse the repository at this point in the history
  4. Reinterpret detail::type_info::default_holder as "uses `std::unique…

    …_ptr` holder" (which is the original meaning, and compatible with the original smart_holder branch).
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    58a1b75 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    583c07b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7296c39 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cc2a428 View commit details
    Browse the repository at this point in the history
  8. Add back original copyable_holder_caster check_holder_compat() in…

    … the `std::shared_ptr` specialization and remove `pytest.skip("BAKEIN_EXPECTED: ...)` in test_smart_ptr.py
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    6fb8b51 View commit details
    Browse the repository at this point in the history
  9. Boilerplate changes: Skip all test_class_sh_* if PYBIND11_HAVE_INTERN…

    …ALS_WITH_SMART_HOLDER_SUPPORT is not defined.
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    95e9053 View commit details
    Browse the repository at this point in the history
  10. Ignore PYBIND11_USE_SMART_HOLDER_AS_DEFAULT if PYBIND11_HAVE_INTERNAL…

    …S_WITH_SMART_HOLDER_SUPPORT is not defined.
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    e445619 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    41433f6 View commit details
    Browse the repository at this point in the history
  12. ifdef out more code if PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPP…

    …ORT is not defined.
    rwgk committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    4a66b46 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2024

  1. Revert "Add "_sh_baked_in" to PYBIND11_INTERNALS_ID, `PYBIND11_MO…

    …DULE_LOCAL_ID`"
    
    `"_sh_baked_in"` is no longer needed because the smart_holder functionality is now tied to the `PYBIND11_INTERNALS_VERSION`.
    
    This reverts commit 884305e.
    rwgk committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    62b6c8e View commit details
    Browse the repository at this point in the history
  2. Small cleanup in detail/init.h: strip `originally_smart_holder_type_c…

    …asters_h` namespace.
    rwgk committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    35b1177 View commit details
    Browse the repository at this point in the history
  3. Move try_initialization_using_shared_from_this into `PYBIND11_HAVE_…

    …INTERNALS_WITH_SMART_HOLDER_SUPPORT` block.
    rwgk committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    5566c63 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df54a82 View commit details
    Browse the repository at this point in the history
  5. Import pybind#5256 from smart_holder branch back here (same test code…

    … as in test_class_sh_property_bakein.cpp,py).
    rwgk committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    84f71f1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9f9a698 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. Configuration menu
    Copy the full SHA
    d0003f5 View commit details
    Browse the repository at this point in the history
  2. test_class.cpp: simpler approach, leveraging new `PYBIND11_ACTUALLY_U…

    …SING_SMART_HOLDER_AS_DEFAULT`
    rwgk committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    89d0ddd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    18b72c0 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Configuration menu
    Copy the full SHA
    c4c3d9a View commit details
    Browse the repository at this point in the history