Skip to content

move Halui into task - #4644

Draft
rene-dev wants to merge 6 commits into
LinuxCNC:masterfrom
rene-dev:halui-task
Draft

rene-dev wants to merge 6 commits into
LinuxCNC:masterfrom
rene-dev:halui-task

Conversation

@rene-dev

@rene-dev rene-dev commented Oct 6, 2026

Copy link
Copy Markdown
Member

there is really no reason for halui to be its own process, and go thru nml - it is much better to be integrated in task.
this is the next step to fully remove nml, the only place it is left now is the ui <-> task communication.

@grandixximo grandixximo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good move: halui in task removes a whole process and its NML round trip with no behavior change, and the new tests/halui suite pinning down the quirks is exactly what a port like this needs. I support merging it.

One question on the config sweep: did these get missed, or was leaving them deliberate? They still set HALUI = halui:

  • configs/sim/axis/db_demo/base.inc (pulled in via #INCLUDE by db_nonran.ini and db_ran.ini)
  • configs/sim/axis/ja_tests/xz/xzbase.inc
  • configs/sim/tklinuxcnc/trivkins/xzbase.inc
  • configs/sim/touchy/ngcgui/pyngcgui_touchy_moveoff_es.txt

Harmless now that the setting is ignored, but they will confuse anyone grepping for how halui gets started.

The rest is inline.

Comment thread src/emc/task/cmd_queue.hh
* state gating, same serial-number echo, same error reporting.
*
* Two producers use it:
* - ws_server.cc, from the websocket server thread

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ws_server.cc does not exist anywhere in this tree. Is the websocket server a planned follow-up? As written, "Two producers use it" reads like there is a second producer today, but halui.cc is the only one.

#include "motion/motion.h" // EMCMOT_ORIENT_*
#include "ini/inihal.hh"
#include "halui.hh" // the HAL user interface, in task
#include "cmd_queue.hh" // commands from ws_server and halui

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as in cmd_queue.hh: ws_server is not in the tree, so what does "commands from ws_server and halui" refer to?

$(Q)$(CXX) -o $@ $(ULFLAGS) $^ -lfmt $(LDFLAGS)
TARGETS += ../bin/linuxcnclcd

../bin/halui: $(call TOOBJS, $(HALUISRCS)) ../lib/liblinuxcnc.a ../lib/liblinuxcncini.so.1 ../lib/libnml.so.0 ../lib/liblinuxcnchal.so.0 ../lib/libtooldata.so.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing bin/halui breaks user configs that start it from a HAL file with loadusr halui -ini ..., which is the pattern the docs recommended for StepConf-generated configs, so it will exist in real user setups. The [HAL]HALUI = form degrades gracefully since the pins now always exist, but the loadusr form is a hard startup failure. Would a no-op halui shim be worth keeping for one release? It could print a warning that the pins are built into task now, so those users learn about the change instead of silently succeeding. At minimum I think this needs a migration note in the docs.

the nml file specified in the INI, usually that file is in the same
folder as the INI, so it makes sense to run halui from that folder.
The pins are part of the LinuxCNC task controller and exist in every
configuration. There is nothing to load and nothing to configure: connect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "nothing to configure" quite right? [HALUI]MDI_COMMAND, [DISPLAY]MAX_FEED_OVERRIDE and the spindle override limits still configure halui. Maybe just "nothing to load"?

Comment thread docs/src/gui/halui.adoc
----
There is nothing to set up: the pins exist in every configuration, created
by the task controller before the HAL files are read, so a HAL file can
connect them straight away. Pins nobody connects cost nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this agree with the halui.cc header comment? There you write that a machine connecting none of the pins still pays for a pin scan every 20 ms. Negligible either way, but which one is it?

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