Case file: PR #698 — Open host prefix store before RankExecutor::new() (ebfio)
Key findings (what the description does not tell you)
- The cited validation cannot compile the changed file.
helios/src/server/runtime.rsis only built under#[cfg(feature = "server")](helios/src/lib.rs:30-31). The stated validation run,cargo test -p flare-helios --features runtime-core("1243 passed; 0 failed; 37 ignored"), does not enableserver(helios/Cargo.toml:21,25—server = ["dep:serde", "images", "grammar", …]), so no line of this diff was compiled by the run cited as evidence. The PR's own "Suggested test command" additionally names a package that does not exist — the crate isflare-helios(helios/Cargo.toml:2), socargo test -p helios …fails as written. No test is added or modified in the diff. - This repairs a regression that is ~1 week old, introduced by merged PR #504 ("selene, selene-manager, helios, ignition, heliopause: add pure-CUDA GPU and CPU lossless KV compression", yatesdr, merged 2026-11-25, +20519/−785, 152 files) — which itself changed
helios/src/server/runtime.rs(+5/−2) to add the verycrate::offload::open(...)call this PR moves. #698 is a follow-up fix, not a rewrite; it reverses none of #504's work. - Error-path "drained" semantics are not symmetric with
Worker::close_store, despite the code comment claiming "symmetric LIFO order". OnRankExecutor::newfailure the new code doeslet _ = store.close();(error discarded) and returnsShutdown { drained: true }(runtime.rs:697-706);Worker::close_storein the same file setsdrained = falseand preserves the error whenstore.close()fails (runtime.rs:1354-1362). The offload-open failure path also now returnsdrained: trueunconditionally (runtime.rs:684-690) where the pre-change code deriveddrainedfromexecutor.close()(removed hunk of the diff). - New deliberate leak to retain registered slabs:
std::mem::forget(store)on an undrained shutdown in the two late error paths (runtime.rs:721-723,:791-793) — same intent as theManuallyDrophandling atruntime.rs:1348-1352, but via a different mechanism, and reachable only on startup failures that previously could not happen after the store was open. - One step of the described root cause could not be located in the tree. Cause #1 says
helios/src/runtime_core/mod.rsdefers thekv_codec_gpucubin load duringPrepare kernels. That file contains no kernels/codec/module references, and no definition ofprepare_kernelsexists underhelios/src— only call siteshelios/src/runtime_core/model.rs:821,helios/src/runtime_core/event_tests.rs:115(not opened), and the phase name athelios/src/startup.rs:59. The rest of the chain (below) is verified. - Behaviour change beyond the stated GPU case:
worker_metrics.codec_placement(...)and theprepared.intake_warning()stderr warning now fire before executor construction (runtime.rs:673-678), i.e. earlier log/metric ordering at startup, and are emitted even when startup subsequently fails. The reordered block runs for every offload configuration (storeisNoneonly when there is no offload payload), not just--lossless-kv-compression gpu. - The body admits an unresolved, in-scope follow-on: on SM103 Green Context cores with cooperative persistent workers, GKV1 still contends with cooperative decode graphs at runtime because
model.rsopens the codec stream onrank.execution_context()— declared separate from this fix and left open.
The change
Size: 1 file, +52/−31, all in helios/src/server/runtime.rs (head 9ed34da, base main, diff read in full).
Verified at head:
crate::offload::open(prepared, gpu_cubins, copy_gate)moves from afterRankExecutor::newto before it, into a new block atruntime.rs:657-691, with a comment stating the deadlock rationale (:657-662). It now readsmanifest.offloaddirectly instead ofexecutor.manifest().offload, taking the prepared payload viabinding.take()whilecopy_gateis cloned separately (runtime.rs:666-671).- LIFO cleanup added on three late error paths:
RankExecutor::newfailure →store.close()with the result ignored, thendrained: true(:697-706); scheduler-construction failure →executor.close(), thenstore.close()if drained elsestd::mem::forget(store)(:714-726); scheduler-configuration failure → the same pattern (:784-796). - Happy path ordering unchanged:
worker.attach_store(store)at:806; shutdown stillexecutor.close()thenworker.close_store()(:829-830).
Undeclared/side details:
- Metric and warning emission now precede executor construction (
:673-678) — log/metric ordering change, plus emission on paths that later abort. - Ordering versus the "host prefix store requires every rank in one process" guard is preserved: that check is at
runtime.rs:644-656, before the new block. - Taking the payload early is safe for
RankExecutor::new, which only readsmanifest.offload…copy_gate()(helios/src/execution/ranks.rs:127);copy_gateis a separateClonefield (helios/src/offload/mod.rs:58-60,:78-83).
The why
- No linked issue;
search_itemsfor this deadlock returns only #698 itself (plus #492/#504 for the feature). The problem statement lives entirely in the PR body:flare runhangs inside "Start server" with GPU at 100% SM,flare-offload-0at 100% CPU, HTTP never binds, for cores combiningPersistentWorkerwith--lossless-kv-compression gpu(GKV1); gdb on the wedged thread showslibcuda.so.1!cuModuleLoadDataon DGX Station GB300 (SM103, CUDA 13.2). - Age and breadth of the want: the hazard was created 2026-11-25 by #504 and this fix opened 2026-12-02 — at most ~1 week of exposure in main, one reporter (the author), no duplicate reports, +1s or labels. "How widely wanted" cannot be established from the record.
- Verified mechanism (each link cited):
RankExecutor::new→GraphExecutor::new(helios/src/execution/ranks.rs:123-145,:138-139).GraphExecutor::new→new_unstartedthenfinish_startup(helios/src/execution/transport.rs:604-611).finish_startupcallscontrol.start()?onmanifest.persistent_workers.first()— launches the persistent worker kernel (helios/src/execution/transport.rs:793-808).crate::offload::open(...)→flare_selene::offload::open(..., Copiers::with_gate(...))(helios/src/offload/mod.rs:135-144).Transfers::start_partsspawns oneflare-offload-{rank}thread per rank and blocks onready.recv()untilRankWorker::opensucceeds (helios/src/offload/transfer.rs:533-656; thread at:602-636, join-wait at:642-652).RankWorker::open→GpuRankCodec::new→stream.load_module(cubin)=cuModuleLoadData(helios/src/offload/transfer/gpu_codec.rs:268-283;helios/src/cuda.rs:1140-1155, symbol atcuda.rs:294). So the same-context "kernel resident whilecuModuleLoadDataspins" ordering the body describes does exist in code. The unverified link is #1 in finding 5 above.
- Context on how often CUDA-context/lifecycle hangs appear here: #579 (merged, "TP startup drain hang", VLM teardown deadlock), #607 (merged, offload lifecycle bugs), #627 (closed, TP2 peer-CE deadlock), #534 (open, checkpoint-capture deadlock — judged fork-specific).
Related work
- Origin: #504 (merged 2026-11-25, yatesdr, COLLABORATOR) — added
--lossless-kv-compression off|cpu|gpu, the embeddedkv_codec_gpucubin per exported core,helios/src/offload/transfer/gpu_codec.rs(+2355),transfer/codec.rs(not opened) (+1435), and theoffload::opencall inModelRuntime::start. Its review thread already carried an Autobot blocker on the same context-currency theme ("GPU codec leaks on teardown:gpu_codec.rs:332-345,:183-193free the module/workspace only if the dropping thread already has that rank's context current"), and flagged--ranks/multi-hostgpustart failure viaCopiers::empty()(helios/src/offload/shard.rs:46(not opened),transfer/codec.rs:101-104(not opened)) — the very path reordered here. - Superseded earlier attempt: #492 (closed) "add VRAM-to-DRAM CPU/GPU lossless KV compression" → replaced by #504.
- Same code, overlapping: #628 (merged, yatesdr) gated offload Copy Engine batches during peer-copy graphs — introduced
CopyEngineGate/binding.copy_gate(), the accessor used by the moved block and byRankExecutor::new; #607 and #579 (both merged, lukealonso) reworked the same startup/drain lifecycle region ofhelios/src/server/runtime.rs, establishing theWorker::close_storeconvention#698mirrors; #625 (merged, offload startup timings), #497 (merged, FujitsuPolycom, disk-offload restore latency), #589 (merged, CUDA 12 batched copies/ARM64). - Same class, different path: #640 (open, original-el8) "allow persistent workers on rank 0 of local multi-rank cores" — its review concerns
threaded.rs:766-775result.local.finish_startup()?launching rank 0's persistent worker before peers are confirmed, i.e. the same kernel-before-work ordering class in theThreadedexecutor. #698 fixes only theModelRuntime::startpath, so the hazard may persist there if #640 lands. - Same files, no textual conflict: #674 (open, yatesdr) prefix-cache hit rate/L1/NVMe/GPU snapshot packing, #694 (open, yatesdr) write-side NVMe/pool spill gate, #576 (open) thread pinning — all touch
helios/src/server/runtime.rsand/orhelios/src/offload/mod.rs. - Checked and excluded as the same bug: #534 (checkpoint-capture deadlock; attributed by mark-yong and flare-autobot to a third-party fork), #627 (closed, TP2 in-graph peer CE deadlock). Other PRs touching distant parts of
runtime.rs(#692, #697, #691, #548, #549, #560, #483, #621, #554, #301, #334) do not overlap. - Nothing competing with, stacked on, or undone by #698; it supersedes nothing and is not superseded.
Recent activity
- Commit-level history for the area could not be read:
search_history(path=helios/src/server/runtime.rs)fails withgit: error: Could not read c513e46a… / fatal: cannot simplify commit ef38cb93…, the same error the orientation packet reports for "Recent activity in those areas". No author/date listing is available for the last 60 days underhelios/src. - Orientation packet: "Commits on the default branch since this pull request branched (
cc0a49d), touching its changed files: none" — the PR is not behind on its own file. - The immediate predecessor of the touched lines is #504 (merged 2026-11-25, yatesdr); #698 keeps the same code, moves it ~90 lines earlier, and replaces the old comment ("The host prefix store opens its transfer threads on every rank's context, which the loader prepared for this process") with the deadlock rationale (
runtime.rs:657-662). - Open work that will need to rethink this region: #674/#694 (yatesdr) touch neighbouring code; #640 (original-el8) extends persistent workers to the threaded multi-rank path.
People
- Author: ebfio — GitHub association
FIRST_TIME_CONTRIBUTOR; last 180 days: 0 merged, 0 closed, 2 open, both also opened 2026-12-02 and both unreviewed: #699 (avoid double-counting preallocated/dev/shmselene-manager regions againstMemAvailable) and #682 (docs: logind RemoveIPC risk). Shared theme: Linux host-memory/CUDA lifecycle hazards on the author's own DGX Station GB300 (aarch64, kernel 6.17.x, 64K pages). No prior commits in this area; not on the charter's priority-contributor list (@voipmonitor, @original-el8, @lukealonso). Signs "Discord: ebfio" (compare #504's "Discord: D-Rock"/yatesdr). - Who usually works here (from
items_touchingonhelios/src/server/runtime.rsandhelios/src/offload/mod.rs): yatesdr — selene/offload architecture (#80, #92, #141, #497, #504, #628, #663, #674, #694); lukealonso — startup/shutdown and offload lifecycle fixes in this exact file (#579, #607, #619, #620, #626); plus jcartu (#505, #621, #692), FujitsuPolycom (#497, #540, #697), WynnD (#548, #549, #560), original-el8 (#640), rickybrent, atebska, fordbmorris, mark-yong, voipmonitor, shadownetX, newjordan. - Engaged so far on #698: nobody. No comments, reviews, reactions, or labels.
Community
pr_commentson #698: "No comments." Reviews: none. Labels: none. Reactions: none recorded. Opened and last updated 2026-12-02 (same day) — effectively zero dwell time and zero signal either direction.- Contrast with the neighbouring PRs (#504, #497, #607), which drew long multi-reviewer threads and Autobot reviews with blockers. Here the multi-line error-path additions (
runtime.rs:697-706,:714-726,:784-796) and thestd::mem::forgetleak (:721-723,:791-793) have had no external scrutiny at all.
Project fit
Charter (read in full) mapped to this change:
- Aligns: "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" — #698 fixes ordering/lifetime instead of serializing or retrying around
cuModuleLoadData, and documents the mechanism in-code (runtime.rs:657-662). Also aligns: "PR descriptions: Expect four parts" (why/what/result/evidence all present), "No per-model special cases or flags" (no flag or model branch added), smallest-footprint-in-shared-code (1 file, +52/−31, no new module), and the "keep the runtime small and model-agnostic" line (§12) — no per-model branch. - Tension — evidence: "Bring real evidence" — the only automated run cited does not compile the changed module (finding 1), no test was added, and the GPU evidence is not re-run ("No fresh GPU startup reproduction was run for this submission").
- Tension — supported matrix: "Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs. Check state and CUDA-graph transitions" — the body itself leaves an open SM103 Green Context / cooperative decode-graph contention (codec stream opened on
rank.execution_context()inmodel.rs), and SM103/SM120/SM121 are named charter targets. - Neutral: the "store prefix-cache checkpoints in host memory and share them across Flare instances via Selene" goal is the subsystem being reordered; no user-visible interface, flag, or doc change, and
docs/is untouched (nothing claims it needed to be).
Claims and evidence
| Claim (from body) | Backing found |
|---|---|
Deadlock in Start server with PersistentWorker + GKV1, cuModuleLoadData spinning |
Self-reported; gdb backtrace on DGX Station GB300 (SM103, CUDA 13.2) shows cuModuleLoadData in libcuda.so.1. Not independently reproduced in-repo. Mechanically consistent with the verified chain (see "The why"). |
| Before >400 s hang; after 0.6 s to "Start server" | Author's report only; explicitly "retained from the supplied reproduction", no fresh run for the submission. |
| GKV1 works after: 1.239–1.259× lossless on FP8 MLA KV, 0 CRC/verification failures; SIGTERM drain 3.6 s | Author's report; no logs or command output attached. |
"cargo test -p flare-helios --features runtime-core → 1243 passed; 0 failed; 37 ignored (Hades Linux aarch64, kernel 6.17.0-1029-nvidia-64k)" |
Cannot exercise the diff: server feature off (helios/src/lib.rs:30-31, helios/Cargo.toml:25). Verified; the count says nothing about this change. |
"Suggested test command: cargo test -p helios --features runtime-core" |
Wrong package name — crate is flare-helios (helios/Cargo.toml:2); fails as written. Verified. |
| "Startup is now exact LIFO-symmetric with the existing shutdown path" | True for the happy path (:806, :829-830); approximate for the two late error paths (:714-726, :784-796); false for the RankExecutor::new failure path, which ignores the close error and always reports drained: true (:697-706) unlike close_store (:1354-1362). |
Cause #1: cubin load deferred in runtime_core/mod.rs during Prepare kernels |
Not locatable: no kernels/codec reference in helios/src/runtime_core/mod.rs, no prepare_kernels definition under helios/src (only call sites runtime_core/model.rs:821, runtime_core/event_tests.rs:115 (not opened); phase name startup.rs:59). |
Reach
- Code paths: the reordered
offload::openand the new cleanup execute whenevermanifest.offloadcarries a prepared payload — i.e. every prefix-cache offload configuration (cpu and gpu compression, disk/memory/pool tiers), not only--lossless-kv-compression gpu(runtime.rs:663-691). Only GKV1 exhibits the deadlock. - Users/operators: persistent-worker cores (green-context runtime control,
helios/src/execution/transport.rs:797-804) on SM103/SM120/SM121 with--lossless-kv-compression gpu; the reporter's DGX Station GB300 (SM103, CUDA 13.2, aarch64) with a local selene-manager pool. Multi-rank/sharded (--rank) deployments also flow through the reordered call (guard atruntime.rs:644-656;Copiers::empty()atoffload/shard.rs:46(not opened)). - Configuration/defaults/dependencies/deploy: unchanged — no flag, default, Cargo entry, wire format or artifact change.
- Failure semantics: with the store open earlier, a subsequent executor/scheduler failure now closes (or deliberately leaks) the host store on the same thread, where previously that path could not exist at all. This sits against the convention documented at
runtime.rs:569-573,:587-589("Startup errors do not confirm drain; retain owners conservatively on error") and againstclose_store's error-preserving behaviour (:1354-1362).
Process
- State: open, ready for review, opened and last updated 2026-12-02 (age < 1 day at review time). Base
main, head9ed34da. Size 1 file, +52/−31. No labels, no reviews, no comments, no CI checks on the head commit. - Validation artifacts: suggested command (wrong package), submission validation (
flare-helios,--features runtime-core, 1243 passed — compiles no changed code). No test added. - Charter process expectations largely met (four-part description, root-cause framing, small footprint, no new flags); gaps: no test, no CI, no reviewer engaged, evidence not reproducible from within the repo.
- Discord handle given: ebfio.
Open questions / could not be found
- Whether any existing
server-feature test (e.g.helios/src/server/runtime/phase_tests.rs(not opened), not opened) covers startup ordering betweenoffload::openand persistent-worker launch — no test appears to guard this ordering against regression. - The actual
prepare_kernelsdeferral code named as cause #1 (definition not present underhelios/src; possibly supplied by thecore/ignition crate outside this repo's searchable tree). - Any independent confirmation of the GB300 before/after numbers — no logs, traces or CI artifacts were attached, and no other reporter has surfaced the hang.
- Whether the
drained: trueon theRankExecutor::newfailure branch (ignoringstore.close()errors) can hand back resources the caller believes are released while store slabs are still registered — reviewer-level question, not resolved here. - Commit-level authorship/date history for
helios/src(git object errors blocked both the orientation packet andsearch_history).