Issue1158

Title Sorting SASTask components after variable reordering
Priority bug Status chatting
Superseder Nosy List gabi, jendrik, malte, mkatz, tanja
Assigned To Keywords translator
Optional summary
SASTask sorts all its components by variable number first, when created.

If reorder_variables or filter_unimportant_vars are specified, the order of 
variables might change. 

The components are not sorted again, so the outputted sas file is not sorted, as 
specified in the comments. Example gripper action (first action, prob01):

begin_operator
drop ball1 rooma left
1
0 0
2
0 3 -1 0
0 1 0 4
1
end_operator

Created on 2024-10-22.14:56:53 by mkatz, last changed by gabi.

Summary
SASTask sorts all its components by variable number first, when created.

If reorder_variables or filter_unimportant_vars are specified, the order of 
variables might change. 

The components are not sorted again, so the outputted sas file is not sorted, as 
specified in the comments. Example gripper action (first action, prob01):

begin_operator
drop ball1 rooma left
1
0 0
2
0 3 -1 0
0 1 0 4
1
end_operator
Messages
msg11710 (view) Author: malte Date: 2024-10-22.15:02:47
To add to what Michael wrote:

- This is a bug because we say it's sorted in the detailed comments in sas_tasks.py, which we also publicly reference on occasion (e.g. on Discord), primarily when people want to generate SAS+ tasks manually.

- I remember code in the search component (which may or may not still exist) that depends on conditional effects on the same variable being consecutive in the output. This is a weaker condition than the sorting we currently promise, and this might be a promise we actually hold. (It looks like we generate the sorted form, then prune and renumber variables. This destroys ordering, but not consecutiveness of effects on the same variable.)

- We can potentially resolve this in several ways, either by sorting at the end (in which case I think we can get rid of the sorting earlier) or by relaxing our specification of what the output of the translator looks like.

- This is related to the "search component should check validity of its input file" story that we considered for the last sprint. I don't know if/where the current state of this lives on the tracker.
History
Date User Action Args
2024-11-04 14:33:16gabisetnosy: + tanja
2024-11-04 14:32:12gabisetnosy: + gabi
2024-10-22 22:27:50jendriksetnosy: + jendrik
2024-10-22 15:05:45maltesetkeyword: + translator
2024-10-22 15:02:47maltesetmessages: + msg11710
2024-10-22 14:56:53mkatzcreate