[BUG] Assert in llvm_util.cpp validate_struct_data_layout using batched mode and LLVM 21.1.x
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu tại src/liboslexec/llvm_util.cpp, ở validate_struct_data_layout, và tái hiện assertion với chế độ batched, OIIO 2.5.18.0, LLVM 21.1.x và shader đã được báo cáo. So sánh hành vi layout của struct với LLVM 19.1.7 và kiểm tra các offset dự kiến so với các offset thực tế; hoàn tất khi cấu hình được báo cáo không còn gây ra assertion, trong khi việc xác thực layout vẫn chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Note: The prompts below are just to help you formulate a good and actionable
request. Feel free to deviate from this format or to delete this text and
write free-form if you prefer.
Describe the bug
When using OSL in batched mode eg. in GafferOSL's OSLObject, an assertion happens in validate_struct_data_layout:
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/b3c601f291a9fedf4c43f311fe7224c3b2d073ea/src/liboslexec/llvm_util.cpp#L1797
I saw the OSL_DEV definition is one mechanism to print out the values and see where it differs which I tried, however I ran into an issue where TextureOpt's envlayout is now private so that codepath doesn't quite work anymore without modification (and risk not getting the right information to debug the original issue...)
OSL version and dependencies
- OSL branch/version: tagged 1.14.8.0 and 1.14.10.0 tested
- OS: Windows 11
- C++ compiler: MSVC 14.44 (v143 toolkit with
-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) - LLVM version: 21.1.3 and 21.1.8 tested (not an issue with 19.1.7)
- OIIO version: 2.5.18.0
- Architecture: x86_64 Ryzen 7 6800M CPU (Zen3) so most likely using AVX2 in batched mode.
To Reproduce
Steps to reproduce the behavior:
- On Windows it is the combination of OIIO 2.5.18.0, LLVM 21.1.3, OSL 1.14.10.0
- For OSL it is built with:
USE_BATCHED="b8_AVX,b8_AVX2,b8_AVX2_noFMA,b8_AVX512,b8_AVX512_noFMA,b16_AVX512,b16_AVX512_noFMA"(default for Gaffer builds on Linux, not on Windows yet) - Create a basic OSLObject or something that uses batched mode.
- Assert! In
validate_struct_data_layoutcall ofliboslexec/llvm_util.cpp
Evidence
C:\dev\rpks\osl\1.14.10.0\build\osl\src\liboslexec\llvm_util.cpp:1797: void __cdecl OSL::v1_14::pvt::LLVM_Util::validate_struct_data_layout(class llvm::Type *,const class std::vector<unsigned int,class std::allocator<unsigned int> > &): Assertion 'expected_offset_by_index[index] == actual_offset' failed.
int i;
getattribute( "shading:index", i );
output1 = 0.1 * hashnoise( i );
IF YOU ALREADY HAVE A CODE FIX: Not yet but this is a fairly obscure combination mix that I don't expect someone else to reproduce easily, so I'm willing to understand things better so I can help make a fix. I can also check Linux later to see if it happens there. The big suspect is an LLVM change that has been made between 19 and 21 that's not being taken into account here somewhere.
- Ngôn ngữ chính
- C++
- Star
- 2.3k
- Fork
- 414
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AcademySoftwareFoundation/OpenShadingLanguage
-
build / testing / port / CI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2148 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2109 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
AcademySoftwareFoundation/OpenShadingLanguage#2175 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tracesets handling proposalĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
AcademySoftwareFoundation/OpenShadingLanguage#2146 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
AcademySoftwareFoundation/OpenShadingLanguage#2135 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của AcademySoftwareFoundation/OpenShadingLanguage
Issue tương tự
-
bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
isl-org/Open3D#7585 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Unconfirmed bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
luanti-org/luanti#17605 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area: config area: firmware priority: P2 - medium size: S type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Mizithra/ActiveTerrain#16 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
grumpycoders/pcsx-redux#2171 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày