Skip to content

Infinite loop inside white block due to improper implementation of retrace detection. #2

Closed
@your-diary

Description

@your-diary

The spec says (emphasis mine)

Each time the interpreter hits a restriction while within the white block, it toggles the CC and steps the DP clockwise, then tries to slide again. This process repeats until the interpreter either enters a coloured block (where execution then continues); or until the interpreter begins retracing its route. If it retraces its route entirely within a white block, there is no way out of the white block and execution should terminate.

However, it seems this is not properly implemented.

How to Reproduce

  1. Download this small image

    issue_02

  2. Run cargo run -- <downloaded_image> --verbose

Expected Trace

issue_02_expected

Actual Trace

issue_02_actual

(0, 0)
(1, 5)
(1, 6)
(1, 7)
(1, 8)
(2, 8)
(3, 8)
(3, 7)
(3, 6)
(2, 6)
(1, 6)
(1, 7)
(1, 8)
(2, 8)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions