hyperhive/hive-c0re/src/job_queue
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas bf138ae79a jobq: a job asks for the ids it wants back
The operator's instruction on the issue was "the closure returns an array
of guids, and enqueue_job returns the node ids in that order". What was
here instead returned a HashMap of everything inserted, and no caller used
the keys: submit dropped the return, insert_group did into_values(), and
the scheduler ignored what append_subgraph handed back. The guid-keyed
lookup was dead weight, and into_values() made that Vec arbitrarily
ordered -- harmless only because nothing read it.

insert_job now takes FnOnce(&JobBuilder) -> Vec<NodeGuid> and returns the
matching ids positionally. A handle from another job is UnknownNode rather
than a silent omission: the return is positional, so a short vector would
misalign every id after it.

c0re's Declare stays FnOnce(&Job) and the wrapper names no handles in one
place, rather than ending seven templates in an empty vector -- a DAG is
addressed by its container node, which submit inserts itself. That frees
insert_group from needing every id, so the node_rt pre-seeding goes too:
NodeRuntime is one Option field and every reader already tolerated a
missing entry (entry().or_default(), get().and_then(), iter().find()).

The tests are the argument for the shape: capturing a handle through a
mutable binding to look it up in the map afterwards collapses into
returning it and destructuring the result.
2026-08-02 15:32:05 +02:00
..
exec.rs refactor(job-queue): a job is a recipe, not a value you carry 2026-08-02 15:32:05 +02:00
mod.rs jobq: a job asks for the ids it wants back 2026-08-02 15:32:05 +02:00
model.rs refactor(job-queue): a job is a recipe, not a value you carry 2026-08-02 15:32:05 +02:00
resource.rs refactor(job-queue): let resource_deps say (resource, units) 2026-08-02 15:32:05 +02:00
scheduler.rs refactor(job-queue): build DAGs by naming nodes, not counting them 2026-08-02 15:32:05 +02:00
submit.rs refactor(job-queue): a job is a recipe, not a value you carry 2026-08-02 15:32:05 +02:00
templates.rs refactor(job-queue): a job is a recipe, not a value you carry 2026-08-02 15:32:05 +02:00
tests.rs jobq: a job asks for the ids it wants back 2026-08-02 15:32:05 +02:00