Skip to content

Fix modal feed recovery for resume-at-line#678

Draft
righteousgambit wants to merge 1 commit into
Carvera-Community:developfrom
righteousgambit:agent/fix-resume-feed-recovery
Draft

Fix modal feed recovery for resume-at-line#678
righteousgambit wants to merge 1 commit into
Carvera-Community:developfrom
righteousgambit:agent/fix-resume-feed-recovery

Conversation

@righteousgambit

Copy link
Copy Markdown

Closes #669

Summary

Recover modal feed words independently of motion-command formatting so resume-at-line can restore standalone and tightly packed F values before recovery movement.

Changes

  • Scan prior lines with the controller's existing G-code tokenizer instead of requiring a recognized G1/G2/G3 prefix.
  • Select the most recent valid F token while continuing to ignore comments.
  • Add unit coverage for standalone F, tightly packed G-code, comments, and recovery-command ordering.
  • Add an unreleased changelog entry.

Why

Feed is modal independently of a motion word. The previous parser could skip a valid F275 line or a packed X10Y10G1F425 line, then restore an older feed before the resume recovery Z move.

The motion risk is conditional on retained controller state; the fix makes the recovery value explicit and deterministic.

Validation

  • Regression against the pinned develop implementation: 3 failed, 2 passed; standalone and packed feed values incorrectly resolved to the older 100, and the preview omitted buffer G1 F275.
  • With this change, using the same exact-ref sparse harness: PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/tmp/carvera-test-stubs:. pytest -q tests/unit/test_resume_feed_rate.py -> 5 passed.
  • ruff check carveracontroller/Controller.py tests/unit -> passed.
  • git diff --check develop...HEAD -> passed.

Real branch verification

The repository's locked Poetry environment was installed from poetry.lock. The targeted suite passed on real fork commit 7df0e9867548, whose sole parent is pinned upstream develop@2ea66c10e96d88013a04441134d3d4f8e8c88510.

poetry run pytest -q tests/unit/test_resume_feed_rate.py

Result: 5 passed.

Quality gates on the real branch:

  • Ruff check: passed
  • Ruff format --check: passed
  • git diff --check 2ea66c10e96d88013a04441134d3d4f8e8c88510..7df0e9867548884728170818e3ee34d873eaecae: passed

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.

1 participant