Skip to content

task: a kinematics selection is seen on the next line, and the test reads it there - #4563

Merged
BsAtHome merged 2 commits into
LinuxCNC:masterfrom
grandixximo:kins-switch-race
Sep 18, 2026
Merged

BsAtHome merged 2 commits into
LinuxCNC:masterfrom
grandixximo:kins-switch-race

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

The test read motion.kins-type from a 20 ms Python loop and required the values it caught to be 0 1 0 1. The program's last two selections are on consecutive lines, so the kinematics between them is in force for a task cycle or two; the arm runner missed it, as #4560 shows, while the interpreter's own messages were right.

Two commits:

  • task: two lost cycles. WAITING_FOR_KINS_SWITCH went to DONE without emcTaskEager, and readahead_reading cleared a queue buster's wait without reading the next line in the same cycle (that one costs every queue buster a cycle). Two selections on consecutive lines: the first kinematics stayed in force 20 ms before, one servo period after. 125 tests around task green (abort, halui, mdi-queue, mdi-while-queuebuster-waitflag, remap, toolchanger, interp, statbuffer, kins-switch).
  • test: the line after each selection reads the pin itself, #<_hal[motion.kins-type]> next to #<_kins_type>, and the test checks the four messages against 0 1 0 1 instead of sampling. That is the guarantee the test is for, a selection is a queue buster and the next line runs in it; with G12.1's INTERP_EXECUTE_FINISH disabled the check reports the pin one selection behind and fails. The joint sampling during the W move stays, that state lasts the move.

Fixes #4560.

WAITING_FOR_KINS_SWITCH went to DONE without setting emcTaskEager, so the command after a G12.1 waited for the next cycle; every other wait state sets it. And readahead_reading, on finding a queue buster's wait over, cleared it and read nothing until the next cycle, which costs every queue buster a cycle before the line after it is read.

Two selections on consecutive lines: the first kinematics stayed in force 20 ms before, one servo period after.
The test sampled motion.kins-type from a 20 ms Python loop and required the values it caught to be 0 1 0 1. The program's last two selections are on consecutive lines, so the kinematics between them is in force for a task cycle or two, and the arm CI runner missed it (LinuxCNC#4560).

What the test means to check is that a selection is a queue buster: the line after it runs in the selected kinematics. So that line now reads the pin itself, #<_hal[motion.kins-type]> next to #<_kins_type>, and the test checks the four messages against 0 1 0 1. Nothing is sampled, nothing can be missed, and with G12.1 made not to wait the check reports the pin one selection behind.

Fixes LinuxCNC#4560.
@BsAtHome
BsAtHome merged commit db60dc6 into LinuxCNC:master Sep 18, 2026
17 checks 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.

Kins switch race in test kins-switch?

2 participants