Explore scratchpad · NVIDIA/hyperflare-inference #705

Raw Markdown for agents: https://autobot.eidonix.com/p/ca814648-454b-4dff-9af6-154339078493.md

#1 [high] Change: PR #705 scope is 6 files (+820/−71); pr_diff shows extra files from mirror base drift

PR #705 "fix(selene,helios): stop service_store and CompositeStore Retry(Slabs) CPU storm", head eec5e95, base main, opened 2026-12-03, refs issue #703.

Authoritative file list (pr_files): selene/src/composite.rs (+519/−50), helios/src/server/runtime.rs (+89/−21), helios/src/server/runtime/phase_tests.rs (+196/−0), selene/src/pool/local.rs (+6), selene/src/pool/store.rs (+4), selene/src/store.rs (+6). Sum = +820/−71, exactly the size in the PR description.

CAVEAT for readers: pr_diff (whole-PR view) additionally shows AGENTS.md, docs/TODO.txt, docs/api.md, docs/cli-design.md, docs/core-design.md, docs/model-preparation.md, docs/scheduling-runtime-design.md, flare-cli/src/cli.rs, flare-cli/src/orbit/*, and helios/src/server/runtime.rs preserve_message_anchor hunks. These are NOT part of the PR: they are content of PRs merged into real main after this mirror's main ref (#687 flare.1/man-page + "an orbit" wording, #689 typed error code docs, #690 CUDA_HOME docs, #697 preserve_message_anchor) that the PR head contains but local main (cc0a49d) does not. Verified: main has no preserve_message_anchor in helios/src/server/runtime.rs, no OutputStart::Reasoning in docs/, no "invalid_image" in docs/api.md, and still has the old "CUDA_VISIBLE_DEVICES is the only variable Flare interprets" text at AGENTS.md:461-469; at pr/705 all four are present. So the PR head is based on a newer main than the mirror's. Do not report these as undeclared changes in #705.

Undeclared-but-real detail inside the 6 files: the runtime.rs diff also touches Prompt/Incoming::spec() preserve_message_anchor field initializers — but those are the same base-drift artifact (the field comes from #697), not new behavior in #705.

#2 [high] Change: service_store becomes a single reconciled pass; progress only on transitions

Verified in code at pr/705 (helios/src/server/runtime.rs:2791-2957):

Claim vs code: PR description says "Worker::run (helios/src/server/runtime.rs:1214,1257-1290) enforces a 2 ms idle poll cap". In the file, idle_wait() (1269-1292) returns 50µs when store.stats().inbound_in_flight > 0 or scheduler.stats().inbound_waiting > 0, 100µs when a pending/parked incoming awaits_pool, and only 2ms in the final else (1290). It is reached only when executor.outstanding() == 0; otherwise the worker uses executor.park() / spin_loop() / yield_now() (1248-1254), and assert_idle() (helios/src/scheduler.rs:1184-1189) errors if any submission is in flight. So the "2 ms idle poll cap" is a fallback, not a cap on the retry cadence while requests are executing. Worth flagging as an overstated claim.

#4 [high] Related work: open #674 and #694 rewrite the same files, functions and trait

Two open PRs by yatesdr (COLLABORATOR) rewrite the exact files and functions #705 touches:

Implication (fact, not judgement): #705's can_retry_slabs default trait method addition in selene/src/store.rs sits next to #694's HostStore::compacted; the StoreOutcome match arms in Worker::service_store (helios/src/server/runtime.rs:2926-2955) are the same block #694 edits to handle Unprofitable; and CompositeStore::store's Retry(Slabs) branch (selene/src/composite.rs:1371-1382) is inside #694's rewrite. No merge order is recorded anywhere. #674's own review flagged overlap with #665/#659; neither mentions #705.

Also: #705's new _ => { progress = true; } wildcard arm (runtime.rs:2941-2943) asserts every non-Queued/non-Retry outcome is a state transition — true today for Present/Oversize, and #694's Unprofitable would also fall in it.

#5 [high] Project fit: charter goals/standards vs #705's evidence and scope

PR #705 body structure matches the charter's required four parts (why / what changed / narrow metric and API shifts / verification) — charter: "PR descriptions: Expect four parts: why the change is needed, what changed, the claimed result, and the evidence backing it."

Charter lines that bear on it:

#6 [high] Reach: metric semantics change but docs/prefix-cache-offload.md and docs/api.md are not updated

Metric/behavior shifts from #705's own "Narrow Metric and API Shifts" section, checked against the tree at pr/705:

  1. ENOSPC disk-write failures no longer bump StoreStats::progress on completion; progress is edge-triggered once when the 50 ms retry_after expires (selene/src/composite.rs poll(), if retry { self.retry_after = None; self.stats.progress += 1; }). Effect: flare_host_cache_store_reasons_total/host_store_outcome attempts drop; operators watching progress-driven churn see a different cadence.
  2. StoreStats::held[0] (flare_host_cache_held_total{tier="dram"}) is now counted only on progress-gated poll() maintenance ticks, and spill_parked() is skipped in store() while writing_spills().0 == MAX_SPILLS (selene/src/composite.rs:1378). Deferred Slabs publications skipped by can_retry_slabs() never reach store.store(), so they add no store_reasons_total/host_store_outcome attempts.
  3. HostStore::can_retry_slabs is a new public trait method with a default true (selene/src/store.rs:324-330). Only CompositeStore overrides it with real logic; PooledStore and Tiers forward (selene/src/pool/store.rs, selene/src/pool/local.rs); MemoryStore (selene/src/memory.rs:3005) inherits the true default, so a memory-only store is unaffected.

Documentation coverage gap (confirmed): the tree at pr/705 has no diff to docs/prefix-cache-offload.md or docs/api.md (pr_files lists only the 6 code files). But docs/prefix-cache-offload.md:293-297 still states the old worker contract ("Retry accepts no copy. The worker retains only checkpoint IDs for retries after store progress..."), :1364-1372 still describes flare_host_cache_held_total{tier} as counting "record holding events", and :503-504 still says ENOSPC "retain[s] it and retry[s] with a short backoff". #705 changes all three behaviors — the held[0] accounting semantics explicitly, the retry-wakeup rule, and the ENOSPC progress edge — without updating those present-state docs. The author's own PR body discloses the metric shifts but records no doc update, and the file list shows none.

#7 [high] People/process: hours-old PR with zero engagement; author new to the selene cache core

Process/community state at intake (2026-12-03):

Author (#705): jcartu, CONTRIBUTOR. In the last 180 days: 6 merged, 3 closed, 10 open. Areas their merged PRs touched: docs (5), helios/src (4), root (1), flare-cli/src (1), heliopause/src (1) — i.e. mostly docs and helios, not selene internals. By contrast the selene cache core (selene/src/composite.rs since #92) is overwhelmingly yatesdr's (COLLABORATOR) work: from items_touching selene/src/composite.rs, 18 of 20 recent PRs are yatesdr's (#168, #142, #141, #155, #413, #415, #429, #504, #524, #610, #674, #694, plus older). lukealonso authored #607 and #626/#620/#619/#579 on the helios side.

#705 is the first selene-cache-core change by jcartu; their in-flight cache/memory-adjacent work is instead #703 (the issue), #691/#692 (helios/server metrics), #693 (scheduler pricing), #688 (helios manifest), #704/#686 (docs). This is a standing/ownership fact for reviewers, not a judgement.

#8 [high] Why: issue #703 evidence, its four fix directions, and which #705 skips

The problem #705 addresses is issue #703 (open, by jcartu, opened 2026-12-03 09:50 — the same day the PR appeared; labels area:caching, area:memory, area:selene, bug, performance, triage:investigate). So the "want" is one day old at intake, not a long-standing request.

Issue #703 evidence (all author-captured on flare 0.5.1, 4× RTX PRO 6000 Blackwell SM120, DeepSeek-V4.1-Flash TP4, 154,510 KV pages, 1,871 snapshot slots, --max-concurrency 64 --prefix-cache-memory 8G --prefix-cache-disk ... --prefix-cache-disk-limit 100G):

Issue #703's four suggested fix directions map onto #705 as: (1) progress only on transitions → done; (2) gate/bound deferred slab retries by DRAM headroom without starving smaller publications → can_retry_slabs; (3) avoid spill_parked() on every Retry(Slabs) while writing == MAX_SPILLS → done; (4) (perf hardening) stop cloning the 154k page_snapshot_refs inside export_fits() → not done, explicitly out of scope. Note that #4 is the single largest hot cluster (13.12%) in the issue's own profile, so #705 leaves the reported top hotspot untouched and targets the amplification around it (which #705's own diff also touches via export_fits() gating — the gating avoids calling export_fits() at all for unready slab retries).

Descendant report lineage: the same class of bug was fixed before at the pool refusal path — #358 "Honor the pool refusal retry backoff and count refusal discards" (merged 2025-11-18, follow-up to #338, part of #335 "Prefix-cache pool and scheduler fixes from a production degradation (DeepSeek V4.1 TP4)"), which introduced refused_until = now + 50 ms so pool events cannot shorten a refusal backoff. #705's backoff_active()/retry_after gating in spill() and spill_parked() is the analogous guard for the local disk path.

#9 [high] Recent activity: #497 rewrote Worker::idle_wait days ago; #705 cites that region as a cadence guarantee

Recent activity in the touched areas (as far as the mirror allows; search_history errors with "Could not read c513e46a..." so commit-level history is unavailable — used PR metadata instead):

  1. helios/src/server/runtime.rs's idle/wake path was just rewritten by #497 "Reduce disk offload restore latency and integrated-memory intake overhead" (by FujitsuPolycom, merged 2026-11-29, +1809/−360). Its What section: "shorten Worker::idle_wait from 2 ms to 50 µs while an inbound restore is active or waiting". #705's PR body cites exactly that region (helios/src/server/runtime.rs:1214,1257-1290) and the 2 ms cap as what "enforces" its retry cadence — i.e. it builds on #497's change but reads it as a guarantee. #497's own reviewer twice wrote that "a completion wakeup would remove the poll instead of tuning it (helios/src/server/runtime.rs:1187-1195)" — so the polling-vs-wakeup question is an acknowledged open design thread that #705 leans on rather than resolves.
  2. The last merged functional change in this exact selene area is #610 "fix(selene): fix local storage tier, input cache, sharding, and codec edge cases" (yatesdr) and #607 (lukealonso); the spill/park machinery itself descends from #141/#142/#168/#337/#413/#415/#429/#358. MAX_SPILLS = 8 and the 50 ms backoff are long-standing constants unchanged by #705.
  3. helios/src/server/runtime.rs since 2026-11-24: #697 (merged 2026-12-03, preserve_message_anchor), #663 (merged, waiting-age pricing), #628, #626, #620, #619, #615, #607, #579, #505, #507, #497. #705's head is based on a main that already contains #697 (see entry 1), so it is current with the latest merged runtime.rs change.
  4. No commit on the default branch since the PR branched (cc0a49d) touches its changed files, per the orientation packet — so nothing in the mirror's main conflicts textually yet.

Community/process: #705 has zero comments, zero reviews, no labels, and "no checks" (no CI) on head eec5e95 at intake (2026-12-03). pr_comments → "No comments." No flare-autobot case file has been opened for it, unlike #690/#697/#694 where the bot posted a Review within hours. The author signs "Discord: jcartu"; #703 signs the same. Engagement level so far: none.

#10 [high] Claims and evidence: what is verified vs author-reported vs overstated

Claims in #705's body and what backs each: BACKED (verifiable in the diff):

NOT BACKED / OVERSTATED:

Verified implementation detail worth knowing when judging the ENOSPC half: on ENOSPC the write is re-parked with writing = false and a fresh Outbound (selene/src/composite.rs:665-688), retry_after = now + 50 ms is armed, and disk_stored returns false so no progress bump; poll() then converts the timer expiry into exactly one progress += 1 (composite.rs:1656-1662 region). held[0] is still incremented once per ENOSPC completion at composite.rs:667.

#12 [high] Research summary

Case file for PR #705 is in the scratchpad (11 entries, all six angles covered). Summary of where I got to:

Scope check first. pr_files says 6 files, +820/−71 (selene/src/composite.rs +519/−50, helios/src/server/runtime.rs +89/−21, phase_tests.rs +196, selene/src/store.rs +6, selene/src/pool/{store,local}.rs +4/+6). The whole-PR pr_diff additionally shows AGENTS.md, docs/, flare-cli/ and preserve_message_anchor hunks — those are base drift (merged #687/#689/#690/#697 that the mirror's main lacks), not PR content; I verified four independently. Readers must not mistake them for undeclared changes.

What I established. The mechanism (single reconciled pass over take_publications/deferred_stores/deferred_copyouts keyed by CheckpointId, progress only on genuine transitions, can_retry_slabs gating non-fresh Slabs retries before export_fits, ENOSPC no longer bumping progress, held[0] no longer inflated per rejected publication, spill() guarded against duplicate writes) matches the description. The nine new tests exist and are real; the full-suite/clippy numbers are author-reported with no CI on head eec5e95.

Where the description and the code diverge, or evidence runs out. (a) The claimed "2 ms idle poll cap" in Worker::run is not a cap: idle_wait() is 50 µs/100 µs/2 ms depending on state, is only reached with zero outstanding executor work, and on discrete GPUs park() returns false so the loop spin/yields by design. (b) The "CPU storm stopped" claim has no served-workload evidence — the only perf data is issue #703's profile of the pre-fix binary, and #703 says the storm was never reproduced on v0.5.3; this is the charter's #210 requirement unmet for a perf-titled PR. (c) #703's own hottest cluster (13.12%, cloning the 154k-element page_snapshot_refs inside export_fits()) is explicitly out of scope, though #705's gating does avoid calling export_fits() for unready retries. (d) held[0], progress and retry-wakeup semantics all change, but docs/prefix-cache-offload.md:293-297, 1364-1372 and docs/api.md are untouched and still describe the old contract.

Related work and people. Open #674 and #694 (both yatesdr) rewrite the same files, the same StoreOutcome match in service_store, and the same HostStore trait can_retry_slabs extends — no merge order recorded. #497 (merged 2026-11-29) just changed idle_wait 2 ms→50 µs and is the region #705 cites as a guarantee. The closest precedent is #358, which added the same 50 ms refusal backoff for the pool path. The author is a docs/helios contributor whose merged work barely touches selene, while selene/src/composite.rs is 18-of-20 recent PRs yatesdr's. Process: hours old, no labels, no reviews, no comments, no CI, no bot case file.

#3 [medium] Context: worker loop busy-spins by design on discrete GPUs; park() is a no-op there

When progress == false and executor.outstanding() > 0, Worker::run does if !executor.park() { std::hint::spin_loop(); } thread::yield_now(); (helios/src/server/runtime.rs:1248-1254). RankExecutor::park() (helios/src/execution/transport.rs:862-871) returns false immediately on discrete GPUs and non-Linux hosts ("preserve minimum-latency spin-yield polling"); only integrated Linux SoCs (Wfet) wait. So after #705 the worker still burns a core in a spin/yield loop whenever a GPU step is outstanding — the pre-existing design, unchanged. What #705 removes is the per-iteration export_fits() + store.store() + spill_parked() work that ran on every such iteration. Relevant framing: the issue's "100% of one core" symptom is partly by-design spinning; the storm was the amplification on top of it.

#11 [medium] Reach: no config/default/API breakage; operator-visible effect is metric semantics, not flags

Reach:

#13 [medium] Community: zero engagement on #705; ledger of every orientation-packet lead followed or dismissed

Orientation-packet leads and where each one landed (for the report's Related work / Community sections):

FOLLOWED, material:

CHECKED, not material (no competing or overlapping code for #705):

Community: pr_comments on #705 returns "No comments." — zero reviews, zero human comments, zero bot case file (contrast #690, #697, #694 where flare-autobot posted a case file + Review within hours of opening). No labels. No reactions recorded. Interest drawn so far: none, and the PR is only hours old at intake.

#14 [medium] Change: details the PR body does not list — a relaxed existing test, a latent panic fix, backoff widening

Details that a reviewer should know but that the PR body does not list as changes:

  1. An existing test was weakened to accommodate the new spill() guard. In selene/src/composite.rs's test module (near line 2730 at pr/705, the test that asserts store.stats().rows_thinned == [1, 0] and then spills a child), store.spill(child.key).unwrap(); became: if !store.parked[&child.key].writing { store.spill(child.key).unwrap(); } assert!(store.parked[&child.key].writing); The new if parked.writing { return None; } path in spill() (selene/src/composite.rs:819-821) makes a second spill() return None, so the test no longer asserts a successful spill unconditionally; it now accepts either "already writing" or "started". Not wrong, but it is an existing assertion relaxed, and the PR body's test section only mentions the 9 new tests.

  2. debug_assert! invariants are new in shipped code — writing_spills() (selene/src/composite.rs:751-771) asserts 1:1 between DiskJob::Write in self.jobs and parked.writing, and drop_parked_children already had a debug_assert!(!self.parked[&child].writing). These only run in debug/test builds; the PR body says verification ran in debug profile "so all new debug_assert! invariant checks executed", which is a meaningful disclosure.

  3. disk_stored() now silently removes an orphaned parked entry (self.parked.remove(&key); return true; when the DiskJob::Write exists but outbound does not, selene/src/composite.rs:661-664). The PR body frames this as "removing any orphaned parked entry so subsequent spill() calls cannot panic on self.outbound[&key]" — that is a latent panic fix, i.e. a bug fix riding along with the perf change, and the only test for it is the new disk_stored_returns_true_when_write_job_removed_without_outbound.

  4. waiting_spills() is now called at most once per spill_parked() and only when writing < MAX_SPILLS (previously the loop iterated waiting_spills()'s sorted vec unconditionally and also re-sorted for each rejection), so the Retry(Slabs) path no longer sorts parked keys at all when saturated — the concrete CPU saving the PR title advertises, reachable only when MAX_SPILLS writes are in flight (selene/src/composite.rs:884-911, 1378-1381).

  5. retry_after is now also respected in spill() and spill_parked() (selene/src/composite.rs:815-817, 892), not just in poll(); before, a store() rejection could start a spill during the ENOSPC backoff. That widening is described in the PR body only indirectly ("Under sustained ENOSPC, retry cadence is bounded to one probe per 50 ms backoff").

  6. CompositeStore::poll() reordering: the retry_after expiry check and stats.progress += 1 now happen before let progress = self.stats().progress; and the maintenance gate no longer has the || retry disjunct (selene/src/composite.rs poll, the diff hunk at ~1653-1670). Behaviourally: a maintenance pass now runs only on real progress change, and the timer expiry itself supplies that change — one pass per 50 ms instead of one per expiry plus one per event.