View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001146||OpenMPT||[All Projects] Playback Compatibility||public||2018-09-22 06:28||2019-01-24 20:18|
|Product Version||OpenMPT 1.28.00.* (old testing)|
|Target Version||OpenMPT 1.29 / libopenmpt 0.5 (goals)||Fixed in Version|
|Summary||0001146: Handle infinite loops|
libopenmpt, by default, should never enter an infinite playback loop, even if the module itself contains an infinite loop using pattern loops or pattern position jumps and pattern break to row.
|Tags||No tags attached.|
|Has the bug occurred in previous versions?|
|Tested code revision (in case you know it)|
rough sketch of a possible algorithm/implementation
commands (position jumps have implicit loop count 1, unless song has repeat-forever set, in which case they have infinite loop count), sorted in a vector for space and lookup efficiency,
memory should be pre-allocated when loading the file (or when editing in the tracker))
the algorithm guarantees termination by the following principle: the loop count for the latest (latest in song order-list + row ordering) backwards loop/jump is always strictly
monotonically descreasing, and earlier loop counts are only ever reset to their original (thus maximum) value. ordering loop counts in this order from song end to song start, interpreting
every loopcount as a digit and interpreting the concatenated number as an integer ALWAYS decreases the integer towards zero on every backward loop/jump. when it reaches 0, no further
backward loop/jump will ever be exectuted. termination is guaranteed by construction.
violate invariants even if this assumption does not hold. the worst case outcome is too short playback in truely extremely weird situations (because the loop count is decreased even if in
theory it might be possible that the target on the next occasion might be something entirely different, which would be desirable to execute).
in default libopenmpt playback mode (i.e. not allowing any infinite loops at all), this algorithm must be followed without exceptions. in repeat-song-n-times mode, backwardpositionjump
commands are initialized with n+1.
it can even support a mode with current infinite loop behaviour:
i think we can even completely remove all traces of rowvisitor.
|2018-09-22 06:28||manx||New Issue|
|2018-09-23 09:56||manx||Priority||normal => urgent|
|2018-09-23 09:56||manx||Severity||major => block|
|2018-09-23 09:56||manx||Target Version||OpenMPT 1.29 / libopenmpt 0.5 (goals) => libopenmpt 0.4 (goals)|
|2018-09-24 11:25||manx||Target Version||libopenmpt 0.4 (goals) => OpenMPT 1.29 / libopenmpt 0.5 (goals)|
|2019-01-24 12:07||manx||Note Added: 0003825|