Bug 97887 - Forced recalculation does not work (with OpenCL active)
Summary: Forced recalculation does not work (with OpenCL active)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium major
Assignee: Jan Holesovsky
URL:
Whiteboard: target:5.2.0 target:5.1.4
Keywords:
Depends on:
Blocks: OpenCL
  Show dependency treegraph
 
Reported: 2016-02-15 23:12 UTC by Dennis Roczek
Modified: 2016-10-25 19:03 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file created with MSO Excel 2013 (2.82 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-15 23:12 UTC, Dennis Roczek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Roczek 2016-02-15 23:12:41 UTC
Created attachment 122668 [details]
Test file created with MSO Excel 2013

Attached ods is created with MSO Excel 2013. Excel is not ODF conform and calculates for =MODE(6; 6; 4; 2; 2) a 6 (instead of the correct 2).

Hitting a formula wizard (being in cell A1) and OK does work (calculation of LibO results in 2)

Hitting instead F9, CTRL F9, or CTRL SHIFT F9 or using the menu (Data -> calculate --> recalculate) does not change the recalculation of the cell A1.


Version: 5.1.0.3
Build-ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.2; UI Render: GL; 
Gebietsschema: de-DE (de_DE)
Comment 1 Markus Mohrhard 2016-02-15 23:14:11 UTC
ScFiltersTest::testHardRecalcODS
Comment 2 m_a_riosv 2016-02-16 03:12:17 UTC
Hard recalc works for me. [Ctrl+Shift+F9]
Win10x64 Version: 5.0.5.2 (x64) Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3
Comment 3 m_a_riosv 2016-02-16 03:16:11 UTC
Hard recalc works for me. [Ctrl+Shift+F9]
Win10x64
Version: 5.1.1.1 (x64)
Build ID: c43cb650e9c145b181321ea547d38296db70f36e
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL;
Comment 4 Cor Nouws 2016-02-16 07:47:17 UTC
might be bug 97369, fixed for 5.2.0 and 5.1.1. ?
Comment 5 tagezi 2016-02-17 03:41:56 UTC
In my opinion, it does not matter that this function returns in this example. Both answers are not correct. The function must return two numbers: 2 and 6. It is the multimodal characteristic of the function.

https://en.wikipedia.org/wiki/Mode_%28statistics%29
Comment 6 Dennis Roczek 2016-02-17 15:54:12 UTC
@tagezi http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018722_715980110

"If there are more than one values with the same largest frequency, returns the smallest value." per ODF spec our handling is correct (and MS and Apple is wrong). Yes, mathematically you are right, but that is another story.

(/me will retest the behavior later with a clean profile)
Comment 7 GerardF 2016-02-17 16:24:05 UTC
(In reply to tagezi from comment #5)
> In my opinion, it does not matter that this function returns in this
> example. Both answers are not correct. The function must return two numbers:
> 2 and 6. It is the multimodal characteristic of the function.
> 
> https://en.wikipedia.org/wiki/Mode_%28statistics%29

You have MODE.MULT for this.

@ Dennis, did you had a try with OpenCL disbled ?
Comment 8 Dennis Roczek 2016-02-21 19:14:06 UTC
@GerardF good hint. Yeah, it seems that OpenCL ist not working on my Laptop. o.O

Deactivating OpenCL and recalculating results in a "2".

Is there also a blacklist for OpenCL?
Comment 9 Jan Holesovsky 2016-03-24 16:25:27 UTC
I cannot believe this is opencl-related, this sheet is too small for opencl to kick in; also I don't think there is an opencl implementation for MODE.

Dennis: The behaviour will be different if you save this sheet as .xlsx and when you save it as .ods.  In the .xlsx case, the MODE is translated to MODE.SNGL during import, and then its computation behaves like the Excel's MODE.

Obviously, when you save as .ods, no translation happens, and you'll get the LibreOffice's MODE, behaving according to the spec.

Can you please double-check that it really depends on an opencl setting?  If it does - can you please let me know what exactly you set where in the working case, and what in the non-working case?  Thank you!
Comment 10 Dennis Roczek 2016-03-27 22:02:35 UTC
Version: 5.2.0.0.alpha0+ (x64)
Build-ID: 042f16a19e3d5f884759dae71264433b988df0e6
CPU-Threats: 4; BS-Version: Windows 6.19; UI-Render: GL; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2016-03-16_10:03:38
Gebietsschema: de-DE (de_DE)

i had to deactivate opencl to open calc. It simply crashed always :-(

I guess my driver or my laptop intel card is not supported any more.

@MMeeks: what do you need from me
Comment 11 Dennis Roczek 2016-03-27 22:17:31 UTC
OpenCL platform
Name: Intel(R) OpenCL
Vendor: Intel(R) Corporation
OpenCL version: OpenCL 1.2 
Extensions: cl_intel_dx9_media_sharing cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_d3d11_sharing cl_khr_depth_images cl_khr_dx9_media_sharing cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir

  OpenCL device
   Name: Intel(R) HD Graphics 4400
   Version: OpenCL 1.2 
   Vendor: Intel(R) Corporation
   Compute Units: 20
   Driver: 10.18.15.4256


  OpenCL device
   Name: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
   Version: OpenCL 1.2 (Build 10049)
   Vendor: Intel(R) Corporation
   Compute Units: 4
   Driver: 5.2.0.10049
   Extensions: cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_dx9_media_sharing cl_intel_dx9_media_sharing cl_khr_d3d11_sharing cl_khr_gl_sharing cl_khr_fp64 


success
Comment 12 Dennis Roczek 2016-03-28 11:08:28 UTC
Ha, the application doesn't crash any longer when using the up to date driver

OpenCL platform
Name: Intel(R) OpenCL
Vendor: Intel(R) Corporation
OpenCL version: OpenCL 1.2 
Extensions: cl_intel_dx9_media_sharing cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_d3d11_sharing cl_khr_depth_images cl_khr_dx9_media_sharing cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir

  OpenCL device
   Name: Intel(R) HD Graphics 4400
   Version: OpenCL 1.2 
   Vendor: Intel(R) Corporation
   Compute Units: 20
   Driver: 20.19.15.4312


  OpenCL device
   Name: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
   Version: OpenCL 1.2 (Build 10094)
   Vendor: Intel(R) Corporation
   Compute Units: 4
   Driver: 5.2.0.10094
   Extensions: cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_dx9_media_sharing cl_intel_dx9_media_sharing cl_khr_d3d11_sharing cl_khr_gl_sharing cl_khr_fp64 


success

moreover now the test file which is linked above does recalculate correctly. I guess NOTOURBUG ?
Comment 13 Michael Meeks 2016-03-28 16:14:35 UTC
Interesting - we don't use the Intel hardware driver in this case, but the software / CPU driver - since Intel H/W can't do FP64. So the relevant software versions are:

bad:
   Driver: 5.2.0.10049
good:
   Driver: 5.2.0.10094

I guess we can up the version requirement there and black-list older Intel S/W drivers. Kendy ?
Comment 14 Dennis Roczek 2016-04-11 10:48:06 UTC
Should I also try to test following driver versions?
20.19.15.4300		4 (3%)
10.18.15.4281		1 (1%)
10.18.15.4279		14 (10%)
10.18.15.4278		4 (3%)
10.18.15.4274		5 (4%)
10.18.15.4268		1 (1%)
10.18.15.4256		21 (16%)
10.18.15.4248		12 (9%)

(taken from http://http://www.kcsoftwares.com/dumo/view.php?uid=32542457&ProductName=Intel(R) HD Graphics Family&Company=Intel&OS=10.0 a really great freeware tool to check up-to-date drivers)
Comment 15 Michael Meeks 2016-04-11 11:23:44 UTC
Hi Dennis; I think the normal approach is to black-list the old versions - we are optimistic that newer versions (post our release) will be kept compatible by the driver vendors =)
Comment 16 Commit Notification 2016-04-22 10:56:51 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4dd94c6637c503b7cf6e551a8b658a688d6a79ca

tdf#97887: add Intel driver 5.2.0.10049 to blacklist

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2016-04-22 13:24:25 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=33a4dccfa23a653b60b81e5b1882e8228f5ad5ac&h=libreoffice-5-1

tdf#97887: add Intel driver 5.2.0.10049 to blacklist

It will be available in 5.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Michael Meeks 2016-04-25 11:13:52 UTC
Black-listed; thanks ! =)