MantisBT - Open CASCADE
View Issue Details
0027317Open CASCADE[OCCT] OCCT:Visualizationpublic2016-03-29 17:482016-12-09 16:37
ifv 
bugmaster 
normalminor 
closedfixed 
[OCCT] 7.0.0 
[OCCT] 7.1.0[OCCT] 7.1.0 
Not needed
0027317: Visualization - add protection against possible floating point overflows in BVH trees
Problem appears only for branch CR26329, which is dedicated to restoring floating point signals.
Tests
bugs vis bug6652, bug10702, bug26566,
v3d mesh A1 - A4, B2 - B5
have common reason:
Signal is generated in method
void BVH_BinnedBuilder<T, N, Bins>::GetSubVolumes (...), line 63:
    Standard_Integer aBinIndex = BVH::IntFloor<T> (
      (theSet->Center (anIdx, theAxis) - aMin) * anInverseStep);
because method theSet->Center(...) uses method
gp_Pnt Select3D_SensitiveSet::CenterOfGeometry() const
{
  return gp_Pnt (RealLast(), RealLast(), RealLast());
}
---
Test bugs vis bug25767 generates exeption in
OpenGl_BVHClipPrimitiveSet::Center(...)
because one of component of CornerMin or CornerMax of BndBox is FLOAT_MAX.
FLOAT_MAX is reduced coordinate of point
vpoint p2 8.4813999999999999e+102 117.1230001 128.35480981703273, which is used in test.
  
Switch to CR26329 and run tests
No tags attached.
related to 0026329closed kgv Restore floating point signals handling in DRAW 
Issue History
2016-03-29 17:48ifvNew Issue
2016-03-29 17:48ifvAssigned To => san
2016-03-29 17:48ifvRelationship addedrelated to 0026329
2016-03-31 20:59kgvAssigned Tosan => vpa
2016-03-31 20:59kgvStatusnew => assigned
2016-03-31 20:59kgvCategoryOCCT:VIS => OCCT:Visualization
2016-05-20 16:50gitNote Added: 0054256
2016-05-20 16:51vpaNote Added: 0054257
2016-05-20 16:51vpaAssigned Tovpa => kgv
2016-05-20 16:51vpaStatusassigned => resolved
2016-05-20 16:54gitNote Added: 0054258
2016-05-20 19:42gitNote Added: 0054259
2016-05-20 20:55vpaNote Added: 0054260
2016-05-20 23:04msvNote Added: 0054261
2016-05-23 12:26vpaNote Added: 0054275
2016-05-23 12:32kgvSummarySome visualisation tests failed because of exceptions generated by FP signals. => Visualization - add protection against possible floating point overflows in BVH trees
2016-05-23 12:37kgvNote Added: 0054276
2016-05-23 12:37kgvAssigned Tokgv => bugmaster
2016-05-23 12:37kgvStatusresolved => reviewed
2016-05-23 12:37kgvProduct Version => 7.0.0
2016-05-23 12:37vpaNote Edited: 0054275bug_revision_view_page.php?bugnote_id=54275#r13730
2016-05-23 14:37mkvAssigned Tobugmaster => mkv
2016-05-23 19:19mkvNote Added: 0054311
2016-05-23 19:19mkvAssigned Tomkv => vpa
2016-05-23 19:19mkvStatusreviewed => feedback
2016-05-23 19:42mkvNote Added: 0054314
2016-05-23 19:42mkvAssigned Tovpa => ifv
2016-05-24 15:38mkvAssigned Toifv => vpa
2016-05-24 17:13gitNote Added: 0054364
2016-05-24 17:14vpaNote Added: 0054365
2016-05-24 17:14vpaAssigned Tovpa => mkv
2016-05-24 17:14vpaStatusfeedback => reviewed
2016-05-25 16:14mkvNote Added: 0054400
2016-05-25 16:14mkvNote Added: 0054401
2016-05-25 16:14mkvAssigned Tomkv => vpa
2016-05-25 16:14mkvStatusreviewed => assigned
2016-05-25 16:15mkvTest case number => Not needed
2016-05-25 16:25gitNote Added: 0054403
2016-05-25 16:27kgvNote Added: 0054404
2016-05-25 16:27kgvAssigned Tovpa => bugmaster
2016-05-25 16:27kgvStatusassigned => resolved
2016-05-25 16:27kgvStatusresolved => reviewed
2016-05-25 16:28kgvNote Edited: 0054404bug_revision_view_page.php?bugnote_id=54404#r13763
2016-05-25 16:28kgvNote Edited: 0054404bug_revision_view_page.php?bugnote_id=54404#r13764
2016-05-25 16:30kgvNote Edited: 0054404bug_revision_view_page.php?bugnote_id=54404#r13765
2016-05-25 17:02mkvAssigned Tobugmaster => mkv
2016-05-26 12:25mkvNote Added: 0054434
2016-05-26 12:25mkvNote Added: 0054435
2016-05-26 12:25mkvAssigned Tomkv => bugmaster
2016-05-26 12:25mkvStatusreviewed => tested
2016-05-27 13:02bugmasterChangeset attached => occt master 41e08b4d
2016-05-27 13:02bugmasterStatustested => verified
2016-05-27 13:02bugmasterResolutionopen => fixed
2016-05-27 13:09gitNote Added: 0054469
2016-05-27 13:09gitNote Added: 0054470
2016-12-09 16:31aivStatusverified => closed
2016-12-09 16:37aivFixed in Version => 7.1.0

Notes
(0054256)
git   
2016-05-20 16:50   
Branch CR27317 has been created by vpa.

SHA-1: 9158415ed4de68bc9a3349c08e10f68971f539aa


Detailed log of new commits:

Author: vpa
Date: Fri May 20 16:45:16 2016 +0300

    0027317: Some visualisation tests failed because of exceptions generated by FP signals.
    
    - missing implementation of CenterOfGeometry method was added in MeshVS_CommonSensitiveEntity;
    - a check to prevent float overflow was added to OpenGl_BVHClipPrimitiveSet::Center.
(0054257)
vpa   
2016-05-20 16:51   
Dear Kirill,

please review patch in branch CR27317.
(0054258)
git   
2016-05-20 16:54   
Branch CR27317 has been updated forcibly by vpa.

SHA-1: 5bd100daa4827f003377cd9b6416a09c66cfab61
(0054259)
git   
2016-05-20 19:42   
Branch CR27317 has been updated forcibly by vpa.

SHA-1: a3c568d5626f750f965966980e2fa138b2ae9a09
(0054260)
vpa   
2016-05-20 20:55   
The fix for the issue includes additional check in OpenGl_BVHClipPrimitiveSet::Center method, that has negative impact on building BVH tree for frustum culling. However the difference is not sufficient - the downgrade is about 2-5% (for example, BVH build for 1000 spheres took 0.00315067160408944 secs without a patch and 0.00319643085822463 with the patch).
(0054261)
msv   
2016-05-20 23:04   
I think this check can be avoided, since you removed the source of error - implemented missing virtual method.
(0054275)
vpa   
2016-05-23 12:26   
(edited on: 2016-05-23 12:37)
Dear Mikhail,

implementation of missing virtual method resolves the issue only partially - it fixes float overflow in selection of MeshVS objects. The check is required to handle objects with huge coordinates in frustum culling (like points generated in bugs vis bug25767).

(0054276)
kgv   
2016-05-23 12:37   
Please test the patch.
(0054311)
mkv   
2016-05-23 19:19   
Dear vpa,
could you please rebase branch CR27317 on current master, there are conflict files.
(0054314)
mkv   
2016-05-23 19:42   
Dear ifv,
could you please rebase branch CR26329 (from occt git-repository) and CR26329prod on current masters, there are conflict files.
(0054364)
git   
2016-05-24 17:13   
Branch CR27317 has been updated forcibly by vpa.

SHA-1: 3630439136e1c3e8af131c405613e1b5cf6e3fcd
(0054365)
vpa   
2016-05-24 17:14   
Dear Mikhail,

please test updated patch in branch CR27317.
(0054400)
mkv   
2016-05-25 16:14   
Dear BugMaster,
Branch CR27317 from occt git-repository (and CR26329prod from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 3630439136e1c3e8af131c405613e1b5cf6e3fcd
SHA-1: f0131940f52c109f3b55f923d62a4f8ce57c71f6

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 73 (72 on master)
Windows: 5 (4 on master)
MacOS : 1137

There is new additional compilation warning on Linux platform:
http://jenkins-test-07.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/portlet/dashboard_portlet_13912/job/CR27317-CR26329prod-Products-Debian70-64-opt-compile/1/warnings17Result/package.-542137128/ [^]
QMShape_Tessellator.cxx:1738, GNU C Compiler 4 (gcc), Priority: Normal
unused variable 'tol2' [-Wunused-variable]

There are new additional compilation warnings on Windows platform:
http://jenkins-test-07.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/portlet/dashboard_portlet_13912/job/CR27317-CR26329prod-Products-Windows-64-VC10-opt-compile/1/warnings34Result/package.1690353035/ [^]
QMShape_Tessellator.cxx:1738, MSBuild, Priority: Normal
'tol2' : unreferenced local variable

Regressions/Differences/Improvements:
http://occt-tests/CR27317-CR26329prod-OCCT/Debian70-64/bugs/fclasses/bug6143.html [^]
 bugs fclasses bug6143: FAILED

http://occt-tests/CR27317-CR26329prod-OCCT/Windows-64-VC10/summary.html [^]
Improvements:
  offset with_intersect_80 J9
Failed:
  boolean volumemaker A3
  bugs modalg_4 bug6725
  bugs moddata_1 bug22759
  de step_3 D7
  mesh advanced_incmesh B2, B3, B7, C2
  mesh advanced_incmesh_parallel B2, B3, B7, C2
  mesh advanced_mesh B2, B3, B7, C2
  mesh advanced_shading B2, B3, B7
  mesh standard_incmesh B4, B8, Q1, T9, U7, W9
  mesh standard_incmesh_parallel B4, B8, Q1, T9, U7, W9
  mesh standard_mesh B4, B8, Q1, T9, U7, W9
  mesh standard_shading B8, Q1, Q6, T9, U7, W9

http://occt-tests/CR27317-CR26329prod-Products/Debian70-64/summary.html [^]
http://occt-tests/CR27317-CR26329prod-Products/Windows-64-VC10/summary.html [^]
Failed:
  bfit pnt100 A4
  bfit pnt1000 A4
  bfit pnt10000 A4
  emesh bugs bug26326_1
  emesh standard E9, F1
  omf advanced_meshcut H1, M4, Z4, Z5

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 88061436 / 89064838 [-1.13%]
Total CPU difference: 19413.140000000098 / 19269.00999999994 [+0.75%]
products component :
Total MEMORY difference: 27445735 / 27776829 [-1.19%]
Total CPU difference: 5210.629999999989 / 5173.819999999993 [+0.71%]

Testing on Windows:
occt component :
Total MEMORY difference: 54907371 / 54920247 [-0.02%]
Total CPU difference: 17821.913042298922 / 17945.824636598914 [-0.69%]
products component :
Total MEMORY difference: 18851865 / 18817135 [+0.18%]
Total CPU difference: 5005.276484899946 / 5000.222052499956 [+0.10%]

There are following differences in images found by testdiff.
http://occt-tests/CR27317-CR26329prod-OCCT/Windows-64-VC10/diff-Windows-64-VC10.html [^]
IMAGE v3d mesh B7: B7_vct1.png differs
IMAGE bugs iges bug22715_2: bug22715_2.png differs
IMAGE bugs modalg_2 bug22727: bug22727.png differs
IMAGE bugs modalg_6 bug26513: bug26513.png differs

http://occt-tests/CR27317-CR26329prod-Products/Windows-64-VC10/diff-Windows-64-VC10.html [^]
IMAGE emesh bugs bug26326_1: bug26326_1.png differs
(0054401)
mkv   
2016-05-25 16:14   
Dear vpa,
Branch CR27317 has been rejected due to:
- additional warnings
- regressions/differences/improvements
- differences in images
(0054403)
git   
2016-05-25 16:25   
Branch CR27317_1 has been created by kgv.

SHA-1: 4a715e33d95ead5b382e62e81b0dcc289ebd4483


Detailed log of new commits:

Author: vpa
Date: Fri May 20 19:42:09 2016 +0300

    0027317: Some visualisation tests failed because of exceptions generated by FP signals.
    
    - missing implementation of CenterOfGeometry method was added in MeshVS_CommonSensitiveEntity;
    - a check to prevent float overflow was added to OpenGl_BVHClipPrimitiveSet::Center.
(0054404)
kgv   
2016-05-25 16:27   
(edited on: 2016-05-25 16:30)
The main issue is solved within the patch - there are no regressions related to FPE from Visualization.
Other regressions come from the parent patch (0026329) which is not yet completed.

Please test detached patch to this bug in branch CR27317_1 (no Products) and integrate.

(0054434)
mkv   
2016-05-26 12:25   
Dear BugMaster,
Branch CR27317_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 4a715e33d95ead5b382e62e81b0dcc289ebd4483

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 72 (72 on master)
Windows: 4 (4 on master)
MacOS : 1140

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 88897952 / 89054196 [-0.18%]
Total CPU difference: 19334.590000000015 / 19271.49999999995 [+0.33%]
products component :
Total MEMORY difference: 27802632 / 27861271 [-0.21%]
Total CPU difference: 5208.509999999994 / 5214.419999999994 [-0.11%]

Testing on Windows:
occt component :
Total MEMORY difference: 55782829 / 55815545 [-0.06%]
Total CPU difference: 17929.02332889895 / 18217.047975198915 [-1.58%]
products component :
Total MEMORY difference: 18925930 / 18892847 [+0.18%]
Total CPU difference: 4997.585635599952 / 5031.9838560999515 [-0.68%]

There are no differences in images found by testdiff.
(0054435)
mkv   
2016-05-26 12:25   
Dear BugMaster,
Branch CR27317_1 is TESTED.
(0054469)
git   
2016-05-27 13:09   
Branch CR27317 has been deleted by inv.

SHA-1: 3630439136e1c3e8af131c405613e1b5cf6e3fcd
(0054470)
git   
2016-05-27 13:09   
Branch CR27317_1 has been deleted by inv.

SHA-1: 4a715e33d95ead5b382e62e81b0dcc289ebd4483