[BUG] Assert in llvm_util.cpp validate_struct_data_layout using batched mode and LLVM 21.1.x
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza en src/liboslexec/llvm_util.cpp, en validate_struct_data_layout, y reproduce la aserción con el modo batched, OIIO 2.5.18.0, LLVM 21.1.x y el shader indicado. Compara el comportamiento del layout de la struct con LLVM 19.1.7 e inspecciona los offsets esperados frente a los reales; se considera terminado cuando la configuración indicada ya no provoca una aserción y la validación del layout sigue siendo correcta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 2.3k
- Forks
- 415
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 14
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AcademySoftwareFoundation/OpenShadingLanguage
-
build / testing / port / CI
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2148 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2109 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
AcademySoftwareFoundation/OpenShadingLanguage#2175 ·
Los mantenedores suelen responder en 1 día
-
Tracesets handling proposalAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
AcademySoftwareFoundation/OpenShadingLanguage#2146 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
AcademySoftwareFoundation/OpenShadingLanguage#2135 ·
Los mantenedores suelen responder en 1 día
Todos los issues de AcademySoftwareFoundation/OpenShadingLanguage
Issues similares
-
WaterHeaterManagement: tank_percent feature reports wrong feature id (FeatureMap corruption)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
espressif/esp-matter#1867 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
cuAmpcorParameter.cpp (CPU pycuampcor) does not compile with libc++: EXIT_FAILURE is undeclaredAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
isce-framework/isce3#387 ·
-
[request] opencv/5.0.0Abiertoupstream update
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
conan-io/conan-center-index#31055 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día