Ticket #9781 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Argument order in Python algorithm functions not stable across OSs

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: blocker Milestone: Release 3.2
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Reuter

Description


Change History

comment:1 Changed 6 years ago by Martyn Gigg

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Martyn Gigg

  • Status changed from assigned to inprogress

Use a stable_sort to define the algorithm function property order.

This ensures that the relative ordering of equivalent values is preserved.

Refs #9781

Changeset: 419a6ed58bcbe44a25edfb0e5b4508f587698e83

comment:3 Changed 6 years ago by Martyn Gigg

  • Status changed from inprogress to verify
  • Resolution set to fixed

Branch: bugfix/9781_python_function_argument_order

Tester: Systems with gcc 4.7 onwards received a patch to std::sort, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437, that caused the order of equivalent values in the sorted list to be different to previous versions of gcc. This is acceptable in this case because the std::sort algorithm does not guarantee to preserve any ordering of equivalent values.

We should have been using a std::stable_sort all along so that the order relative order of the equivalent values would stay the same w.r.t the original list. (or found a better way of dealing with the argument ordering in the first place, but it has survived for 5.5 years!)

Unfortunately this does change the order of some of the optional arguments from what they were in v3.1 but the mandatory ones should stay the same. Our scripts and most user scripts use keyword arguments so they will be unaffected. All of the systemtests/doctests are passing so the expected order for all of those has not changed.

comment:4 Changed 6 years ago by Nick Draper

This should be tested on a system with GCC >= 4.7

comment:5 Changed 6 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:6 Changed 6 years ago by Michael Reuter

Checked Fedora 20 and RHEL6 via builds and Windows and OSX via kits and the argument ordering between them is all consistent now.

comment:7 Changed 6 years ago by Michael Reuter

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9781_python_function_argument_order'

Full changeset: da00765a814b9d23df78b2313dcaf28dc671c2df

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10623

Note: See TracTickets for help on using tickets.