Orca pipeline
12 results today 24 agents on 1 worker Admin

Local AI agents triage open OrcaSlicer bug reports, try to reproduce them and draft fixes; a person reviews every result before anything goes upstream. An independent experiment, read only.

Queue / #18044

#18044Triaged

Extra length on restart GUI Bug

Agent answer

Triage: Issue #18044 — "Extra length on restart" applied when retraction disabled

Verdict: reproducible bug (triaged). The reporter's claim is correct and traceable in source; it is OS-independent and reproducible on Linux via the CLI slicer or a small unit test.

Reasoning

  1. With retraction_length = 0 the GUI disables retract_restart_extra (src/slic3r/GUI/Tab.cpp:7029-7034) but keeps the stored value.
  2. GCode::needs_retraction() (src/libslic3r/GCode.cpp:10852) only checks travel length / leaving-external-perimeter / overhang — it does not bail out when retraction_length == 0, so the retract path still executes.
  3. In Extruder::retract() (src/libslic3r/Extruder.cpp:93-120), m_restart_extra = restart_extra is assigned outside the if (to_retract > 0.) guard (line 112; same bug in the shared-extruder branch at line 100). With length 0, to_retract = 0, no retract G-code is emitted, but m_restart_extra is still cached.
  4. The next Extruder::unretract() (src/libslic3r/Extruder.cpp:132) computes dE = m_retracted(0) + m_restart_extra(>0), so GCodeWriter::unretract() (src/libslic3r/GCodeWriter.cpp:1524) emits a genuine extrusion move — over-extrusion despite retraction being "disabled". This matches the reporter's suggested fix direction (move the assignment inside the if, plus mirror handling so restart_extra is not carried when no retraction happened).

How to reproduce on this Linux machine

  • CLI: slice a tiny model (e.g. a small cube with internal travels) with retraction_length=0, retract_restart_extra=5 (and default retraction_minimum_travel), then grep the output G-code for unexpected extrusion (G1 E...) on the first move after a travel/restart — over-extrusion moves of ~restart-extra length should appear.
  • Unit test: construct an Extruder, call retract(0, 5) then unretract(); current code returns dE == 5 instead of 0.

Area / platform

  • Area: gcode (retraction/restart extrusion in Extruder/GCodeWriter/GCode).
  • Platform: all (logic is OS-independent; reported on Linux/Debian).

Cause

Root cause: Extruder::retract() stores m_restart_extra unconditionally, outside the to_retract > 0 guard (src/libslic3r/Extruder.cpp:112 and the shared-extruder branch at line 100). GCode::needs_retraction() (src/libslic3r/GCode.cpp:10852) does not gate on retraction_length==0, so the retract path still runs with length 0 (to_retract=0, nothing emitted) yet caches restart_extra; the following Extruder::unretract() (src/libslic3r/Extruder.cpp:132) then emits dE = 0 + restart_extra > 0. The GUI merely disables the field (src/slic3r/GUI/Tab.cpp:7029-7034) without clearing the value.

Triage summary

When retraction length is 0 (retraction "disabled"), the GUI disables the "Extra length on restart" field but the stored value is still applied during slicing, emitting an extra unretract extrusion (over-extrusion) on travel/restart moves.

Issue text on GitHub

Is this issue reproducible in the latest nightly build?

  • [x] I have checked the latest nightly build and the issue is still reproducible

Is there an existing issue for this problem?

  • [x] I have searched the existing issues

OrcaSlicer Version

2.5.2

Regression compared to a previous version

No response

Operating System (OS)

Linux

OS Version

Debian

Additional system information

No response

Printer

custom

How to reproduce

Enable in Printersettings retract and set Extra length on restart
if i set retract to 0 to dissable, Extra length on restart input feld is disabled but my last value is sored and is used by the slicing process
for my understanind if a input field is disabeld for me the function is disabeld but here i only cant change

src/libslic3r/Extruder.cpp
93: double Extruder::retract(double length, double restart_extra) … 111: double to_retract = std::max(0., length - m_retracted); 112: m_restart_extra = restart_extra; // ← **needs do go 2 lines bot in the if part?** 113: if (to_retract > 0.) { 114: m_E -= to_retract; 115: m_absolute_E -= to_retract; 116: m_retracted += to_retract; 117: }

Actual results

disabled but slicer calculate the extra distance

Expected results

if the field is disabled the function should ignored by the slicer for my understanding

Project file & Debug log uploads

Checklist of files to include

  • [ ] Log file
  • [ ] Project file

Anything else?

No response

Area
gcode
Platform
all
Author
cantcode89
Comments
3
Created
2026-11-30
bug

Log

  1. vast-tw restarted; returned to the queue
    vast-tw · 1 h ago
  2. vast-tw took it: reproduce
    vast-tw · 1 h ago
  3. triage: triaged
    vast-tw · 1 h ago
  4. vast-tw took it: triage
    vast-tw · 1 h ago
  5. Collected from GitHub
    panel · 3 h ago