Amendments to the case file for PR #698 — "Open host prefix store before RankExecutor::new() to avoid cuModuleLoadData deadlock with persistent GPU workers"
(Amendment-only output, per the task. Everything in my 2026-12-02 report that is not contradicted below still stands; the standing parts are restated compactly in §5 so reviewers do not have to re-derive them.)
Key findings (the deltas)
- The head moved and the two error-path blockers I raised are fixed. Head is now
501bb0e9(1 file, +65/−53,helios/src/server/runtime.rsonly). The three ad-hoc cleanup blocks are replaced by one helper,fn close_store(store: Option<Box<dyn flare_selene::HostStore>>, shutdown: &mut Shutdown)(pr/698 helios/src/server/runtime.rs:1137-1157) that keeps the store inManuallyDropwhile!shutdown.drained, clearsdrainedaroundstore.close(), restores it onOk, and records a close error withshutdown.error.get_or_insert(...)onErr.Worker::close_storenow just delegates (:1353-1355), all three early-error paths use it (RankExecutor::new:703,RequestScheduler::new:716, scheduler configuration:780), andstd::mem::forgetappears nowhere in the file. Withdrawn: my findings on asymmetricdrainedsemantics, swallowedstore.close()errors, and the deliberatemem::forgetleak (old findings 3 and 4). - #698 is now fully superseded by already-merged #709. #709 "Unblock lossless KV compression across Ignition, selene-manager, and Helios Green Contexts" (lukealonso, COLLABORATOR; opened 2026-12-03 18:08, merged 2026-12-03 20:09, +2185/−339, 21 files, merge commit
cb191a93) states in its body that it "addresses #701 and #698", and it ships every element of #698's single-file diff — verified onmain: the same reorder block withcrate::offload::openathelios/src/server/runtime.rs:782beforeRankExecutor::newat:798(:760-794), the sameclose_storehelper (:1282-1302), the same three call sites withget_or_insert(:805,:818,:882; errors preserved at:819,:883), andWorker::close_storedelegating (:1465-1466). #709 additionally lands what #698 never had: the docs sentence (docs/prefix-cache-offload.md:59-63, incl. "opens the host prefix store (callingcuModuleLoadData) before starting the persistent worker graph" at:62-63) and five tests (helios/src/server/runtime/phase_tests.rs:2296,:2321,:2352,:2374,:2399-2459). #709's own Autobot review says it outright: "Open #698 duplicates theruntime.rsstartup-ordering fix this PR also implements (its review asked for exactly thisclose_storeownership work)." - Verdict change: close as duplicate, with credit. After a rebase the only deltas left would be comment wording plus one nit — the two scheduler branches still end with
shutdown.error = Some(error)(pr/698 :717,:781), which overwrites a store-close error the helper just recorded, wheremainusesget_or_insert(:819,:883). Recommendation moves from "fix the error paths, then merge" to close #698 as superseded by merged #709, explicitly crediting ebfio's GB300cuModuleLoadDatadiagnosis — whichmainalready credits by PR number in code:helios/src/runtime_core/persistent_worker.rs:2939("4. Now start the persistent worker after cuModuleLoadData completed (#698)"). - A linked issue now exists, and it reframes the contribution: #701 (ebfio, opened 2026-12-03 02:18, open, labels
bug,performance,priority:P1) documents the post-fix SM103 Green Context contention (6.9–12.4 MB/s encode, ~100× decode collapse,B>=2hang) and says it reproduces "after fixing thecuModuleLoadData()startup deadlock inhelios/src/server/runtime.rs". So #698 was the prerequisite diagnosis, and the P1 follow-on is already being fixed elsewhere (#709's third codec Green Context; extended fleet-wide by open #723). - Corrected mechanism wording (replaces my "could not locate" caveat) and a residual gap on
main. Thekv_codec_gpudeferral is askip_moduleparameter in the loader (helios/src/runtime_core/mod.rs:788-791at pr/698,:798-801onmain; driven bycodec_gpu_module.as_deref()fromhelios/src/runtime_core/model.rs:821/:862), and the cubin bytes are pre-read intogpu_codec_cubins(model.rs:628-689/:662-692), so the onlycuModuleLoadDataforkv_codec_gpuisGpuRankCodec::new→stream.load_module(cubin)(helios/src/offload/transfer/gpu_codec.rs:268-283). No CI test guards the startup ordering onmain:phase_tests.rshas nooffload::opencall site, and the only ordering assertion is the#[ignore]d SM120 testcuda_green_context_three_way_gpu_codec_runs_concurrently_with_persistent_worker_and_cooperative_compute(helios/src/runtime_core/persistent_worker.rs:2500-2502, step 4 at:2939). That is amainrisk, not an #698 risk. - State/engagement refresh: labels are now
bug+triage:review; engagement is still zero human review and zero CI checks — the only discussion is twoflare-autobotcomments (case file 2026-12-03 00:18; a Changes-Requested review at 00:38 against9ed34dawith 2 blockers). That review predates501bb0e9, so its ownership blocker is stale while its evidence blocker still stands (see §3). The PR body is also stale vs its own head: it still describes the removed ad-hoc cleanup and mentions neither #709 nor #701.
1. Amendment: the error-path work at head 501bb0e9
- New helper, one place to reason about:
fn close_store(store: Option<Box<dyn flare_selene::HostStore>>, shutdown: &mut Shutdown)—pr/698 helios/src/server/runtime.rs:1137-1157; comment at:1141-1142("Retain registered slabs if either drain fails, including an unwind inside the store's close operation");drainedcleared at:1147, restored at:1150, error preserved at:1154. Worker::close_storeis nowclose_store(self.store.take(), shutdown)(:1353-1355), so the startup error paths and the steady-state shutdown path share one implementation — the asymmetry I flagged is gone.- Call sites:
RankExecutor::newfailure (:698-705,close_storeat:703),RequestScheduler::newfailure (:713-719,:716), scheduler configuration failure (:777-783,:780). - Residual nit (also a delta vs
main):shutdown.error = Some(error)at:717and:781clobbers a store-close error the helper just recorded;mainusesget_or_insert(:819,:883). - Size/scope at head: 1 file, +65/−53; still no test, still no docs change.
2. Amendment: scope proof that #709 covers #698, and the conflict/merge-order picture
- Scope proof: #698's entire diff is (a) the reorder block, (b)
close_store, (c) three call sites, (d) theWorker::close_storedelegation. All four exist onmainvia #709 (helios/src/server/runtime.rs:760-794,:1282-1302,:805/:818/:882,:1465-1466). #709 adds the docs (docs/prefix-cache-offload.md:59-63) and the five drain-contract tests (phase_tests.rs:2296,:2321,:2352,:2374,:2399-2459). - Merge order: #698's base predates
main's #709 (cb191a93), #711 (45e1c1ad) and #694 (7bbc6707), all of which touchhelios/src/server/runtime.rs— so #698 is behindmaininside the very block it edits and cannot merge as-is. Commit history for this file is readable again (my earlier note thatsearch_historyfailed is obsolete): newest-first it is #694 (yatesdr), #711 / #709 / #708 (Luke Alonso), #674 (yatesdr), #697 (PCCessna), #663 / #628 (yatesdr), #626 / #620 / #619 / #607 / #579 (Luke Alonso), #540 / #497 (PCCessna), #504 (yatesdr) — i.e. the area is owned by lukealonso and yatesdr, which confirms the ownership inference in my original report. - Neighbouring open work now: #729 (lukealonso, open, 2026-12-04, +2219/−370,
helios/src/server/runtime.rs+270/−26) edits other regions of the same file (grammar-transition parking,runtime.rs:509-545,:1698-1706,:2118-2620per its review) — not the startup block; #723 (lukealonso, open, 2026-12-04 06:21, +1438/−285, 27 files) generalizes codec isolation to 2-way(codec, compute)Green Contexts for non-persistent-worker cores and references #698; its review flags a semantic interaction with open #640 (worker rank 0 gets a 3-way split, peers 2-way). Net: with #709 merged, nothing competes with #698 for merge; it merely duplicates.
3. Amendment: state, provenance, evidence, and mechanism
- Provenance is no longer "the PR body only". #709's body states the deadlock ("Calling
cuModuleLoadDatawhile a persistent worker kernel is resident deadlocks inside the CUDA driver (#698)"), and #701 records that it reproduces only after this fix. The diagnosis was accepted upstream; only the diff is redundant. - The evidence blocker survives. The body still suggests
cargo test -p helios --features runtime-core(no such package — the crate isflare-helios,helios/Cargo.toml:2) and validates withcargo test -p flare-helios --features runtime-core("1243 passed"), which cannot compile the changed module:helios/src/server/runtime.rsis gated on#[cfg(feature = "server")](helios/src/lib.rs:30-31) andserveris a separate feature list (helios/Cargo.toml:25) not implied byruntime-core(:21). No test is added by #698 and no CI run is recorded on9ed34daor501bb0e9. - Mechanism wording corrected (supersedes my earlier "could not locate" caveat): the loader deferral is
skip_module(if skip_module == Some(module.name.as_str()) { phase.advance(1); continue; }athelios/src/runtime_core/mod.rs:788-791at pr/698,:798-801onmain), driven fromhelios/src/runtime_core/model.rs:821/:862; the cubin bytes are pre-read (model.rs:628-689/:662-692) and attached viaCopiers::with_gate(...)(model.rs:1100-1103), so the singlecuModuleLoadDataforkv_codec_gpuisGpuRankCodec::new(helios/src/offload/transfer/gpu_codec.rs:268-283). Net effect matches the PR's story; only its cause #1 was imprecisely worded. - #701's root cause is already addressed elsewhere. #701 blames
prepare_offloadbinding offload streams torank.execution_context(); #709 addedNativeResources::offload_context()(codec context when present, else the base context) andprepare_offloadnow uses it (helios/src/runtime_core/mod.rsoffload_context(),helios/src/runtime_core/model.rsprepare_offload; see #709 body §3 and its review walkthrough citingmod.rs:1416-1421,model.rs:969). #723 extends that to cores without persistent workers.
4. Withdrawn / superseded from my 2026-12-02 report
- Withdrawn: error-path
drainedasymmetry, discardedstore.close()errors,std::mem::forgetretention leak (old findings 3–4; old note #11's asymmetry half). - Superseded: "no linked issue" (now #701), "commit history unreadable" (now readable), "the
prepare_kernelsdeferral cannot be located" (now theskip_moduleexplanation above), and the recommendation (was "fix error paths, then merge" → now "close as superseded by #709").
5. What still stands unchanged from the original report
- The change itself was a pure reordering plus LIFO cleanup in one file; reach is every prefix-cache-offload startup, not only GKV1, because the store is
Noneonly when there is no offload payload;worker_metrics.codec_placement(...)andprepared.intake_warning()moved ahead of executor construction, so they now fire beforeRankExecutor::newand also on startups that subsequently abort (pr/698 :673-678); the multi-process non-sharded guard is still honoured first (:644-656). - Verified deadlock chain (all links cited):
RankExecutor::new→GraphExecutor::new(helios/src/execution/ranks.rs:123-145(not opened)) →finish_startup→control.start()?on the first persistent worker (helios/src/execution/transport.rs:793-808);crate::offload::open→flare_selene::offload::open(helios/src/offload/mod.rs:135-144) →Transfers::start_partsspawnsflare-offload-{rank}and blocks onready.recv()(helios/src/offload/transfer.rs:533-656(not opened)) →RankWorker::open→GpuRankCodec::new→stream.load_module=cuModuleLoadData(gpu_codec.rs:268-283,helios/src/cuda.rs:1140-1155(not opened)). - Charter mapping: aligns with the root-cause rule ("Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error", #397), the four-part-description rule, and "keep the runtime small and model-agnostic"; the evidence requirement (#210) was unmet by #698 but is met for the landed version by #709's tests. "Respect contributors … every PR is judged on its merits" (#229) is why the close should credit the report rather than discard it — and #701 (
priority:P1) shows the reporter's diagnosis is already carrying weight upstream. - Cross-PR map: #504 (merged 2026-11-25) introduced the hazard and the
offload::opencall; #628 addedCopyEngineGate/binding.copy_gate(); #579/#607/#626 established theWorker::close_storeconvention this PR now matches; #640 (open) carries the same kernel-before-work ordering class in theThreadedexecutor; #674/#694 edit neighbouring code. #698 supersedes nothing.
6. Open questions / not found
- No CI run, no human review, and no reproduction attachments exist for either head (
9ed34da,501bb0e9); the before/after numbers (">400 s" → "0.6 s", 1.239–1.259×, 3.6 s drain) remain self-reported. - Who, if anyone, will formally close #698 is unknown — as of the last state I saw it is still open with
bug+triage:review, while the fix it duplicates is already onmain. - Whether maintainers want ebfio's commit landed for attribution (it would be a comment-wording-only change after rebase) is a policy call the record does not answer.
- I could not verify
main's exact line numbers for theclose_storecall sites (:805,:818,:882) and the helper (:1282-1302) in this pass; they were verified in the earlier pass, whilemain'soffload::openat:782andRankExecutor::newat:798were re-verified here.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/698