Skip to content

Add support for the hiffy network backend#616

Open
mkeeter wants to merge 2 commits intomasterfrom
mkeeter/hiffy-net
Open

Add support for the hiffy network backend#616
mkeeter wants to merge 2 commits intomasterfrom
mkeeter/hiffy-net

Conversation

@mkeeter
Copy link
Copy Markdown
Contributor

@mkeeter mkeeter commented Apr 14, 2026

This is the Humility side of oxidecomputer/hubris#2466

It adds a third backend to execute hiffy programs over the network; the three backends are now

  • Debugger
    • Reads and writes to RAM directly
    • Bytecode is executed by task-hiffy on the SP
  • Network-attached udprpc
    • Bytecode is executed on the host
    • Function calls in bytecode are handled by udprpc over the network
  • Network-attached hiffy (new!)
    • Writes to hiffy arrays are done over the network using a new socket
    • Reads are done using existing dump infrastructure to read from RAM
    • Bytecode is executed by task-hiffy on the SP

We abstract over the debugger and network-attached hiffy with a new enum HiffyWrite to write to hiffy arrays, instead of calling HubrisCore functions directly. Network-attached udprpc remains a special case, because it can only handle a subset of HIF programs (ones that only use Send-flavored functions).

This comment was marked as resolved.

@mkeeter mkeeter force-pushed the mkeeter/hiffy-net branch from 9364718 to ef6dfe1 Compare April 14, 2026 15:20
@mkeeter mkeeter force-pushed the mkeeter/hiffy-net branch from ef6dfe1 to f69ae67 Compare April 15, 2026 20:15
Copy link
Copy Markdown
Contributor

@lzrd lzrd left a comment

Choose a reason for hiding this comment

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

Having a more helpful error message for archives where hiffy net feature is not configured is my only suggestion.

Comment thread humility-hiffy/src/lib.rs Outdated
if !core.is_net() {
let hiffy = if core.is_net() {
if let Some(hiffy_task) = hubris.lookup_task("hiffy")
&& hubris.does_task_have_feature(hiffy_task, "net").unwrap()
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/Can this error case give useful guidance to the user? e.g. "hiffy_task is not configured with net feature".
(Looking for other unwraps() that cold be more helpful in common failure cases...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That unwrap can't fail once we've found hiffy_task. I've rewritten this to be more clear.

Comment thread humility-hiffy/src/lib.rs
let buf_size = self
.hubris
.manifest
.get_socket_by_task("hiffy")
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.

nit: (symbolic constants vs. literals) HIFFY_TASK_NAME? I know we're not going to change this and the function is get_socket_by_task(), but if there are enough "hiffy" names and symbols in different contexts it helps to know what kind of hiffy we are talking about.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm ambivalent – HIFFY_TASK_NAME is marginally more clear, but replacing "hiffy" with HIFFY_TASK_NAME everywhere in this file just makes a bunch of lines slightly longer (forcing one large block to reflow to the next indent level).

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.

3 participants