Skip to content

Fix retract keys sort order in PrintConfig (debug build crash)#202

Closed
appositeit wants to merge 1 commit intoSnapmaker:2.2.4-devfrom
appositeit:fix/printconfig-retract-keys-sort-order
Closed

Fix retract keys sort order in PrintConfig (debug build crash)#202
appositeit wants to merge 1 commit intoSnapmaker:2.2.4-devfrom
appositeit:fix/printconfig-retract-keys-sort-order

Conversation

@appositeit
Copy link
Copy Markdown

Summary

  • Fix alphabetical sort order of m_extruder_retract_keys and m_filament_retract_keys in PrintConfig.cpp
  • retract_length_toolchange and retract_restart_extra_toolchange were appended at the end of the sorted lists instead of being inserted at their correct alphabetical positions
  • This causes std::is_sorted assertion failure and immediate crash on startup in debug builds (-DCMAKE_BUILD_TYPE=Debug)

Root Cause

When the toolchange retraction keys were added to Snapmaker Orca, they were appended at the end of the sorted key lists. Alphabetically, retract_le... sorts before retract_li..., and retract_restart_extra_toolchange sorts after retract_restart_extra but before retract_when_changing_layer.

Fix

Move the keys to their correct alphabetical positions:

  • retract_length_toolchange → after retract_before_wipe, before retract_lift_above
  • retract_restart_extra_toolchange → after retract_restart_extra, before retract_when_changing_layer

Test plan

  • Verified sort order using sort utility: extracted keys, sorted, diffed — no differences
  • Debug build starts successfully without assertion failure
  • Release build unaffected (assertions disabled)

🤖 Generated with Claude Code

The retract_length_toolchange and retract_restart_extra_toolchange keys
were appended at the end of m_extruder_retract_keys and
m_filament_retract_keys, violating the alphabetical sort order required
by the std::is_sorted assertion. This causes an immediate crash on
startup in debug builds.

Move the keys to their correct alphabetical positions:
- retract_length_toolchange after retract_before_wipe
- retract_restart_extra_toolchange after retract_restart_extra

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@womendoushihaoyin womendoushihaoyin deleted the branch Snapmaker:2.2.4-dev March 25, 2026 09:15
@appositeit
Copy link
Copy Markdown
Author

Hi! I noticed you've closed all the bugs I raised. Is that because they were not useful, or they were wrong, or you didn't understand that they were causing compilation errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants