Inconsistent run-time library usage for locale handling breaks GPU code generation on some systems.
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- computer-graphics
Research direction
Start with the 12 std::to_string call sites listed in ops/fixedfunction/FixedFunctionOpGPU.cpp and ops/gradingtone/GradingToneOpGPU.cpp, then read the existing getFloatString() and FloatToString() helpers in ParseUtils.cpp. Verify the affected GPU paths under comma-decimal locales and confirm generated GLSL/HLSL uses valid, consistent decimal literals.
Written by the indexing model from the issue text.
Description
Several GPU code paths format float constants with std::to_string(), which follows the C runtime locale (LC_NUMERIC). All other float formatting in OCIO follows the C++ global locale, for example via std::ostringstream. These are independent settings, so on comma-decimal systems (e.g. fr_FR, sv_SE) the two mechanisms can produce different decimal separators in the same shader. The affected call sites emit literals such as 100 000000 instead of 100.0, while neighboring constants from getFloatString() remain correct. The resulting GLSL/HLSL fails to compile or produces incorrect output.
This is most visible with ACES 2.x fixed-function GPU paths (gamut compress / tone scale), but the same pattern exists in grading-tone GPU code.
Affected call sites (12 float std::to_string calls across 7 lines, 2 files):
ops/fixedfunction/FixedFunctionOpGPU.cpp
_Add_Focus_Gain_func(line 947)_Add_Compress_Gamut_func(line 1187)_Add_Gamut_Compress_Inv_Shader(line 1269)
ops/gradingtone/GradingToneOpGPU.cpp
Add_MidsPre_Shader(line 304)Add_SContrastTopPre_Shader(lines 1249, 1260)Add_SContrastBottomPre_Shader(line 1300)
Suggested fix: Replace std::to_string(float) with getFloatString(), or route through the existing FloatToString() helpers in ParseUtils.cpp.
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 503
- Avg merge
- 8d 3h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AcademySoftwareFoundation/OpenColorIO
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AcademySoftwareFoundation/OpenColorIO#2340 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AcademySoftwareFoundation/OpenColorIO#2329 ·
Maintainers usually reply within 4 days
-
Build failure on GCC/MinGW (MXE): std::ifstream constructor mismatch with Platform::filenameToUTF()Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AcademySoftwareFoundation/OpenColorIO#2283 ·
Maintainers usually reply within 4 days
-
Documentation
Difficulty 1/5 Under an hour Newbie friendliness 72/100
AcademySoftwareFoundation/OpenColorIO#2280 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AcademySoftwareFoundation/OpenColorIO#2277 ·
Maintainers usually reply within 4 days
All issues in AcademySoftwareFoundation/OpenColorIO
Similar issues
-
bug chart-audit
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
godotengine/godot#124120 ·
Maintainers usually reply within 1 day
-
HasBacktrace Priority-Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
azerothcore/azerothcore-wotlk#27921 ·
Maintainers usually reply within 1 day
-
area/ysql kind/bug priority/medium
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
yugabyte/yugabyte-db#34584 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day